data built 2026-10-19T13:16:53Z

Look up another CVE · open CVE-2025-37952 in the interactive tracker

CVE-2025-37952

ksmbd: Fix UAF in __close_file_table_ids

8.8 EPSS 0.4% AV:N

Published 2025-05-20 (17 months ago) by the Linux kernel CNA. Subsystem fs/smb. Debian urgency: not yet assigned.

What to do, per Debian release

Debian's own status for CVE-2025-37952 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source

ReleaseStatus VersionWhat this means
Debian 12bookwormvulnerable6.1.190-1No fix published anywhere yet, neither in Debian nor upstream for the series bookworm tracks. Watch the Debian tracker page for this CVE. Advisories for bookworm have historically landed a median of 23 days after publication.
Debian 13trixiefixed6.12.29-1Update the kernel and reboot. Fixed in 6.12.29-1. A running kernel keeps the old code until the machine restarts.
Debian 14forkyfixed6.12.29-1Update the kernel and reboot. Fixed in 6.12.29-1. A running kernel keeps the old code until the machine restarts.
Debian unstablesidfixed6.12.29-1Update the kernel and reboot. Fixed in 6.12.29-1. A running kernel keeps the old code until the machine restarts.

The vulnerability

What the bug is

A use-after-free is possible if one thread destroys the file via __ksmbd_close_fd while another thread holds a reference to it. The existing checks on fp->refcount are not sufficient to prevent this. The fix takes ft->lock around the section which removes the file from the file table. This prevents two threads acquiring the same file pointer via __close_file_table_ids, as well as the other functions which retrieve a file from the IDR and which already use this same lock.

Where it lives

The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.

fs/smb/server/vfs_cache.c

What this is
KERNEL SMB3 SERVER (KSMBD)MAINTAINERS section matched on fs/smb/server/ · linux-cifs@vger.kernel.org · Maintained
Kernel module
ksmbd

Check it on the machine

grep -wE 'CONFIG_SMBFS|CONFIG_SMB_SERVER' /boot/config-$(uname -r)

Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.

lsmod | grep -w ksmbd

Prints a line if that module is loaded right now, and nothing if it is not. One that is not loaded can still be loaded later by anything that needs it.

Show whether Debian builds this, per release

Debian builds this as a loadable module. Every release below compiles it as a module on every flavour, so whether the code is in the running kernel depends on whether that module is loaded.

  • bookworm, trixie, forky, sidm
m
a loadable module on every flavour - check lsmod, can be blacklisted
Build switches
CONFIG_SMBFS, CONFIG_SMB_SERVER
Reads as
all on means the file is compiled; any one off means it is not.

From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS kbuild Makefiles Debian linux-config packages

Signals

Published
2025-05-20 (17 months ago)source
CVSS
8.8 high
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it
Attack vector
network (AV:N)source
EPSS
0.37%, higher than 29.6% of all CVEssource
CISA KEV
not listedthe KEV catalogue
Debian urgency
not yet assignedsource
Subsystem
fs/smb

Upstream fixes

The versions the CNA records as introducing and fixing this, and the commit for each. source

IntroducedFixed inCommit
5.156.6.91fec1f9e9a650
5.156.12.299e9841e232b5
5.156.14.716727e442568
5.156.1536991c1ccde2

Why the CNA scored it this way

Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source

AV:NAttack vector, network
ksmbd is the in-kernel SMB server; the entire path is driven by SMB2 PDUs (TREE_DISCONNECT, LOGOFF, CLOSE) arriving on TCP/445 from a remote peer. No local access is involved at any point.
AC:LAttack complexity, low
The attacker controls both sides of the race — each SMB2 request is dispatched to the concurrent "ksmbd-io" workqueue, so pipelining CLOSE alongside TREE_DISCONNECT/LOGOFF on one connection (or using multichannel connections sharing one file table) reliably produces overlapping execution. The unlocked IDR walk gives a wide window, and the race can be retried indefinitely.
PR:LPrivileges required, low
The attacker must complete SMB2 SESSION_SETUP, TREE_CONNECT and open at least one file so the session file table is populated, which needs valid (low-privilege) share credentials in a default configuration. Any ordinary share user qualifies, and on guest-mapped public shares even that requirement disappears.
UI:NUser interaction, none
The attacker drives the entire sequence from their own SMB connection; no action by a local user or administrator is needed.
S:UScope, unchanged
The corruption and its consequences are confined to the kernel's own security authority; there is no VM, IOMMU or sandbox boundary crossed.
C:HConfidentiality impact, high
The freed ksmbd_file is dereferenced for fp->tcon, fp->f_ci and the fp->blocked_works list, and the attacker can reallocate the slab object via SMB2_CREATE to control those contents, turning the UAF into an arbitrary kernel-memory read primitive.
I:HIntegrity impact, high
set_close_state_blocked_works() performs `cancel_work->state = KSMBD_WORK_CLOSED` and then an indirect call `cancel_work->cancel_fn(cancel_work->cancel_argv)` using pointers read out of freed memory, and __ksmbd_close_fd() fput()s a stale struct file and double-frees the object — giving write-what-where and control-flow hijack primitives.
A:HAvailability impact, high
Even unexploited, the double refcount decrement and double kmem_cache_free/fput corrupt the slab allocator and file refcounts, causing an immediate oops or panic that takes down the whole server.