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>] [day] [month] [year] [list]
Date:	Thu, 07 Mar 2013 23:34:58 -0500
From:	shea@...alevy.com
To:	<linux-fsdevel@...r.kernel.org>
Cc:	Alexander Viro <viro@...iv.linux.org.uk>,
	<linux-kernel@...r.kernel.org>
Subject: Re-mounting a non-bind mountpoint with MS_BIND

Hello,

To my surprise, mount("/dev/sda1", "/mnt", "vfat", MS_RDONLY, "") 
followed by mount("/mnt", "/mnt", 0, MS_REMOUNT | MS_BIND, 0) succeeds, 
with some IMO odd behavior:

* statfs(2) on /mnt shows /mnt as not being readonly in the s_flags 
field
* The sixth column of relevant mountinfo files (but not the tenth!) 
shows /mnt as being rw
* All other syscalls (AFAICT, I checked with git grep MNT_READONLY) 
behave as if /mnt were readonly

Why does mount behave like this? To me it would make much more sense if 
either MS_REMOUNT | MS_BIND failed on a non-bind mountpoint (my personal 
preference) or if it succeeded but the mountpoint was still treated as 
readonly from the perspective of all userspace interfaces.

Cheers,
Shea Levy

P.S. I am not subscribed to fsdevel or lkml, so please CC me in 
responses.
--
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