can: raw: add locking for raw flags bitfield
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.427.1.67.2In the Linux kernel, the following vulnerability has been resolved:
can: raw: add locking for raw flags bitfield
With commit 890e5198a6e5 ("can: raw: use bitfields to store flags in struct raw_sock") the formerly separate integer values have been integrated into a single bitfield. This led to a read-modify-write operation when changing a flag in raw_setsockopt() which now needs a locking to prevent concurrent access.
Instead of adding a lock/unlock hell in each of the flag manipulations this patch introduces a wrapper for a new raw_setsockopt_locked() function analogue to the isotp_setsockopt[_locked]() approach in net/can/isotp.c
[mkl: use Closes tag instead of Link]
From the CVE record · Linux
The Linux kernel’s CAN raw socket code lacks locking when changing flags in raw_setsockopt(), allowing concurrent access to a shared bitfield. This can cause a race during flag updates; the input does not specify an attacker outcome or whether authentication or user interaction is required.
Engineers running Linux kernels with the affected CAN raw socket code should check their versions; affected versions are not specified.