Skip to content

Commit babdb6d

Browse files
committed
cifs: Fix integer overflow while processing acdirmax mount option
JIRA: https://issues.redhat.com/browse/RHEL-87947 CVE: CVE-2025-21963 commit 5b29891 Author: Murad Masimov <m.masimov@mt-integration.ru> 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 <m.masimov@mt-integration.ru> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Paulo Alcantara <paalcant@redhat.com>
1 parent dbbb95d commit babdb6d

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
@@ -1293,11 +1293,11 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
12931293
ctx->acregmax = HZ * result.uint_32;
12941294
break;
12951295
case Opt_acdirmax:
1296-
ctx->acdirmax = HZ * result.uint_32;
1297-
if (ctx->acdirmax > CIFS_MAX_ACTIMEO) {
1296+
if (result.uint_32 > CIFS_MAX_ACTIMEO / HZ) {
12981297
cifs_errorf(fc, "acdirmax too large\n");
12991298
goto cifs_parse_mount_err;
13001299
}
1300+
ctx->acdirmax = HZ * result.uint_32;
13011301
break;
13021302
case Opt_actimeo:
13031303
if (HZ * result.uint_32 > CIFS_MAX_ACTIMEO) {

0 commit comments

Comments
 (0)