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, 10 Oct 2013 01:46:26 -0500
From:	Rob Landley <rob@...dley.net>
To:	Karel Zak <kzak@...hat.com>
Cc:	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Miklos Szeredi <miklos@...redi.hu>,
	"Serge E. Hallyn" <serge@...lyn.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Linux-Fsdevel <linux-fsdevel@...r.kernel.org>,
	Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andy Lutomirski <luto@...capital.net>
Subject: Re: [RFC][PATCH 0/3] vfs: Detach mounts on unlink.

On 10/08/2013 03:03:03 AM, Karel Zak wrote:
> On Sat, Oct 05, 2013 at 06:42:44PM -0500, Rob Landley wrote:
> > Oh, attached is a dumb "zapchroot" script I've been using for years  
> to
> > unlink all mount points under a given directory, taking advantage  
> of the
> > fact that mount points are appended to the end of the list so if  
> you unlink
> > from the end to the front you should get the sub-mounts before the  
> parent
> > mounts (modulo mount --move not reordering the list, but that's  
> uncommon).
> 
>  util-linux umount supports --recursive, it uses /proc/self/mountinfo
>  to compose the hierarchy. The important is that the mountinfo file
>  contains Id and Parent_Id relations, so you don't rely on the order
>  only.

Ah, that's what happened.

For some reason /proc/self/mounts stopped adjusting itself for chroot a  
while back, apparently because containers use switch_root instead so  
chroot is generally deprecated or something? This made /proc/mounts  
completely useless in a chroot because the paths it showed were not the  
ones you actually had to use to umount anything.

Instead they added a new way to get this info, in a new format where  
you have to parse the 5th field out of each line to get the mount point  
(to make it friendly to scripts and tools).

Good to know.

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