[PATCH] cifs: fix negative option value parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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) {





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux