# CVE-2025-38051: smb: client: Fix use-after-free in cifs\_fill\_dirent

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-28)
- **CWE:** CWE-416
- **Published:** 2025-06-18T09:33:32.805Z
- **Modified:** 2026-08-05T11:59:05.253Z

## Who should check

- Anyone running Linux \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< aee067e88d61eb72e966f094e4749c6b14e7008f; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< a24c2f05ac3c5b0aaa539d9d913826d2643dfd0e; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 1b197931fbc821bc7e9e91bf619400db563e3338; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< c8623231e0edfcccb7cc6add0288fa0f0594282f; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 73cadde98f67f76c5eba00ac0b72c453383cec8b; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 9bea368648ac46f8593a780760362e40291d22a9; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 9c9aafbacc183598f064902365e107b5e856531f; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< a7a8fe56e932a36f43e031b398aef92341bf5ea0; 0f3da51e7046e2eb28992ba65c22d058f571356c; \>= 2.6.27.4, \< 2.6.28
- Anyone running Linux 2.6.28

## Description

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

smb: client: Fix use-after-free in cifs\_fill\_dirent

There is a race condition in the readdir concurrency process, which may
access the rsp buffer after it has been released, triggering the
following KASAN warning.

 ==================================================================
 BUG: KASAN: slab-use-after-free in cifs\_fill\_dirent+0xb03/0xb60 \[cifs\]
 Read of size 4 at addr ffff8880099b819c by task a.out/342975

 CPU: 2 UID: 0 PID: 342975 Comm: a.out Not tainted 6.15.0-rc6+ \#240 PREEMPT(full)
 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.1-2.fc37 04/01/2014
 Call Trace:
  \<TASK\>
  dump\_stack\_lvl+0x53/0x70
  print\_report+0xce/0x640
  kasan\_report+0xb8/0xf0
  cifs\_fill\_dirent+0xb03/0xb60 \[cifs\]
  cifs\_readdir+0x12cb/0x3190 \[cifs\]
  iterate\_dir+0x1a1/0x520
  \_\_x64\_sys\_getdents+0x134/0x220
  do\_syscall\_64+0x4b/0x110
  entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e
 RIP: 0033:0x7f996f64b9f9
 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89
 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 \<48\> 3d 01
 f0 ff ff  0d f7 c3 0c 00 f7 d8 64 89 8
 RSP: 002b:00007f996f53de78 EFLAGS: 00000207 ORIG\_RAX: 000000000000004e
 RAX: ffffffffffffffda RBX: 00007f996f53ecdc RCX: 00007f996f64b9f9
 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
 RBP: 00007f996f53dea0 R08: 0000000000000000 R09: 0000000000000000
 R10: 0000000000000000 R11: 0000000000000207 R12: ffffffffffffff88
 R13: 0000000000000000 R14: 00007ffc8cd9a500 R15: 00007f996f51e000
  \</TASK\>

 Allocated by task 408:
  kasan\_save\_stack+0x20/0x40
  kasan\_save\_track+0x14/0x30
  \_\_kasan\_slab\_alloc+0x6e/0x70
  kmem\_cache\_alloc\_noprof+0x117/0x3d0
  mempool\_alloc\_noprof+0xf2/0x2c0
  cifs\_buf\_get+0x36/0x80 \[cifs\]
  allocate\_buffers+0x1d2/0x330 \[cifs\]
  cifs\_demultiplex\_thread+0x22b/0x2690 \[cifs\]
  kthread+0x394/0x720
  ret\_from\_fork+0x34/0x70
  ret\_from\_fork\_asm+0x1a/0x30

 Freed by task 342979:
  kasan\_save\_stack+0x20/0x40
  kasan\_save\_track+0x14/0x30
  kasan\_save\_free\_info+0x3b/0x60
  \_\_kasan\_slab\_free+0x37/0x50
  kmem\_cache\_free+0x2b8/0x500
  cifs\_buf\_release+0x3c/0x70 \[cifs\]
  cifs\_readdir+0x1c97/0x3190 \[cifs\]
  iterate\_dir+0x1a1/0x520
  \_\_x64\_sys\_getdents64+0x134/0x220
  do\_syscall\_64+0x4b/0x110
  entry\_SYSCALL\_64\_after\_hwframe+0x76/0x7e

 The buggy address belongs to the object at ffff8880099b8000
  which belongs to the cache cifs\_request of size 16588
 The buggy address is located 412 bytes inside of
  freed 16588-byte region \[ffff8880099b8000, ffff8880099bc0cc)

 The buggy address belongs to the physical page:
 page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x99b8
 head: order:3 mapcount:0 entire\_mapcount:0 nr\_pages\_mapped:0 pincount:0
 anon flags: 0x80000000000040(head\|node=0\|zone=1)
 page\_type: f5(slab)
 raw: 0080000000000040 ffff888001e03400 0000000000000000 dead000000000001
 raw: 0000000000000000 0000000000010001 00000000f5000000 0000000000000000
 head: 0080000000000040 ffff888001e03400 0000000000000000 dead000000000001
 head: 0000000000000000 0000000000010001 00000000f5000000 0000000000000000
 head: 0080000000000003 ffffea0000266e01 00000000ffffffff 00000000ffffffff
 head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
 page dumped because: kasan: bad access detected

 Memory state around the buggy address:
  ffff8880099b8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff8880099b8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 \>ffff8880099b8180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                             ^
  ffff8880099b8200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ffff8880099b8280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ==================================================================

POC is available in the link \[1\].

The problem triggering process is as follows:

Process 1                       Process 2
-----------------------------------
---truncated---

## Affected and fixed versions

- Linux: \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< aee067e88d61eb72e966f094e4749c6b14e7008f; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< a24c2f05ac3c5b0aaa539d9d913826d2643dfd0e; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 1b197931fbc821bc7e9e91bf619400db563e3338; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< c8623231e0edfcccb7cc6add0288fa0f0594282f; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 73cadde98f67f76c5eba00ac0b72c453383cec8b; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 9bea368648ac46f8593a780760362e40291d22a9; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 9c9aafbacc183598f064902365e107b5e856531f; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< a7a8fe56e932a36f43e031b398aef92341bf5ea0; 0f3da51e7046e2eb28992ba65c22d058f571356c; \>= 2.6.27.4, \< 2.6.28 (cvelist)
- Linux: 2.6.28 (cvelist)

## Mitigation

- Upgrade Linux to 2.6.28 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-38051.md
Affected: Linux >= a364bc0b37f14ffd66c1f982af42990a9d77fa43, < aee067e88d61eb72e966f094e4749c6b14e7008f; >= a364bc0b37f14ffd66c1f982af42990a9d77fa43, < a24c2f05ac3c5b0aaa539d9d913826d2643dfd0e; >= a364bc0b37f14ffd66c1f982af42990a9d77fa43, < 1b197931fbc821bc7e9e91bf619400db563e3338; >= a364bc0b37f14ffd66c1f98…
Fixed in: Linux 1b197931fbc821bc7e9e91bf619400db563e3338, Linux 73cadde98f67f76c5eba00ac0b72c453383cec8b, Linux 9bea368648ac46f8593a780760362e40291d22a9, Linux 9c9aafbacc183598f064902365e107b5e856531f, Linux 2.6.28

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-2025-38051 being exploited?

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

### How serious is CVE-2025-38051?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-38051?

Linux \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< aee067e88d61eb72e966f094e4749c6b14e7008f; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< a24c2f05ac3c5b0aaa539d9d913826d2643dfd0e; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 1b197931fbc821bc7e9e91bf619400db563e3338; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< c8623231e0edfcccb7cc6add0288fa0f0594282f; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 73cadde98f67f76c5eba00ac0b72c453383cec8b; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 9bea368648ac46f8593a780760362e40291d22a9; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< 9c9aafbacc183598f064902365e107b5e856531f; \>= a364bc0b37f14ffd66c1f982af42990a9d77fa43, \< a7a8fe56e932a36f43e031b398aef92341bf5ea0; 0f3da51e7046e2eb28992ba65c22d058f571356c; \>= 2.6.27.4, \< 2.6.28; Linux 2.6.28.

### Is there a fix for CVE-2025-38051?

Yes. Fixed in Linux 1b197931fbc821bc7e9e91bf619400db563e3338, Linux 73cadde98f67f76c5eba00ac0b72c453383cec8b, Linux 9bea368648ac46f8593a780760362e40291d22a9, Linux 9c9aafbacc183598f064902365e107b5e856531f, Linux 2.6.28. Upgrade Linux to 2.6.28 or later.

### How do I check if I'm affected by CVE-2025-38051?

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/aee067e88d61eb72e966f094e4749c6b14e7008f>
- patch: <https://git.kernel.org/stable/c/a24c2f05ac3c5b0aaa539d9d913826d2643dfd0e>
- patch: <https://git.kernel.org/stable/c/1b197931fbc821bc7e9e91bf619400db563e3338>
- patch: <https://git.kernel.org/stable/c/c8623231e0edfcccb7cc6add0288fa0f0594282f>
- patch: <https://git.kernel.org/stable/c/73cadde98f67f76c5eba00ac0b72c453383cec8b>
- patch: <https://git.kernel.org/stable/c/9bea368648ac46f8593a780760362e40291d22a9>
- patch: <https://git.kernel.org/stable/c/9c9aafbacc183598f064902365e107b5e856531f>
- patch: <https://git.kernel.org/stable/c/a7a8fe56e932a36f43e031b398aef92341bf5ea0>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html>

## 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-2025-38051>

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