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]
Message-ID: <CAJCQCtTxMqZ_RGbXko0CLiYNJJ8U88i8F3UAs1h2X8nQNXHGRQ@mail.gmail.com>
Date:	Mon, 21 Mar 2016 11:22:06 -0600
From:	Chris Murphy <lists@...orremedies.com>
To:	Tycho Andersen <tycho.andersen@...onical.com>
Cc:	Btrfs BTRFS <linux-btrfs@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: confusing mountinfo output when bind-mounting files

On Mon, Mar 21, 2016 at 9:21 AM, Tycho Andersen
<tycho.andersen@...onical.com> wrote:
> Hi all,
>
> I'm seeing some strange behavior when bind mounting files from a btrfs
> subvolume. Consider the output below:
>
> root@...u2:/tmp# mount -o loop /tmp/tester.btrfs /tmp/dir1
> root@...u2:/tmp# touch dir1/file
> root@...u2:/tmp# sudo mount --bind dir1/file dir2/file
> root@...u2:/tmp# grep "/tmp/dir" /proc/self/mountinfo
> 128 24 0:45 / /tmp/dir1 rw,relatime shared:107 - btrfs /dev/loop0 rw,space_cache,subvolid=5,subvol=/
> 129 24 0:45 /file /tmp/dir2/file rw,relatime shared:107 - btrfs /dev/loop0 rw,space_cache,subvolid=5,subvol=/file
> root@...u2:/tmp# btrfs --version
> btrfs-progs v4.4
> root@...u2:/tmp# uname -a
> Linux criu2 4.4.0-8-generic #23-Ubuntu SMP Wed Feb 24 20:45:30 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
>
> The issue here is that the "subvol=" mount option for the target of the bind
> mount is "/file" when no such subvolume actually exists. Is this
> intended? It's confusing to say the least, but seems like a bug to me.

Since btrfs mount subvol=<name> is a bind mount behind the scene, I'm
not sure the mount info code distinguishes between bind mounts.

At the moment, this is something of a secret decoder ring where if you
see subvolid=5 first, then anything after that other than / is just
not true (can't be). Hence probably why both subvolid and subvol are
listed for now; you kinda have to parse them both.



-- 
Chris Murphy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ