Skip to content

Commit d5fff81

Browse files
Murad Masimovgregkh
authored andcommitted
cifs: Fix integer overflow while processing actimeo mount option
[ Upstream commit 64f690e ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9e438d0 commit d5fff81

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/smb/client/fs_context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
12801280
ctx->acdirmax = HZ * result.uint_32;
12811281
break;
12821282
case Opt_actimeo:
1283-
if (HZ * result.uint_32 > CIFS_MAX_ACTIMEO) {
1283+
if (result.uint_32 > CIFS_MAX_ACTIMEO / HZ) {
12841284
cifs_errorf(fc, "timeout too large\n");
12851285
goto cifs_parse_mount_err;
12861286
}

0 commit comments

Comments
 (0)