Re: rootfs exposure in /proc/mounts

From: Andreas Steinmetz (ast@domdv.de)
Date: Sat Oct 26 2002 - 19:22:46 EST


Jeff Garzik wrote:
> Andreas Steinmetz wrote:
>
>> Alexander Viro wrote:
>>
>>>
>>> On Sat, 26 Oct 2002, Andreas Steinmetz wrote:
>>>
>>>
>>>> Maybe I do oversee the obious but:
>>>>
>>>> can somebody please explain why rootfs is exposed in /proc/mounts (I
>>>> do mean the "rootfs / rootfs rw 0 0" entry) and if there is a good
>>>> reason for the exposure?
>>>
>>>
>>>
>>>
>>> Mostly the fact that it _is_ mounted and special-casing its removal from
>>> /proc/mounts is more PITA than it's worth.
>>>
>> Acceptable but somewhat sad as it confuses e.g. "umount -avt noproc"
>> which is somewhat standard in shutdown/reboot scripts (using a
>> softlink from /etc/mtab to /proc/mounts).
>
>
>
> Bug 1 - don't softlink directly to /proc/mounts :) embedded guys
> typically do this, and you see why it bites you in the ass :)
>
> Bug 2 - "noproc" clearly does not avoid ramfs mounts, which is rootfs's
> filesystem type. And more and more ramfs filesystems will be appearing,
> so that should be taken into consideration.
>
> Sounds like userspace slackness to me, and nothing that the kernel guys
> need to worry about...
>
Only if there's another method to retrieve all filesystems mounted from
userspace from the kernel. Though this may not be your view of things it
is the only way to ensure that one gets a valid mount list. And as
/proc/mounts is an interface to userspace it is my opinion that in
kernel private mounts that can't be modified from userspace don't need
to be listed there. Not my decision, anyway.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Oct 31 2002 - 22:00:32 EST