From: Luis Henriques <lhenriques@suse.de>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Amir Goldstein <amir73il@gmail.com>,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] ovl: fix the parsing of empty string mount parameters
Date: Mon, 11 Mar 2024 13:23:25 +0000 [thread overview]
Message-ID: <87cys0x5pu.fsf@suse.de> (raw)
In-Reply-To: <CAJfpeguN9nMJGJzx8sgwP=P9rJFVkYF5rVZOi_wNu7mj_jfBsA@mail.gmail.com> (Miklos Szeredi's message of "Mon, 11 Mar 2024 11:53:03 +0100")
Miklos Szeredi <miklos@szeredi.hu> writes:
> On Mon, 11 Mar 2024 at 11:34, Luis Henriques <lhenriques@suse.de> wrote:
>>
>> Miklos Szeredi <miklos@szeredi.hu> writes:
>>
>> > On Thu, 7 Mar 2024 at 19:17, Luis Henriques <lhenriques@suse.de> wrote:
>> >>
>> >> This patch fixes the usage of mount parameters that are defined as strings
>> >> but which can be empty. Currently, only 'lowerdir' parameter is in this
>> >> situation for overlayfs. But since userspace can pass it in as 'flag'
>> >> type (when it doesn't have a value), the parsing will fail because a
>> >> 'string' type is assumed.
>> >
>> > I don't really get why allowing a flag value instead of an empty
>> > string value is fixing anything.
>> >
>> > It just makes the API more liberal, but for what gain?
>>
>> The point is that userspace may be passing this parameter as a flag and
>> not as a string. I came across this issue with ext4, by doing something
>> as simple as:
>>
>> mount -t ext4 -o usrjquota= /dev/sda1 /mnt/
>>
>> (actually, the trigger was fstest ext4/053)
>>
>> The above mount should succeed. But it fails because 'usrjquota' is set
>> to a 'flag' type, not 'string'.
>
> The above looks like a misparsing, since the equals sign clearly
> indicates that this is not a flag.
No, not really. The same thing happens without the '=':
mount -t ext4 -o usrjquota /dev/loop0p1 /mnt/
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/loop0p1, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
The parsing code gets a FSCONFIG_SET_FLAG instead of FSCONFIG_SET_STRING.
>> Note that I couldn't find a way to reproduce the same issue in overlayfs
>> with this 'lowerdir' parameter. But looking at the code the issue is
>> similar.
>
> In overlayfs the empty lowerdir parameter has a special meaning when
> lowerdirs are appended instead of parsed in one go. As such it won't
> be used from /etc/fstab for example, as that would just result in a
> failed mount.
>
> I don't see a reason to allow it as a flag for overlayfs, since that
> just add ambiguity to the API.
Fine with me. But it'd be nice to double-check (by testing) that when
overlayfs gets a 'lowerdir' without a value it really is doing what you'd
expect it to do.
Cheers,
--
Luís
next prev parent reply other threads:[~2024-03-11 13:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-07 16:02 [PATCH v2 0/3] fs_parser: handle parameters that can be empty and don't have a value Luis Henriques
2024-03-07 16:02 ` [PATCH v2 1/3] fs_parser: add helper to define parameters with string and flag types Luis Henriques
2024-03-07 16:02 ` [PATCH v2 2/3] ext4: fix the parsing of empty string mount parameters Luis Henriques
2024-03-25 4:39 ` kernel test robot
2024-03-07 16:02 ` [PATCH v2 3/3] ovl: " Luis Henriques
2024-03-11 9:25 ` Miklos Szeredi
2024-03-11 10:34 ` Luis Henriques
2024-03-11 10:53 ` Miklos Szeredi
2024-03-11 13:23 ` Luis Henriques [this message]
2024-03-11 13:25 ` Christian Brauner
2024-03-11 14:39 ` Miklos Szeredi
2024-03-11 18:01 ` Jan Kara
2024-03-12 8:50 ` Christian Brauner
2024-03-12 8:47 ` Christian Brauner
2024-03-12 10:31 ` Luis Henriques
2024-03-22 14:22 ` Christian Brauner
2024-03-22 15:17 ` Luis Henriques
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87cys0x5pu.fsf@suse.de \
--to=lhenriques@suse.de \
--cc=adilger.kernel@dilger.ca \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).