[Bug 917446] [NEW] switch_root does not allow switching to a non-block device as the new root filesytem
Mickey
917446 at bugs.launchpad.net
Tue Jan 17 01:33:40 UTC 2012
Public bug reported:
The current switch_root does a sanity check to ensure that it does not
wipe out the new root filesystem by checking the device id of the parent
and child directories. If they are the same, then the child directory is
not considered a mount point and the contents are deleted recursively.
This presents a problem because non-block device mounted file systems
such as tmpfs and ramfs both report the same device id from struct stat.
Which is '0'.
So if you have your to-be root filesystem contained in a non-block
device (/proc/filesystems: nodev entries), it will be wiped out before
chroot/execve ever happens.
This can be verified by running stat against the root and to-be root
filesystems in the initramfs.
Releases affected = All
Versions affected = All
** Affects: util-linux (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to util-linux in Ubuntu.
https://bugs.launchpad.net/bugs/917446
Title:
switch_root does not allow switching to a non-block device as the new
root filesytem
Status in “util-linux” package in Ubuntu:
New
Bug description:
The current switch_root does a sanity check to ensure that it does not
wipe out the new root filesystem by checking the device id of the
parent and child directories. If they are the same, then the child
directory is not considered a mount point and the contents are deleted
recursively.
This presents a problem because non-block device mounted file systems
such as tmpfs and ramfs both report the same device id from struct
stat. Which is '0'.
So if you have your to-be root filesystem contained in a non-block
device (/proc/filesystems: nodev entries), it will be wiped out before
chroot/execve ever happens.
This can be verified by running stat against the root and to-be root
filesystems in the initramfs.
Releases affected = All
Versions affected = All
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/917446/+subscriptions
More information about the foundations-bugs
mailing list