Skip to content

Commit 8a368f6

Browse files
committed
cifs: Fix integer overflow while processing acdirmax mount option
jira LE-3262 cve CVE-2025-21963 Rebuild_History Non-Buildable kernel-5.14.0-570.22.1.el9_6 commit-author Murad Masimov <[email protected]> commit 5b29891 User-provided mount parameter acdirmax 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: 4c9f948 ("cifs: Add new mount parameter "acdirmax" to allow caching directory metadata") Signed-off-by: Murad Masimov <[email protected]> Signed-off-by: Steve French <[email protected]> (cherry picked from commit 5b29891) Signed-off-by: Jonathan Maple <[email protected]>
1 parent e883ebb commit 8a368f6

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
@@ -1366,11 +1366,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
13661366
ctx->acregmax = HZ * result.uint_32;
13671367
break;
13681368
case Opt_acdirmax:
1369-
ctx->acdirmax = HZ * result.uint_32;
1370-
if (ctx->acdirmax > CIFS_MAX_ACTIMEO) {
1369+
if (result.uint_32 > CIFS_MAX_ACTIMEO / HZ) {
13711370
cifs_errorf(fc, "acdirmax too large\n");
13721371
goto cifs_parse_mount_err;
13731372
}
1373+
ctx->acdirmax = HZ * result.uint_32;
13741374
break;
13751375
case Opt_actimeo:
13761376
if (HZ * result.uint_32 > CIFS_MAX_ACTIMEO) {

0 commit comments

Comments
 (0)