# CVE-2023-52751: smb: client: fix use-after-free in smb2\_query\_info\_compound()

> 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.32% (percentile 17, 2026-11-28)
- **CWE:** CWE-416
- **Published:** 2024-05-21T15:30:40.226Z
- **Modified:** 2026-10-30T13:17:16.380Z

## Who should check

- Anyone running Linux \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 06c106e1e8568e840c946cc0222579e3d29dab8e; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 6db94d08359c43f2c8fe372811cdee04564a41b9; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 93877b9afc2994c89362007aac480a7b150f386f; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 5c86919455c1edec99ebd3338ad213b59271a71b
- Anyone running Linux 6.1

## Description

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

smb: client: fix use-after-free in smb2\_query\_info\_compound()

The following UAF was triggered when running fstests generic/072 with
KASAN enabled against Windows Server 2022 and mount options
'multichannel,max\_channels=2,vers=3.1.1,mfsymlinks,noperm'

  BUG: KASAN: slab-use-after-free in smb2\_query\_info\_compound+0x423/0x6d0 \[cifs\]
  Read of size 8 at addr ffff888014941048 by task xfs\_io/27534

  CPU: 0 PID: 27534 Comm: xfs\_io Not tainted 6.6.0-rc7 \#1
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
  rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014
  Call Trace:
   dump\_stack\_lvl+0x4a/0x80
   print\_report+0xcf/0x650
   ? srso\_alias\_return\_thunk+0x5/0x7f
   ? srso\_alias\_return\_thunk+0x5/0x7f
   ? \_\_phys\_addr+0x46/0x90
   kasan\_report+0xda/0x110
   ? smb2\_query\_info\_compound+0x423/0x6d0 \[cifs\]
   ? smb2\_query\_info\_compound+0x423/0x6d0 \[cifs\]
   smb2\_query\_info\_compound+0x423/0x6d0 \[cifs\]
   ? \_\_pfx\_smb2\_query\_info\_compound+0x10/0x10 \[cifs\]
   ? srso\_alias\_return\_thunk+0x5/0x7f
   ? \_\_stack\_depot\_save+0x39/0x480
   ? kasan\_save\_stack+0x33/0x60
   ? kasan\_set\_track+0x25/0x30
   ? \_\_\_\_kasan\_slab\_free+0x126/0x170
   smb2\_queryfs+0xc2/0x2c0 \[cifs\]
   ? \_\_pfx\_smb2\_queryfs+0x10/0x10 \[cifs\]
   ? \_\_pfx\_\_\_lock\_acquire+0x10/0x10
   smb311\_queryfs+0x210/0x220 \[cifs\]
   ? \_\_pfx\_smb311\_queryfs+0x10/0x10 \[cifs\]
   ? srso\_alias\_return\_thunk+0x5/0x7f
   ? \_\_lock\_acquire+0x480/0x26c0
   ? lock\_release+0x1ed/0x640
   ? srso\_alias\_return\_thunk+0x5/0x7f
   ? do\_raw\_spin\_unlock+0x9b/0x100
   cifs\_statfs+0x18c/0x4b0 \[cifs\]
   statfs\_by\_dentry+0x9b/0xf0
   fd\_statfs+0x4e/0xb0
   \_\_do\_sys\_fstatfs+0x7f/0xe0
   ? \_\_pfx\_\_\_do\_sys\_fstatfs+0x10/0x10
   ? srso\_alias\_return\_thunk+0x5/0x7f
   ? lockdep\_hardirqs\_on\_prepare+0x136/0x200
   ? srso\_alias\_return\_thunk+0x5/0x7f
   do\_syscall\_64+0x3f/0x90
   entry\_SYSCALL\_64\_after\_hwframe+0x6e/0xd8

  Allocated by task 27534:
   kasan\_save\_stack+0x33/0x60
   kasan\_set\_track+0x25/0x30
   \_\_kasan\_kmalloc+0x8f/0xa0
   open\_cached\_dir+0x71b/0x1240 \[cifs\]
   smb2\_query\_info\_compound+0x5c3/0x6d0 \[cifs\]
   smb2\_queryfs+0xc2/0x2c0 \[cifs\]
   smb311\_queryfs+0x210/0x220 \[cifs\]
   cifs\_statfs+0x18c/0x4b0 \[cifs\]
   statfs\_by\_dentry+0x9b/0xf0
   fd\_statfs+0x4e/0xb0
   \_\_do\_sys\_fstatfs+0x7f/0xe0
   do\_syscall\_64+0x3f/0x90
   entry\_SYSCALL\_64\_after\_hwframe+0x6e/0xd8

  Freed by task 27534:
   kasan\_save\_stack+0x33/0x60
   kasan\_set\_track+0x25/0x30
   kasan\_save\_free\_info+0x2b/0x50
   \_\_\_\_kasan\_slab\_free+0x126/0x170
   slab\_free\_freelist\_hook+0xd0/0x1e0
   \_\_kmem\_cache\_free+0x9d/0x1b0
   open\_cached\_dir+0xff5/0x1240 \[cifs\]
   smb2\_query\_info\_compound+0x5c3/0x6d0 \[cifs\]
   smb2\_queryfs+0xc2/0x2c0 \[cifs\]

This is a race between open\_cached\_dir() and cached\_dir\_lease\_break()
where the cache entry for the open directory handle receives a lease
break while creating it.  And before returning from open\_cached\_dir(),
we put the last reference of the new @cfid because of
!@cfid-\>has\_lease.

Besides the UAF, while running xfstests a lot of missed lease breaks
have been noticed in tests that run several concurrent statfs(2) calls
on those cached fids

  CIFS: VFS: \\\\w22-root1.gandalf.test No task to wake, unknown frame...
  CIFS: VFS: \\\\w22-root1.gandalf.test Cmd: 18 Err: 0x0 Flags: 0x1...
  CIFS: VFS: \\\\w22-root1.gandalf.test smb buf 00000000715bfe83 len 108
  CIFS: VFS: Dump pending requests:
  CIFS: VFS: \\\\w22-root1.gandalf.test No task to wake, unknown frame...
  CIFS: VFS: \\\\w22-root1.gandalf.test Cmd: 18 Err: 0x0 Flags: 0x1...
  CIFS: VFS: \\\\w22-root1.gandalf.test smb buf 000000005aa7316e len 108
  ...

To fix both, in open\_cached\_dir() ensure that @cfid-\>has\_lease is set
right before sending out compounded request so that any potential
lease break will be get processed by demultiplex thread while we're
still caching @cfid.  And, if open failed for some reason, re-check
@cfid-\>has\_lease to decide whether or not put lease reference.

## Affected and fixed versions

- Linux: \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 06c106e1e8568e840c946cc0222579e3d29dab8e; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 6db94d08359c43f2c8fe372811cdee04564a41b9; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 93877b9afc2994c89362007aac480a7b150f386f; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 5c86919455c1edec99ebd3338ad213b59271a71b (cvelist)
- Linux: 6.1 (cvelist)

## Mitigation

- Upgrade Linux to 5c86919455c1edec99ebd3338ad213b59271a71b or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2023-52751.md
Affected: Linux >= ebe98f1447bbccf8228335c62d86af02a0ed23f7, < 06c106e1e8568e840c946cc0222579e3d29dab8e; >= ebe98f1447bbccf8228335c62d86af02a0ed23f7, < 6db94d08359c43f2c8fe372811cdee04564a41b9; >= ebe98f1447bbccf8228335c62d86af02a0ed23f7, < 93877b9afc2994c89362007aac480a7b150f386f; >= ebe98f1447bbccf8228335c…
Fixed in: Linux 06c106e1e8568e840c946cc0222579e3d29dab8e, Linux 6db94d08359c43f2c8fe372811cdee04564a41b9, Linux 93877b9afc2994c89362007aac480a7b150f386f, Linux 5c86919455c1edec99ebd3338ad213b59271a71b

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-2023-52751 being exploited?

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

### How serious is CVE-2023-52751?

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

### Which versions are affected by CVE-2023-52751?

Linux \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 06c106e1e8568e840c946cc0222579e3d29dab8e; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 6db94d08359c43f2c8fe372811cdee04564a41b9; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 93877b9afc2994c89362007aac480a7b150f386f; \>= ebe98f1447bbccf8228335c62d86af02a0ed23f7, \< 5c86919455c1edec99ebd3338ad213b59271a71b; Linux 6.1.

### Is there a fix for CVE-2023-52751?

Yes. Fixed in Linux 06c106e1e8568e840c946cc0222579e3d29dab8e, Linux 6db94d08359c43f2c8fe372811cdee04564a41b9, Linux 93877b9afc2994c89362007aac480a7b150f386f, Linux 5c86919455c1edec99ebd3338ad213b59271a71b. Upgrade Linux to 5c86919455c1edec99ebd3338ad213b59271a71b or later.

### How do I check if I'm affected by CVE-2023-52751?

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/6db94d08359c43f2c8fe372811cdee04564a41b9>
- patch: <https://git.kernel.org/stable/c/93877b9afc2994c89362007aac480a7b150f386f>
- patch: <https://git.kernel.org/stable/c/5c86919455c1edec99ebd3338ad213b59271a71b>
- other: <https://git.kernel.org/stable/c/06c106e1e8568e840c946cc0222579e3d29dab8e>

## 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-2023-52751>

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