KernelScan.io

CRITICAL

ksmbd Oplock UAF

CVE-2026-43376

CVSS 9.8 / 10.0 NVD

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

KernelScan AI7.8HIGH

01

In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix use-after-free by using call_rcu() for oplock_info ksmbd currently frees oplock_info immediately using kfree(), even though it is accessed under RCU read-side critical sections in places like opinfo_get() and proc_show_files(). Since there is no RCU grace period delay between nullifying the pointer and freeing the memory, a reader can still access oplock_info structure after it has been freed. This can leads to a use-after-free especially in opinfo_get() where atomic_inc_not_zero() is called on already freed memory. Fix this by switching to deferred freeing using call_rcu().

02

Engine v0.2.0

Risk summary

Local attackers with low privileges can exploit a use-after-free vulnerability in the ksmbd SMB server's oplock handling to potentially achieve arbitrary code execution or cause system crashes. The vulnerability occurs when oplock_info structures are freed immediately while still being accessed under RCU read-side critical sections.

Affectedfs/smb/server/oplock.c (ksmbd)

Vulnerability analysis

The root cause is improper memory management in ksmbd's oplock_info structure lifecycle. The code calls kfree() immediately to free oplock_info structures, but these structures are accessed under RCU read-side critical sections in functions like opinfo_get() and proc_show_files(). Without RCU grace period delays, readers can access freed memory, particularly dangerous in opinfo_get() where atomic_inc_not_zero() operates on freed memory. The fix switches from immediate kfree() to deferred freeing using call_rcu(), ensuring proper RCU grace periods before memory deallocation. This requires local access to trigger SMB operations that manipulate oplocks.

03

BranchFixed inPatch commit
6.126.12.7808aa9f3c8cf4
6.156.151d6abf145615
6.186.18.19ce8507ee82c8
6.196.19.91dfd062caa16
6.66.6.130302fef75512b
mainline7.0