security issue: same uuid used twice
possible security issue in linux kernel:
Imagine you have an public linux computer (e.g. internet cafe) and you don't want someone (that is sitting at this pc) being root on this machine or allow any permanent changes on this computer.
Assume the BIOS is protected (password) and no other device than /dev/sda (hdd) is used for "/boot/" and "/" (usb-boot is disabled). The PC has visible/accessable USB ports which are seen by the used kernel.
(now the problem case)
If a user (not admin/root) enters "ls /dev/disk/by-uuid/" , he can see the UUIDs on this device.
He could prepare an USB filesystem using same UUID and having a similar content than "/" (linux installation using same kernel, but dangerous changes, e.g. rootkit). If the system is booting (/boot on hdd is used as usual), the kernel is looking for all visible filesystems and will find the same UUID twice (/dev/sda and usb-stick). Depending on which drive has been seen last, he will mount (my experience in 2009) the usb-filesystem, not the one on hdd.
Remember: the default way of mounting root-filesystem is by UUID! (/boot/grub/menu.lst: .. root=UUID=...)
I think the kernel is not prepared to handle identical UUIDs in one system!
Of course, this is an attack, but the kernel should be save against this.
I think the kernel should at least post an error-log (because I got confused some time ago because of accidentally using dd in a wrong way)
and there should be an parameter to specify the behavior in this case of double UUID.
Please comment on this.