The valid values of options that are defined with fsparam_u32() should be positive. But the fs parser will return a fail for values that are negative and if the sloppy option is given success will then be returned resulting in the option being silently ignored. Also the sloppy option handling is meant to return success for invalid options not valid options with invalid values. Restricting the sloppy option override to handle failure returns for invalid options only is sufficient to resolve these problems. Signed-off-by: Ian Kent <raven@xxxxxxxxxx> Signed-off-by: Leif Sahlberg <lsahlber@xxxxxxxxxx> --- fs/cifs/fs_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/fs_context.c b/fs/cifs/fs_context.c index 8dc0d923ef6a..2dc5cdeee354 100644 --- a/fs/cifs/fs_context.c +++ b/fs/cifs/fs_context.c @@ -863,7 +863,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc, if (!skip_parsing) { opt = fs_parse(fc, smb3_fs_parameters, param, &result); if (opt < 0) - return ctx->sloppy ? 1 : opt; + return (opt == -ENOPARAM && ctx->sloppy) ? 1 : opt; } switch (opt) {