Skip to content

Commit 64f690e

Browse files
Murad MasimovSteve French
authored andcommitted
cifs: Fix integer overflow while processing actimeo mount option
User-provided mount parameter actimeo of type u32 is intended to have an upper limit, but before it is validated, the value is converted from seconds to jiffies which can lead to an integer overflow. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 6d20e84 ("cifs: add attribute cache timeout (actimeo) tunable") Signed-off-by: Murad Masimov <m.masimov@mt-integration.ru> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 5b29891 commit 64f690e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/client/fs_context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
13581358
ctx->acdirmax = HZ * result.uint_32;
13591359
break;
13601360
case Opt_actimeo:
1361-
if (HZ * result.uint_32 > CIFS_MAX_ACTIMEO) {
1361+
if (result.uint_32 > CIFS_MAX_ACTIMEO / HZ) {
13621362
cifs_errorf(fc, "timeout too large\n");
13631363
goto cifs_parse_mount_err;
13641364
}

0 commit comments

Comments
 (0)