lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 14 Mar 2013 12:09:19 -0400
From:	Shea Levy <shea@...alevy.com>
To:	Alexander Viro <viro@...iv.linux.org.uk>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:	Shea Levy <shea@...alevy.com>
Subject: [PATCH 1/2] vfs: mountinfo: A mnt is r/o if the superblock is

By calling mount(2) with MS_REMOUNT | MS_BIND on a non-bind readonly
mountpoint, it is possible to have a readonly mount without MNT_READONLY
in its mnt_flags. Currently, /proc/<pid>/mountinfo will report such a
mount as r/w in the 4th column, even though for all intents and purposes
it is still readonly.

This patch makes show_mountinfo use __mnt_is_readonly to check if a
mount is readonly, which checks both for MNT_READONLY in mnt_flags and
for MS_RDONLY in mnt_sb->s_flags.

Signed-off-by: Shea Levy <shea@...alevy.com>
---
 fs/proc_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c
index 5fe34c3..cf8963c 100644
--- a/fs/proc_namespace.c
+++ b/fs/proc_namespace.c
@@ -143,7 +143,7 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt)
 	if (err)
 		goto out;
 
-	seq_puts(m, mnt->mnt_flags & MNT_READONLY ? " ro" : " rw");
+	seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw");
 	show_mnt_opts(m, mnt);
 
 	/* Tagged fields ("foo:X" or "bar") */
-- 
1.8.1.3

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ