Skip to content

Commit 4df7ec9

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 6124cbf commit 4df7ec9

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
@@ -1298,7 +1298,7 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
12981298
ctx->acdirmax = HZ * result.uint_32;
12991299
break;
13001300
case Opt_actimeo:
1301-
if (HZ * result.uint_32 > CIFS_MAX_ACTIMEO) {
1301+
if (result.uint_32 > CIFS_MAX_ACTIMEO / HZ) {
13021302
cifs_errorf(fc, "timeout too large\n");
13031303
goto cifs_parse_mount_err;
13041304
}

0 commit comments

Comments
 (0)