Skip to content

Commit 7b9d8b5

Browse files
committed
cifs: Fix integer overflow while processing acregmax mount option
jira NONE_AUTOMATION cve CVE-2025-21964 Rebuild_History Non-Buildable kernel-5.14.0-570.18.1.el9_6 commit-author Murad Masimov <m.masimov@mt-integration.ru> commit 7489161 User-provided mount parameter acregmax 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: 5780464 ("cifs: Add new parameter "acregmax" for distinct file and directory metadata timeout") Signed-off-by: Murad Masimov <m.masimov@mt-integration.ru> Signed-off-by: Steve French <stfrench@microsoft.com> (cherry picked from commit 7489161) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent d443a8c commit 7b9d8b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/smb/client/fs_context.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,11 +1359,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
13591359
}
13601360
break;
13611361
case Opt_acregmax:
1362-
ctx->acregmax = HZ * result.uint_32;
1363-
if (ctx->acregmax > CIFS_MAX_ACTIMEO) {
1362+
if (result.uint_32 > CIFS_MAX_ACTIMEO / HZ) {
13641363
cifs_errorf(fc, "acregmax too large\n");
13651364
goto cifs_parse_mount_err;
13661365
}
1366+
ctx->acregmax = HZ * result.uint_32;
13671367
break;
13681368
case Opt_acdirmax:
13691369
ctx->acdirmax = HZ * result.uint_32;

0 commit comments

Comments
 (0)