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

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

CVE-2025-21967

ksmbd: fix use-after-free in ksmbd_free_work_struct

8.8 EPSS 0.4% AV:N

Published 2025-04-01 (19 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-21967 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.20-1Update the kernel and reboot. Fixed in 6.12.20-1. A running kernel keeps the old code until the machine restarts.
Debian 14forkyfixed6.12.20-1Update the kernel and reboot. Fixed in 6.12.20-1. A running kernel keeps the old code until the machine restarts.
Debian unstablesidfixed6.12.20-1Update the kernel and reboot. Fixed in 6.12.20-1. A running kernel keeps the old code until the machine restarts.

The vulnerability

What the bug is

->interim_entry of ksmbd_work could be deleted after oplock is freed. We don't need to manage it with linked list. The interim request could be immediately sent whenever a oplock break wait is needed.

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/ksmbd_work.c
fs/smb/server/ksmbd_work.h
fs/smb/server/oplock.c
fs/smb/server/oplock.h

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-04-01 (19 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.38%, higher than 30.2% 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.84fb776765bfc2
5.156.12.2062746ae3f541
5.156.13.8eb51f6f59d19
5.156.14bb39ed470654

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 listening on TCP/445, and the entire trigger sequence (a CREATE requesting a batch oplock/write lease on one connection, a conflicting overwrite CREATE plus a close/disconnect on a second) is driven purely by remote SMB2 protocol traffic. No local access to the target is required.
AC:LAttack complexity, low
The double `list_add` of the same `work->interim_entry` in `smb2_open()` is deterministic, not racy, and the attacker owns both connections so it chooses exactly when the peer's `oplock_info` is released relative to `ksmbd_free_work_struct()`, and can loop the sequence indefinitely. Per guidance, an attacker-created ordering and a use-after-free are Low.
PR:LPrivileges required, low
Reaching `smb_grant_oplock()`/`smb_break_all_oplock()` requires a completed SESSION_SETUP, TREE_CONNECT and SMB2 CREATE, so an authenticated but otherwise unprivileged share account (including a mapped guest) is needed. This matches the scoring of the sibling post-authentication ksmbd oplock UAFs.
UI:NUser interaction, none
The attacker drives every step from its own two SMB sessions — take the oplock, issue the conflicting overwrite CREATE, then close or drop the first connection. No administrator or other client has to do anything.
S:UScope, unchanged
The list corruption and its consequences stay entirely within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.
C:HConfidentiality impact, high
The stale `interim_list` head lets `smb2_lease_break_noti()` treat reclaimed heap memory as a `struct ksmbd_work`, dereferencing its `conn`, `sess`, and `request_buf` fields, and `smb2_send_interim_resp()` then transmits data derived from that object back to the attacker — an arbitrary kernel memory disclosure primitive after a heap spray.
I:HIntegrity impact, high
`list_del()` in `ksmbd_free_work_struct()` writes two attacker-influenced kernel heap pointers at a fixed offset into a freed kmalloc-256 slot that the attacker can reclaim with a chosen object, and the fake-`ksmbd_work` path yields further controlled pointer writes and indirect calls, giving control-flow hijack.
A:HAvailability impact, high
Even unweaponized, the `list_del` on freed memory trips `CONFIG_DEBUG_LIST`/`BUG()` or silently corrupts the slab, and walking the dangling `interim_list` oopses the ksmbd worker; the attacker can repeat it at will to keep the file server down.