CVE-2026-99671: can: raw, isotp: copy socket options outside of lock_sock()
In the Linux kernel, the following vulnerability has been resolved:
can: raw, isotp: copy socket options outside of locksock()
The CANRAW and CANISOTP specific socket options are copied from and to user space while holding locksock(). A copy that faults or stalls, e.g. on a userfaultfd or FUSE backed mapping, holds locksock() for its whole duration.
rawnotify() and isotpnotify() take locksock() of a socket that is bound to the vanishing device while holding RTNL. As the CANRAW options can also be changed on a bound socket, a stalled copy can block RTNL on an unregistration or namespace change of the bound device. Before "can: protect the receive lists with a per-device lock", rawsetsockopt() even held RTNL itself during the copy. CANISOTP only copies its options for unbound sockets, which isotpnotify() skips without taking locksock().
Keep the user space copies out of the locked sections: Check the option name and length and copy the option values, including the CANRAWFILTER filters, to kernel memory before locksock(). rawsetsockoptlocked() and isotpsetsockoptlocked() get the copied values directly and drop their now redundant length checks and copies. As a side effect, a failing copy can not leave partially overwritten options behind anymore. In rawgetsockopt() duplicate the filters under locksock() and copy them to user space after releasesock().
As the option name and length are now checked before locksock(), the order of the checks in isotpsetsockopt() and accordingly the order of the returned error values changes. This is in line with POSIX, which does not define an order in which multiple error conditions are detected and reported.
The generic SOLSOCKET options in sksetsockopt() are not affected by this patch.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.5-1
Event History
Frequently Asked Questions
What conditions are needed to trigger the lock contention?
An attacker or local process needs to perform CAN_RAW or CAN_ISOTP socket-option operations using user memory whose copy can fault or stall, such as a userfaultfd- or FUSE-backed mapping. The impact described depends on a socket being bound to a device that is being unregistered or moved between namespaces.
What is the practical impact?
A stalled user-space copy while lock_sock() is held can block RTNL during unregistration or namespace changes for the bound CAN device. This can delay network device management operations rather than being described as memory corruption or privilege escalation.
Are CAN_ISOTP sockets affected in the same way as CAN_RAW sockets?
The description states that CAN_ISOTP copies its options only for unbound sockets, and isotp_notify() skips unbound sockets without taking lock_sock(). The bound-socket RTNL blocking scenario is specifically described for CAN_RAW options, although the fix moves user-space copies outside locked sections for both CAN_RAW and CAN_ISOTP.
What change addresses the issue?
The fix validates option names and lengths and copies option values, including CAN_RAW filters, into kernel memory before taking lock_sock(). This prevents potentially stalled user-space copies from occurring while the socket lock is held.