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, 12 Dec 2019 17:32:15 -0500
From:   Laura Abbott <labbott@...hat.com>
To:     Al Viro <viro@...iv.linux.org.uk>
Cc:     David Howells <dhowells@...hat.com>,
        Jeremi Piotrowski <jeremi.piotrowski@...il.com>,
        Linux FS Devel <linux-fsdevel@...r.kernel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Phillip Lougher <phillip@...ashfs.org.uk>,
        linux-kernel@...r.kernel.org, Ilya Dryomov <idryomov@...il.com>
Subject: Re: [PATCH] vfs: Handle file systems without ->parse_params better

On 12/12/19 4:47 PM, Al Viro wrote:
> On Thu, Dec 12, 2019 at 04:36:04PM -0500, Laura Abbott wrote:
>> @@ -141,14 +191,19 @@ int vfs_parse_fs_param(struct fs_context *fc, struct fs_parameter *param)
>>   		 */
>>   		return ret;
>>   
>> -	if (fc->ops->parse_param) {
>> -		ret = fc->ops->parse_param(fc, param);
>> -		if (ret != -ENOPARAM)
>> -			return ret;
>> -	}
>> +	parse_param = fc->ops->parse_param;
>> +	if (!parse_param)
>> +		parse_param = fs_generic_parse_param;
>> +
>> +	ret = parse_param(fc, param);
>> +	if (ret != -ENOPARAM)
>> +		return ret;
>>   
>> -	/* If the filesystem doesn't take any arguments, give it the
>> -	 * default handling of source.
>> +	/*
>> +	 * File systems may have a ->parse_param function but rely on
>> +	 * the top level to parse the source function. File systems
>> +	 * may have their own source parsing though so this needs
>> +	 * to come after the call to parse_param above.
>>   	 */
>>   	if (strcmp(param->key, "source") == 0) {
>>   		if (param->type != fs_value_is_string)
>> -- 
>> 2.21.0
> 
> No.  Please, get rid of the boilerplate.  About 80% of that thing
> is an absolutely pointless dance around "but we need that to call
> fs_parse()".  We do *NOT* need to call fs_parse() here.  We do
> not need a struct fs_parameter_description instance.  We do not
> need struct fs_parameter_spec instances.  We do not need a magical
> global constant.  And I'm not entirely convinced that we need
> to make fs_generic_parse_param() default - filesystems that
> want this behaviour can easily ask for it.  A sane default is
> to reject any bogus options.
> 

Well the existing behavior was to silently ignore options by
default so this was an attempt to preserve that behavior for
everything rather than keep hitting user visible bugs. I'd
rather not have to deal this this for each file system.

> I would call it ignore_unknowns_parse_param(), while we are at it.
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ