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: <20230607-rennpferd-stechen-2f645ac78fcc@brauner>
Date:   Wed, 7 Jun 2023 21:39:01 +0200
From:   Christian Brauner <brauner@...nel.org>
To:     Thomas Weißschuh <linux@...ssschuh.net>
Cc:     Alexander Viro <viro@...iv.linux.org.uk>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        David Howells <dhowells@...hat.com>,
        Karel Zak <kzag@...hat.com>, stable@...r.kernel.org
Subject: Re: [PATCH] fs: avoid empty option when generating legacy mount
 string

On Wed, Jun 07, 2023 at 07:28:48PM +0200, Thomas Weißschuh wrote:
> As each option string fragment is always prepended with a comma it would
> happen that the whole string always starts with a comma.
> This could be interpreted by filesystem drivers as an empty option and
> may produce errors.
> 
> For example the NTFS driver from ntfs.ko behaves like this and fails when
> mounted via the new API.
> 
> Link: https://github.com/util-linux/util-linux/issues/2298

Yeah, the old ntfs driver implements its own option parser. It
overwrites/splits at ',' returning '\0' and then trips over this.

Contrast with e.g., ovl_next_op() which does the same thing but skips
over '\0' in ovl_parse_opt().

So arguably also a bug in ntfs parsing. But there's no reason we should
prepend ',' for legacy mount option strings.

And yeah, I can easily verify this...

Using my custom move-mount tool I originally wrote for another patchset
but which is handy to pass mount options via the new mount api _system_
calls and not via mount():
https://github.com/brauner/move-mount-beneath

I can do:

        sudo ./move-mount -f overlay -olowerdir=/mnt/a:/mnt/b,upperdir=/mnt/upper,workdir=/mnt/work /mnt/merged

and clearly see:

        > sudo bpftrace -e 'kfunc:legacy_get_tree { @m = args->fc; printf("%s\n", str(((struct legacy_fs_context *)@m->fs_private)->legacy_data)); }'
        Attaching 1 probe...
        ,lowerdir=/mnt/a:/mnt/b,upperdir=/mnt/upper,workdir=/mnt/work

> Fixes: 3e1aeb00e6d1 ("vfs: Implement a filesystem superblock creation/configuration context")

Should be:

Fixes: commit 3e1aeb00e6d1 ("vfs: Implement a filesystem superblock creation/configuration context")

and misses a:

Cc: stable@...r.kernel.org

I'll fix this up for you though.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ