# CVE-2024-53178: smb: Don't leak cfid when reconnect races with open\_cached\_dir

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.71% (percentile 49, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2024-12-27T13:49:22.085Z
- **Modified:** 2026-10-30T13:17:44.463Z

## Who should check

- Anyone running Linux \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< c8bf625e188593232d515fb50e240305b6ae14dd; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 31fabf70d58388d5475e48ca8a6b7d2847b36678; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 1d76332d783db12684b67592f1fb2057b88af4c3; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 73a57b25b4df23f22814fc06b7e8f9cf570be026; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 7afb86733685c64c604d32faf00fa4a1f22c2ab1
- Anyone running Linux 6.1

## Description

In the Linux kernel, the following vulnerability has been resolved:

smb: Don't leak cfid when reconnect races with open\_cached\_dir

open\_cached\_dir() may either race with the tcon reconnection even before
compound\_send\_recv() or directly trigger a reconnection via
SMB2\_open\_init() or SMB\_query\_info\_init().

The reconnection process invokes invalidate\_all\_cached\_dirs() via
cifs\_mark\_open\_files\_invalid(), which removes all cfids from the
cfids-\>entries list but doesn't drop a ref if has\_lease isn't true. This
results in the currently-being-constructed cfid not being on the list,
but still having a refcount of 2. It leaks if returned from
open\_cached\_dir().

Fix this by setting cfid-\>has\_lease when the ref is actually taken; the
cfid will not be used by other threads until it has a valid time.

Addresses these kmemleaks:

unreferenced object 0xffff8881090c4000 (size 1024):
  comm "bash", pid 1860, jiffies 4295126592
  hex dump (first 32 bytes):
    00 01 00 00 00 00 ad de 22 01 00 00 00 00 ad de  ........".......
    00 ca 45 22 81 88 ff ff f8 dc 4f 04 81 88 ff ff  ..E"......O.....
  backtrace (crc 6f58c20f):
    \[\<ffffffff8b895a1e\>\] \_\_kmalloc\_cache\_noprof+0x2be/0x350
    \[\<ffffffff8bda06e3\>\] open\_cached\_dir+0x993/0x1fb0
    \[\<ffffffff8bdaa750\>\] cifs\_readdir+0x15a0/0x1d50
    \[\<ffffffff8b9a853f\>\] iterate\_dir+0x28f/0x4b0
    \[\<ffffffff8b9a9aed\>\] \_\_x64\_sys\_getdents64+0xfd/0x200
    \[\<ffffffff8cf6da05\>\] do\_syscall\_64+0x95/0x1a0
    \[\<ffffffff8d00012f\>\] entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e
unreferenced object 0xffff8881044fdcf8 (size 8):
  comm "bash", pid 1860, jiffies 4295126592
  hex dump (first 8 bytes):
    00 cc cc cc cc cc cc cc                          ........
  backtrace (crc 10c106a9):
    \[\<ffffffff8b89a3d3\>\] \_\_kmalloc\_node\_track\_caller\_noprof+0x363/0x480
    \[\<ffffffff8b7d7256\>\] kstrdup+0x36/0x60
    \[\<ffffffff8bda0700\>\] open\_cached\_dir+0x9b0/0x1fb0
    \[\<ffffffff8bdaa750\>\] cifs\_readdir+0x15a0/0x1d50
    \[\<ffffffff8b9a853f\>\] iterate\_dir+0x28f/0x4b0
    \[\<ffffffff8b9a9aed\>\] \_\_x64\_sys\_getdents64+0xfd/0x200
    \[\<ffffffff8cf6da05\>\] do\_syscall\_64+0x95/0x1a0
    \[\<ffffffff8d00012f\>\] entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e

And addresses these BUG splats when unmounting the SMB filesystem:

BUG: Dentry ffff888140590ba0{i=1000000000080,n=/}  still in use (2) \[unmount of cifs cifs\]
WARNING: CPU: 3 PID: 3433 at fs/dcache.c:1536 umount\_check+0xd0/0x100
Modules linked in:
CPU: 3 UID: 0 PID: 3433 Comm: bash Not tainted 6.12.0-rc4-g850925a8133c-dirty \#49
Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
RIP: 0010:umount\_check+0xd0/0x100
Code: 8d 7c 24 40 e8 31 5a f4 ff 49 8b 54 24 40 41 56 49 89 e9 45 89 e8 48 89 d9 41 57 48 89 de 48 c7 c7 80 e7 db ac e8 f0 72 9a ff \<0f\> 0b 58 31 c0 5a 5b 5d 41 5c 41 5d 41 5e 41 5f e9 2b e5 5d 01 41
RSP: 0018:ffff88811cc27978 EFLAGS: 00010286
RAX: 0000000000000000 RBX: ffff888140590ba0 RCX: ffffffffaaf20bae
RDX: dffffc0000000000 RSI: 0000000000000008 RDI: ffff8881f6fb6f40
RBP: ffff8881462ec000 R08: 0000000000000001 R09: ffffed1023984ee3
R10: ffff88811cc2771f R11: 00000000016cfcc0 R12: ffff888134383e08
R13: 0000000000000002 R14: ffff8881462ec668 R15: ffffffffaceab4c0
FS:  00007f23bfa98740(0000) GS:ffff8881f6f80000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000556de4a6f808 CR3: 0000000123c80000 CR4: 0000000000350ef0
Call Trace:
 \<TASK\>
 d\_walk+0x6a/0x530
 shrink\_dcache\_for\_umount+0x6a/0x200
 generic\_shutdown\_super+0x52/0x2a0
 kill\_anon\_super+0x22/0x40
 cifs\_kill\_sb+0x159/0x1e0
 deactivate\_locked\_super+0x66/0xe0
 cleanup\_mnt+0x140/0x210
 task\_work\_run+0xfb/0x170
 syscall\_exit\_to\_user\_mode+0x29f/0x2b0
 do\_syscall\_64+0xa1/0x1a0
 entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e
RIP: 0033:0x7f23bfb93ae7
Code: ff ff ff ff c3 66 0f 1f 44 00 00 48 8b 0d 11 93 0d 00 f7 d8 64 89 01 b8 ff ff ff ff eb bf 0f 1f 44 00 00 b8 50 00 00 00 0f 05 \<48\> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e9 92 0d 00 f7 d8 64 89 
---truncated---

## Affected and fixed versions

- Linux: \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< c8bf625e188593232d515fb50e240305b6ae14dd; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 31fabf70d58388d5475e48ca8a6b7d2847b36678; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 1d76332d783db12684b67592f1fb2057b88af4c3; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 73a57b25b4df23f22814fc06b7e8f9cf570be026; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 7afb86733685c64c604d32faf00fa4a1f22c2ab1 (cvelist)
- Linux: 6.1 (cvelist)

## Mitigation

- Upgrade Linux to 7afb86733685c64c604d32faf00fa4a1f22c2ab1 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-53178. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-53178.md
Affected: Linux >= ebe98f1447bbccf8228335c62d86af02a0ed23f7, < c8bf625e188593232d515fb50e240305b6ae14dd; >= ebe98f1447bbccf8228335c62d86af02a0ed23f7, < 31fabf70d58388d5475e48ca8a6b7d2847b36678; >= ebe98f1447bbccf8228335c62d86af02a0ed23f7, < 1d76332d783db12684b67592f1fb2057b88af4c3; >= ebe98f1447bbccf8228335c…
Fixed in: Linux 31fabf70d58388d5475e48ca8a6b7d2847b36678, Linux 1d76332d783db12684b67592f1fb2057b88af4c3, Linux 73a57b25b4df23f22814fc06b7e8f9cf570be026, Linux 7afb86733685c64c604d32faf00fa4a1f22c2ab1

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-53178 being exploited?

There is no confirmed exploitation: CVE-2024-53178 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.71% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-53178?

High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2024-53178?

Linux \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< c8bf625e188593232d515fb50e240305b6ae14dd; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 31fabf70d58388d5475e48ca8a6b7d2847b36678; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 1d76332d783db12684b67592f1fb2057b88af4c3; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 73a57b25b4df23f22814fc06b7e8f9cf570be026; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 7afb86733685c64c604d32faf00fa4a1f22c2ab1; Linux 6.1.

### Is there a fix for CVE-2024-53178?

Yes. Fixed in Linux 31fabf70d58388d5475e48ca8a6b7d2847b36678, Linux 1d76332d783db12684b67592f1fb2057b88af4c3, Linux 73a57b25b4df23f22814fc06b7e8f9cf570be026, Linux 7afb86733685c64c604d32faf00fa4a1f22c2ab1. Upgrade Linux to 7afb86733685c64c604d32faf00fa4a1f22c2ab1 or later.

### How do I check if I'm affected by CVE-2024-53178?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/31fabf70d58388d5475e48ca8a6b7d2847b36678>
- patch: <https://git.kernel.org/stable/c/1d76332d783db12684b67592f1fb2057b88af4c3>
- patch: <https://git.kernel.org/stable/c/73a57b25b4df23f22814fc06b7e8f9cf570be026>
- patch: <https://git.kernel.org/stable/c/7afb86733685c64c604d32faf00fa4a1f22c2ab1>
- other: <https://git.kernel.org/stable/c/c8bf625e188593232d515fb50e240305b6ae14dd>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-53178>

HTML: <https://flawdb.com/CVE-2024-53178> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-53178>
