CVE-2026-139181: Linux kernel ksmbd writes a compound CREATE’s Apple create contexts past the response buffer

ByLinuxtastic

December 2, 2026 #CVE, #Linux Kernel

ksmbd, the in-kernel SMB3 server, lets a client send several commands in one compound request, and it builds all the responses into one buffer, reserving space for each as it goes. An SMB2 CREATE response that carries Apple’s AAPL create context “can reach create_rsp_size (572 bytes for SMB 3.1.1)”, and an earlier fix taught the server to reserve that much, “but only for the first command of a compound. A CREATE later in the compound is guarded by is_chained_smb2_message() instead, which reserves only MAX_CIFS_SMALL_BUFFER_SIZE (448 bytes)”. The kernel CNA record adds a second miscount: the previous response is padded to 8 bytes after the reserve was checked. A CREATE placed after a command that fills its response, such as QUERY_DIRECTORY, “writes its create contexts past the end of the buffer.” Red Hat rates it Important at 8.8, an authenticated network user corrupting kernel memory. On hosts running ksmbd on a 7.3 kernel, upgrade to 7.3.6 or later and restart the server; kernels before 7.2.6 are not affected.

CVE-2026-139181 at a glance.

ComponentLinux kernel, ksmbd SMB server (fs/smb/server/smb2pdu.c: smb2_open(), is_chained_smb2_message(), init_chained_smb2_rsp() and create_aapl_rsp_buf()), module ksmbd
Affected versionsfrom 8f1b796ff113: 7.3 before 7.3.6 and 7.4 before 7.4-rc1, plus the 7.2.6 and later 7.2 stable releases, which took the introducing change and for which the record lists no fix; everything before 7.2.6 is unaffected. The record notes the introducing commit was itself the fix for the single-CREATE overflow (713c31a3a225)
Fixed inmainline 7.4-rc1 (commit d1557d83: “when the next command is a CREATE, reserve create_rsp_size, as smb2_allocate_rsp_buf() does for a single CREATE, and check the reserve against the 8-byte aligned offset where the next response starts”) and stable 7.3.6 (7ec13d37); two commits in the record
SeverityRed Hat Important, CVSS 3.1 8.8 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, draft, CWE-787), bug 2587280 “Denial of service via SMB2 response buffer overflow in ksmbd”; the kernel CNA gives no score and NVD (Received, 30 November) carries none; Ubuntu Medium; SUSE could not be read on 2 December 2026
Exploited in the wildNot on the CISA KEV catalogue (2026.11.30). EPSS 0.00205 (11th percentile) on 1 December 2026
Who is exposedHosts that serve SMB with ksmbd rather than Samba, on a 7.2.6 or later or 7.3 kernel, to any client that can authenticate, including guest access where it is enabled; the AAPL context is what macOS clients send, but any client can include it. Red Hat: RHEL’s SMB services use Samba, ksmbd is not active by default, and every RHEL kernel is marked not affected. Home NAS builds, OpenWrt and container hosts that chose ksmbd for its footprint are where it runs
PublishedCVE record 30 November 2026 (kernel CNA); this page built 2 December 2026, last updated 2 December 2026

What it is

A compound request is several SMB2 commands in one message, each answered in order into a single response buffer. The server sizes that buffer up front and, before running each chained command, checks that enough room remains for a “small” response, 448 bytes. A CREATE response is not small when it carries create contexts, and the Apple context pushes it to 572 bytes on SMB 3.1.1. The earlier fix, 713c31a3a225, made the allocation account for that when the CREATE is the first command; the chained path kept the 448-byte reserve, and smb2_open() “then appends the create contexts without checking the space left.”

The record describes a second error in the same check: it “uses the unpadded length of the response so far”, while init_chained_smb2_rsp() aligns each response to 8 bytes before the next command runs, “so the next response can start up to 7 bytes later than the check assumes.” Put a CREATE after a command whose response fills the buffer, QUERY_DIRECTORY being the record’s example, and the create contexts are written beyond the allocation, with the AAPL context last; KASAN reports the slab-out-of-bounds write in create_aapl_rsp_buf() called from smb2_open(). The data written is response structure plus values the client chose in the request, which is why Red Hat’s statement allows for code execution rather than only a crash.

The fix in fs/smb/server/smb2pdu.c reserves create_rsp_size for a chained CREATE, the same as for a single one, and compares the reserve with the 8-byte-aligned offset. The affected range is short because the introducing commit is itself recent: the record’s git ranges start at 8f1b796ff113, which is the single-CREATE fix as it landed in 7.3 and in the 7.2 stable series from 7.2.6. git.kernel.org refuses automated readers, so the diff is described from the CNA’s copy of the commit message.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 2 December 2026; the link in the row is the tracker page, which will be newer than this one. Only hosts that load ksmbd and run ksmbd.mountd exercise the code.

DistributionStatusFixed package
AlpineNot consulted for this page—
DebianNot affected in bookworm (6.1.192-3) and trixie (6.12.118-1): “vulnerable code not present”; forky and sid (7.3.6-1) fixed; no DSAunstable 7.3.6-1
UbuntuMedium; the linux package is needs evaluation on every release from 14.04 to 26.10 on 2 December 2026, nothing released; by the record only 7.2.6 and later kernels are in rangenothing on 2 December 2026
RHEL, Rocky, Alma, CentOS StreamImportant, 8.8 (bug 2587280, CWE-787), but kernel and kernel-rt are not affected in RHEL 6 to 10 and every OpenShift RHCOS image: RHEL serves SMB with Samba—
openSUSE/SLENot consulted: suse.com refused the automated reader on 2 December 2026 (client error)—
Fedora, Arch, OpenWrt; self-built kernelsNot consulted; upstream stable versions apply. A 7.2.6 or later 7.2 kernel has no listed fix and should move to 7.3.67.3.6 or later

How to check

Is ksmbd running at all, which kernel is under it, and which clients can authenticate. A host that serves SMB through Samba’s smbd has nothing to do here.

# 1. is the in-kernel SMB server loaded and its userspace helper running
lsmod | grep -w ksmbd
systemctl is-active ksmbd 2>/dev/null; pgrep -a ksmbd.mountd
ss -ltnp | grep -E ':445 '

# 2. the running kernel: affected from 7.2.6 and on 7.3 before 7.3.6
uname -r

# 3. who can authenticate: the configured users, and whether guest access is on
ksmbd.control -s 2>/dev/null | head
grep -iE '^\s*(guest|map to guest|guest account)' /etc/ksmbd/ksmbd.conf 2>/dev/null
cut -d: -f1 /etc/ksmbd/ksmbdpwd.db 2>/dev/null

No ksmbd module and nothing listening on 445 from it means the page does not apply; a port 445 held by smbd is Samba, a different code base. A ksmbd host on 7.3.0 through 7.3.5 or on 7.2.6 or later is exposed to every account that can log in, and to everyone if guest access is enabled; the trigger is a normal compound request such as the directory-listing-plus-open sequence that macOS and Windows clients issue routinely, with one padded response and one Apple context added. For log review, the kernel ring buffer is where the symptom shows: dmesg | grep -iE 'ksmbd|slab-out-of-bounds|BUG' after unexplained crashes on a file server.

How to fix it

Update the kernel and reboot. There is no module-level mitigation that preserves the service; the interim is to limit who can reach and authenticate to the share.

# Debian forky / sid (7.3.6-1) carry the fix; bookworm and trixie are not affected
apt update && apt install linux-image-amd64 && systemctl reboot
# Ubuntu: needs evaluation on 2 December 2026; once the linux package is released
apt update && apt install linux-generic && systemctl reboot
# RHEL / Rocky / Alma: not affected (Samba, not ksmbd); nothing to do
# Interim: no guest access, and the listener fenced to the LAN
sed -i 's/^\s*map to guest.*/map to guest = never/' /etc/ksmbd/ksmbd.conf
systemctl restart ksmbd
nft add rule inet filter input tcp dport 445 ip saddr != 192.168.1.0/24 drop
# or, if the share can wait for the reboot: stop the server and move clients to Samba
systemctl stop ksmbd && modprobe -r ksmbd

What not to do: do not disable SMB 3.1.1 to shrink the response, since the overflow depends on the buffer arithmetic rather than the dialect and older dialects weaken the connection for every client; and do not assume a share restricted to known users is safe, because the score already assumes an authenticated client, and an ordinary workstation on the LAN with a browser-borne SMB connection is one.

Sources

  • CVE-2026-139181 at CVE.org — the kernel CNA record: the 572 against 448 byte reserve, the padding mismatch, the QUERY_DIRECTORY example, the KASAN trace, the version ranges (30 November 2026)
  • Fix commit d1557d83 (mainline 7.4-rc1, the commit Debian cites) and the 7.3 backport 7ec13d37; git.kernel.org refuses automated readers, so the diff is described from the CNA’s copy of the commit message
  • NVD entry — Received on 30 November 2026; no CVSS metric, CWE or CPE on 2 December 2026
  • Distribution trackers: Debian (bookworm and trixie not affected, unstable fixed in 7.3.6-1) · Red Hat (Important 8.8, bug 2587280, CWE-787; every RHEL kernel not affected; the statement on Samba and ksmbd) · Ubuntu (Medium, needs evaluation; read from the HTML page, the JSON endpoint refused) · SUSE (refused the automated reader on 2 December 2026)
  • CISA KEV catalogue 2026.11.30, not listed · EPSS 0.00205 (percentile 0.111) on 1 December 2026

Related reading

This advisory page was assembled from the primary sources listed above on 2 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.