MEDIUM 5.5

CVE-2026-53271: Linux ksmbd NULL Pointer Dereference in Oplock/Lease Break Handlers

A flaw in the Linux kernel's ksmbd server allows a local user to crash the system by exploiting a race condition in how the server handles SMB (Samba/Windows file-sharing) connections. When a client disconnects while the server is processing certain file-locking notifications, the server can attempt to dereference a NULL pointer, triggering a kernel panic. An authenticated local user with minimal privileges can reliably trigger this denial-of-service condition.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.5 MEDIUM · CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-476
Affected products
7 configuration(s)
Published / Modified
2026-06-25 / 2026-07-08

NVD description (verbatim)

In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix NULL-deref of opinfo->conn in oplock/lease break notifiers smb2_oplock_break_noti() and smb2_lease_break_noti() read opinfo->conn into a local with neither READ_ONCE() nor a NULL check. Both run from oplock_break() after opinfo_get_list() has dropped ci->m_lock, so a concurrent SMB2 LOGOFF (session_fd_check()) can set op->conn = NULL under ci->m_lock within that window. ksmbd_conn_r_count_inc(conn) then writes through NULL at offset 0xc4 -- a remotely triggerable oops. Guard both reads the way compare_guid_key() already does: read opinfo->conn with READ_ONCE() and return early if it is NULL, before allocating the work struct so nothing leaks. A NULL conn means the client is gone and the break is moot, so return 0; oplock_break() treats that as success and runs the normal teardown.

5 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-53271 is a NULL pointer dereference vulnerability in the Linux kernel's ksmbd SMB server implementation, specifically in the oplock and lease break notification handlers (smb2_oplock_break_noti and smb2_lease_break_noti). The vulnerability arises from a time-of-check-time-of-use (TOCTOU) race condition: after opinfo_get_list() releases the ci->m_lock lock, a concurrent SMB2 LOGOFF request can set opinfo->conn to NULL via session_fd_check(). The notification handlers read opinfo->conn without READ_ONCE() semantics or NULL validation, then pass it unsafely to ksmbd_conn_r_count_inc(), which dereferences at offset 0xc4, causing a kernel oops. The fix guards both code paths with READ_ONCE() and an early NULL check, returning success (0) if the connection has been torn down, as the break notification becomes moot at that point.

Business impact

This vulnerability enables local denial-of-service attacks against systems running vulnerable Linux kernels with ksmbd enabled. While ksmbd is primarily used in server environments providing SMB/CIFS file sharing (particularly in embedded devices and non-x86 systems), any kernel crash degrades availability. In production NAS appliances, edge servers, or containerized deployments where ksmbd is active, a single authenticated session can repeatedly crash the service. The attack requires local or network access to establish an SMB session, but does not compromise confidentiality or integrity—impact is limited to availability.

Affected systems

Any Linux system with ksmbd (kernel SMB server) enabled and running a vulnerable kernel version is affected. ksmbd is not enabled by default in most distributions but is present in appliances, NAS devices, and specialized embedded systems. The vulnerability requires local or network-based SMB access; the attacker must be able to establish an authenticated SMB session and then trigger a concurrent LOGOFF during oplock break processing. Exact vulnerable kernel versions should be verified against vendor advisories and your kernel build configuration.

Exploitability

The vulnerability is exploitable but requires specific conditions: the attacker needs network or local access to initiate an SMB session to the ksmbd server, and must time a LOGOFF request to race with ongoing oplock or lease break notification processing. The race window is relatively narrow but feasible to trigger reliably in most network conditions. No special privileges, exploit code, or user interaction are required beyond establishing a session. The attack is reproducible and does not require kernel ASLR bypass or other mitigations to be bypassed, making it straightforward for a motivated threat actor with network access.

Remediation

Apply a kernel patch that incorporates the fix: guard reads of opinfo->conn in both smb2_oplock_break_noti() and smb2_lease_break_noti() using READ_ONCE() and validate the pointer before use. If the connection is NULL, return early with success (0), as the break notification is no longer valid. Alternatively, if patching cannot be performed immediately, disable ksmbd (via CONFIG_SMB_SERVER=n at build time or by unloading the module) in environments where SMB server functionality is not required. Monitor for kernel panics in ksmbd-related stack traces as a detection signal.

Patch guidance

Patches for this vulnerability will be integrated into stable Linux kernel releases following upstream kernel development timelines. Users should monitor their distribution's security advisories for backported fixes. Verify patch application by confirming the presence of READ_ONCE() guards and NULL checks in the smb2_oplock_break_noti and smb2_lease_break_noti functions. If you maintain a custom kernel, cherry-pick the upstream fix commit once it is publicly available. Test patched kernels thoroughly in non-production environments before deployment, as SMB server behavior changes can affect existing file-sharing workloads.

Detection guidance

Monitor kernel logs (dmesg, journalctl) for NULL pointer dereference oops messages involving ksmbd, particularly mentioning smb2_oplock_break_noti, smb2_lease_break_noti, or ksmbd_conn_r_count_inc in the stack trace. Correlation with rapid SMB session connect/disconnect patterns may indicate active exploitation attempts. Deploy kernel panic detection and alerting to catch abnormal system-level failures. If SMB server activity is not expected in your environment, monitor for unexpected ksmbd module loading or SMB port activity (445/TCP) on systems where it should be disabled.

Why prioritize this

Although severity is MEDIUM (CVSS 5.5), prioritization should account for your specific environment. If ksmbd is active in production systems (NAS devices, edge appliances, or specialized servers), this vulnerability should be patched urgently because reliable exploitation causes service outages. For standard enterprise Linux workstations and servers where ksmbd is typically disabled, risk is lower but patching remains important for defense-in-depth. The lack of KEV (CISA Known Exploited Vulnerabilities) status does not minimize local exploitation risk; it reflects current public awareness rather than true risk.

Risk score, explained

The CVSS 3.1 score of 5.5 (MEDIUM) reflects a local attack vector requiring valid SMB session credentials, no impact to confidentiality or integrity, and only high availability impact. The local attack vector (AV:L) constrains score even though the vulnerability is network-reachable via SMB. In practice, if ksmbd is exposed to untrusted networks or used in multi-tenant environments, effective risk is higher. Organizations should adjust their internal risk rating upward if ksmbd is internet-facing or if your threat model includes disgruntled users with local/SMB access.

Frequently asked questions

Does this affect Windows, macOS, or other non-Linux systems?

No. CVE-2026-53271 is specific to the Linux kernel's ksmbd implementation. Windows uses a different SMB stack (built into the OS kernel), and macOS Samba clients/servers use user-space or different kernel implementations. Only Linux systems running ksmbd are affected.

Do I need to worry about this if I do not use SMB file sharing?

Likely not. ksmbd must be explicitly enabled in your kernel configuration (CONFIG_SMB_SERVER=y) and actively used. Most Linux distributions ship without ksmbd enabled by default. Check if ksmbd is loaded via lsmod | grep ksmbd. If it is absent or disabled, you are not at risk.

What is the difference between an oplock and a lease in SMB context?

Both are file-locking mechanisms in SMB: oplocks (opportunistic locks) are a legacy mechanism allowing clients to cache file data locally for performance, while leases are a newer variant used in SMB 2.1+. Both can be broken when another client accesses the same file. This vulnerability affects the notification handlers for both break types.

If ksmbd crashes, does it recover automatically or corrupt data?

A kernel panic from NULL pointer dereference will halt the system or trigger a reboot (depending on kernel panic behavior settings). The SMB server service itself does not recover without a reboot. Data corruption is unlikely because the crash occurs before any I/O operation completes, but clients may see interrupted sessions. You should configure panic behavior in /proc/sys/kernel/panic to auto-reboot and implement monitoring.

This analysis is based on available public information as of the stated publication date. CVSS scores, KEV status, and affected product versions reflect the source data provided and should be verified against official vendor advisories and your specific kernel configuration. This vulnerability does not provide proof-of-concept or weaponized exploit details. Patch availability, timelines, and guidance are subject to change as upstream kernel development progresses; consult your Linux distribution's security team for distribution-specific patch schedules. Testing patches in non-production environments is strongly recommended before deployment. Source: NVD (public-domain), retrieved 2026-08-03. Analysis generated by SEC.co (claude-haiku-4-5).