Skip to content

Commit bfa890a

Browse files
spuiukSteve French
authored andcommitted
Fix number parsing in cifs_parse_mount_options
The function kstrtoul() used to parse number strings in the mount option parser is set to expect a base 10 number . This treats the octal numbers passed for mount options such as file_mode as base10 numbers leading to incorrect behavior. Change the 'base' argument passed to kstrtoul from 10 to 0 to allow it to auto-detect the base of the number passed. Signed-off-by: Sachin Prabhu <[email protected]> Acked-by: Jeff Layton <[email protected]> Reported-by: Chris Clayton <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 4fe9e96 commit bfa890a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ static int get_option_ul(substring_t args[], unsigned long *option)
11231123
string = match_strdup(args);
11241124
if (string == NULL)
11251125
return -ENOMEM;
1126-
rc = kstrtoul(string, 10, option);
1126+
rc = kstrtoul(string, 0, option);
11271127
kfree(string);
11281128

11291129
return rc;

0 commit comments

Comments
 (0)