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: <20170529120818.GA6365@ZenIV.linux.org.uk>
Date:   Mon, 29 May 2017 13:08:25 +0100
From:   Al Viro <viro@...IV.linux.org.uk>
To:     Richard Weinberger <richard@....at>
Cc:     Rabin Vincent <rabin.vincent@...s.com>, dedekind1@...il.com,
        adrian.hunter@...el.com, linux-mtd@...ts.infradead.org,
        linux-kernel@...r.kernel.org, Rabin Vincent <rabinv@...s.com>,
        linux-fsdevel <linux-fsdevel@...r.kernel.org>,
        Christoph Hellwig <hch@...radead.org>
Subject: Re: Setting ->s_dev to a char device (Was: Re: [PATCH v2] ubifs:
 allow userspace to map mounts to volumes)

On Mon, May 29, 2017 at 01:50:30PM +0200, Richard Weinberger wrote:
> CC'ing VFS folks
> 
> Am 29.05.2017 um 09:22 schrieb Rabin Vincent:
> > From: Rabin Vincent <rabinv@...s.com>
> > 
> > There currently appears to be no way for userspace to find out the
> > underlying volume number for a mounted ubifs file system, since ubifs
> > uses anonymous block devices.  The volume name is present in
> > /proc/mounts but UBI volumes can be renamed after the volume has been
> > mounted.
> > 
> > To remedy this, provide a directory in /sys/fs/ubifs named after the
> > underlying anonymous block device's number (obtainable by userspace via
> > stat(2)) and provide a link named "ubi" to the underlying UBI volume.
> 
> I wonder whether it would make more sense to just assign the character device
> number of the UBI volume to ->s_dev.
> Then userspace can query the underlying device without additional sysfs
> magic.
> 
> Sure if userspace expects a block number from UBIFS it will get confused.
> 
> Comments?

Userspace sure as hell does.  st_dev in stat(2) is a block device number;
moreover, there might _be_ a block device with the same number at the same
time - even mounted.  Why not make ->show_options() print the currently
valid volume name, anyway?  That would seem to be the obvious approach...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ