net: Fix null-ptr-deref by sock_lock_init_class_and_name() and rmmod.
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ed07536ed6731775219c1df7fa26a7588753e693 · < 5f7f6abd92b6c8dc8f19625ef93c3a18549ede04| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: Fix null-ptr-deref by sock_lock_init_class_and_name() and rmmod.
When I ran the repro [0] and waited a few seconds, I observed two LOCKDEP splats: a warning immediately followed by a null-ptr-deref. [1]
Reproduction Steps:
1) Mount CIFS 2) Add an iptables rule to drop incoming FIN packets for CIFS 3) Unmount CIFS 4) Unload the CIFS module 5) Remove the iptables rule
At step 3), the CIFS module calls sock_release() for the underlying TCP socket, and it returns quickly. However, the socket remains in FIN_WAIT_1 because incoming FIN packets are dropped.
At this point, the module's refcnt is 0 while the socket is still alive, so the following rmmod command succeeds.
# ss -tan State Recv-Q Send-Q Local Address:Port Peer Address:Port FIN-WAIT-1 0 477 10.0.2.15:51062 10.0.0.137:445
From the CVE record · Linux
With LOCKDEP enabled, unloading a module such as CIFS while one of its TCP sockets remains alive can cause a null pointer dereference when the socket is later processed. A local user able to mount and unmount CIFS, change packet-filtering rules, and unload the module can trigger the described sequence; no further user interaction is described.
Engineers running Linux kernels with LOCKDEP enabled should check their kernel against the vendor advisory; affected versions are not specified.