CVE-2026-64518: tcp: Fix out-of-bounds access for twsk in tcp_ao_established_key().

Greg Kroah-Hartman <[email protected]> Sat, 25 Jul 2026 11:13:39 +0200
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026072538-CVE-2026-64518-7bc3@gregkh>
From: Greg Kroah-Hartman <[email protected]>

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

In the Linux kernel, the following vulnerability has been resolved:

tcp: Fix out-of-bounds access for twsk in tcp_ao_established_key().

lockdep_sock_is_held() was added in tcp_ao_established_key()
by the cited commit.

It can be called from tcp_v[46]_timewait_ack() with twsk.

Since it does not have sk->sk_lock, the lockdep annotation
results in out-of-bound access.

  $ pahole -C tcp_timewait_sock vmlinux | grep size
  	/* size: 288, cachelines: 5, members: 8 */
  $ pahole -C sock vmlinux | grep sk_lock
  	socket_lock_t              sk_lock;              /*   440   192 */

Let's not use lockdep_sock_is_held() for TCP_TIME_WAIT.

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


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

	Issue introduced in 6.12.5 with commit 051f49d5176613dea88ecf73a101c3a99f4720e9 and fixed in 6.12.92 with commit 87bb3e719042f0030a6dad39118c6a6b2a491ad9
	Issue introduced in 6.13 with commit 6b2d11e2d8fc130df4708be0b6b53fd3e6b54cf6 and fixed in 6.18.34 with commit 510db031ba6eb40134f84c90ef963ea4b6dfb878
	Issue introduced in 6.13 with commit 6b2d11e2d8fc130df4708be0b6b53fd3e6b54cf6 and fixed in 7.0.11 with commit 29cf64d128c94cf98d1c69d8b2962d39db5ff4c6
	Issue introduced in 6.13 with commit 6b2d11e2d8fc130df4708be0b6b53fd3e6b54cf6 and fixed in 7.1 with commit 03cb001ef87b3f8d859cf7f96329acf3d6235d29

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-64518
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/ipv4/tcp_ao.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/87bb3e719042f0030a6dad39118c6a6b2a491ad9
	https://git.kernel.org/stable/c/510db031ba6eb40134f84c90ef963ea4b6dfb878
	https://git.kernel.org/stable/c/29cf64d128c94cf98d1c69d8b2962d39db5ff4c6
	https://git.kernel.org/stable/c/03cb001ef87b3f8d859cf7f96329acf3d6235d29