[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <165544249242.247784.13096425754908440867.stgit@donald.themaw.net>
Date: Fri, 17 Jun 2022 13:08:53 +0800
From: Ian Kent <raven@...maw.net>
To: Al Viro <viro@...IV.linux.org.uk>
Cc: Siddhesh Poyarekar <siddhesh@...plt.org>,
David Howells <dhowells@...hat.com>,
Miklos Szeredi <miklos@...redi.hu>,
Carlos Maiolino <cmaiolino@...hat.com>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH 0/2] vfs: fix a couple of mount table handling problems
First, whenever a mount has an empty "source" (aka mnt_fsname), the
glibc function getmntent incorrectly parses its input, resulting in
reporting incorrect data to the caller.
The problem is that the get_mnt_entry() function in glibc's
misc/mntent_r.c assumes that leading whitespace on a line can always
be discarded because it will always be followed by a # for the case
of a comment or a non-whitespace character that's part of the value
of the first field. However, this assumption is violated when the
value of the first field is an empty string.
This is fixed in the mount API code by simply checking for a pointer
that contains a NULL and treating it as a NULL pointer.
Second, when a filesystem is mounted with a name that starts with
a # the glibc finction getmentent() will interpret the leading #
as a comment so that the mount line will not appear in the output.
This is fixed by adding a # to the to be translated string in
fs/proc_namespace.c:mangle().
Signed-off-by: Ian Kent <raven@...maw.net>
---
Ian Kent (1):
vfs: parse: deal with zero length string value
Siddhesh Poyarekar (1):
vfs: escape hash as well
fs/fs_context.c | 10 +++++++---
fs/proc_namespace.c | 2 +-
2 files changed, 8 insertions(+), 4 deletions(-)
--
Ian Kent
Powered by blists - more mailing lists