Re: Pathnames in /proc

Savochkin Andrey Vladimirovich (saw@msu.ru)
Tue, 23 Jun 1998 19:37:28 +0400


On Tue, Jun 23, 1998 at 03:31:28AM +0000, H. Peter Anvin wrote:
> There are a number of /proc files which contain filenames, including
> /proc/mounts. With the new dentry stuff these can be made
> kernel-enforced reliable, which is a Good Thing[TM]. However, these
> are typically delimitered by whitespace or newlines, which isn't good,
> as these are legal filename characters. I would like to suggest the
> convention that everywhere these is a filename in /proc (unless it is
> the *entire* /proc file) there is a \0 character appended, since \0 is
> the only character that is not legal in filenames (see POSIX.1).

I've just booted a test kernel with \0 in /proc/mounts
to see what utilities it confuses.
I keep /etc/mtab as a link to /proc/mounts.
Unfortunately, the change break most utilities dealing with /etc/mtab.
The quick observation shows that getmntent() is a culprit.
I see no solution to make /proc/mounts reliable and to not break
many system utilities at the same time.

> Furthermore, \0 is not displayed on terminals, so it shouldn't affect
> just catting it to the terminal. It may break simpleminded /proc
> utilities, but those utilities are already broken, and may constitute
> security holes.

Regards
Andrey V.
Savochkin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu