CRITICAL
ksmbd Oplock UAF
CVE-2026-43376
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
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().
02KernelScan AI Analysis
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.
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.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.12 | 6.12.78 | 08aa9f3c8cf4 |
| 6.15 | 6.15 | 1d6abf145615 |
| 6.18 | 6.18.19 | ce8507ee82c8 |
| 6.19 | 6.19.9 | 1dfd062caa16 |
| 6.6 | 6.6.130 | 302fef75512b |
| mainline | 7.0 | — |