在 2025/1/17 07:59, Al Viro 写道:
On Fri, Jan 17, 2025 at 07:39:09AM +1030, Qu Wenruo wrote:
The original problem is that we can get very weird device path, like
'/proc/<pid>/<fd>' or any blockdev node created by the end user, as
mount source, which can cause various problems in mount_info for end users.
You do realize that different namespaces may very well have the same
pathname resolve to different things, right? So "userland can't open
a device pathname it sees in /proc/self/mountinfo" was not going to
be solved that way anyway...
While we are at it, it is entirely possible to have a trimmed-down
ramfs with the minimal set of static device nodes mounted on
/dev in user's namespace, with not a block device in sight - despite
having a bunch of local filesystems mounted.
So it just means, we will have weird names in mountinfo, and we can only
accept that?
If some weird programs (exactly the one mentioned in 7e06de7c83a7
("btrfs: canonicalize the device path before adding it")) really choose
to do stupid things, we have no way to prevent it from happening, and
can only blame the program?
Thanks,
Qu