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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 3 Mar 2011 10:17:32 -0800
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Ken Sumrall <ksumrall@...roid.com>
Cc:	linux-kernel@...r.kernel.org,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Christoph Hellwig <hch@....de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jan Kara <jack@...e.cz>, Jens Axboe <axboe@...nel.dk>,
	Matthew Wilcox <matthew@....cx>,
	Eric Paris <eparis@...hat.com>,
	Dave Young <hidave.darkstar@...il.com>,
	Jiri Slaby <jslaby@...e.cz>, James Morris <jmorris@...ei.org>,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] Syscalls: reboot: Add options to the reboot syscall to
 remount filesystems ro

On Thu, Mar 3, 2011 at 9:45 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> How many mounted filesystems do you have that it's so hard to keep track of?

Btw, /proc/mounts will track them for you even if you don't have a
'mount' binary that does.

Parsing that is pretty trivial. If you have spaces or special
characters in your pathnames (you may control the mount paths, you may
not - I have no idea), you'll need to be able to handle the escape
format (\oct). But other than that, it's literally just

 - read all of /proc/mounts into a buffer

 - for each line, split by space, and you'll have the directory name
right there in the second field

 - do the unescaping ("\oct" -> character) if needed. It's good
practice. Test it.

 - just do a read-only remount on it.

All done. No kernel changes necessary. It just works.

                            Linus
--
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