Skip to content

Commit 7ce6fdd

Browse files
committed
cifs: Fix integer overflow while processing acdirmax mount option
JIRA: https://issues.redhat.com/browse/RHEL-87940 CVE: CVE-2025-21963 commit 5b29891 Author: Murad Masimov <[email protected]> Date: Tue Mar 11 17:22:04 2025 +0300 cifs: Fix integer overflow while processing acdirmax mount option 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]> Signed-off-by: Paulo Alcantara <[email protected]>
1 parent b8b966e commit 7ce6fdd

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)