CVE-2026-68387: can: raw: add locking for raw flags bitfield

Greg Kroah-Hartman <[email protected]>
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026081045-CVE-2026-68387-4e1f@gregkh>
From: Greg Kroah-Hartman <[email protected]>

Description
===========

In 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]

The Linux kernel CVE team has assigned CVE-2026-68387 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 6.18 with commit 890e5198a6e5b238627c245fafea1a92670a86cd and fixed in 6.18.42 with commit 00ba4bf8798242253fefc1fa6a78db1d445fd024
	Issue introduced in 6.18 with commit 890e5198a6e5b238627c245fafea1a92670a86cd and fixed in 7.1.6 with commit 57791aab1129c9405f84bb0882de58967d8b44cd
	Issue introduced in 6.18 with commit 890e5198a6e5b238627c245fafea1a92670a86cd and fixed in 7.2-rc4 with commit 1e5185c090589f4146d728ab36417d8a5419f127

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2026-68387
will be updated if fixes are backported, please check that for the most
up to date information about this issue.


Affected files
==============

The file(s) affected by this issue are:
	net/can/raw.c


Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/00ba4bf8798242253fefc1fa6a78db1d445fd024
	https://git.kernel.org/stable/c/57791aab1129c9405f84bb0882de58967d8b44cd
	https://git.kernel.org/stable/c/1e5185c090589f4146d728ab36417d8a5419f127
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.