{"id":"CVE-2026-80850","summary":"tcp: fix AO info use-after-free in tcp_ao_connect_init()","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ntcp: fix AO info use-after-free in tcp_ao_connect_init()\n\ntcp_v4_connect() adds a SYN-SENT socket to the ehash before calling\ntcp_connect().  If TCP-AO is configured, tcp_connect() first verifies that\na key matches the peer and the bound device's current L3 master.\ntcp_ao_connect_init() later resolves the L3 master again and removes keys\nwhich do not match it.\n\nThe socket lock does not stabilize the bound device's VRF membership.\nDetaching the device from its VRF between the initial validation and the\nL3-master calculation in tcp_ao_connect_init() can therefore make the\nvalidation succeed while initialization observes the default L3 domain and\nremoves the only key.  The subsequent AO lookup then fails, so the no-key\npath clears tp-\u003eao_info and frees it directly.\n\nThe receive path can find the socket in the ehash and load tp-\u003eao_info\nunder RCU before acquiring the socket lock.  A reader which loaded the old\npointer can thus continue into tcp_inbound_ao_hash() after the direct free.\n\nThe issue was found during a static audit of TCP-AO object lifetime.  An\nunprivileged reproducer in self-created user and network namespaces raced\nconnect() with detaching a veth from its VRF while sending TCP-AO segments.\nIt triggered the same KASAN report on two fresh boots:\n\n  BUG: KASAN: slab-use-after-free in tcp_inbound_ao_hash+0x585/0x19f0\n  Write of size 8 at addr ffff88800bf88128 by task tcp_ao_vrf_race/232\n\n  Call Trace:\n   tcp_inbound_ao_hash+0x585/0x19f0\n   tcp_inbound_hash+0x677/0xa80\n   tcp_v4_rcv+0x1c3e/0x3ab0\n\n  Allocated by task 235:\n   tcp_ao_alloc_info+0x43/0xf0\n   tcp_ao_add_cmd+0xdf7/0x13b0\n   do_tcp_setsockopt+0x168c/0x2640\n\n  Freed by task 235:\n   kfree+0x1b8/0x550\n   tcp_connect+0x252/0x4f00\n   tcp_v4_connect+0x1114/0x1720\n\nThe bad address is 40 bytes inside the freed 128-byte object, matching the\ntcp_ao_info counters.key_not_found field.  The two runs used 1000 attempts\neach, reached the no-key path 366 and 411 times, and produced one and two\nKASAN reports respectively.  With this change, the same reproducer reached\nthe no-key path 366 times in 1000 attempts without a KASAN report or oops.\n\nUse tcp_ao_destroy_sock() for the no-key path.  It unpublishes the AO info,\nupdates the socket memory and static-key accounting, and defers the free\nuntil after an RCU grace period.\n\nAlso drop the WARN_ON_ONCE() and its stale comment.  The VRF detach race\nmakes the no-key state reachable during normal operation, so it is a\nhandled condition rather than an impossible assertion.  On panic_on_warn\nkernels the WARN would turn this handled race into a kernel panic.","modified":"2026-09-06T03:46:54.326243653Z","published":"2026-09-04T15:55:00.588Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/80xxx/CVE-2026-80850.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/284d7fd0eec8774bd6214921fbf525cf907c590e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/594ba77210a1f065832211851a2d7e14d11fcbdb"},{"type":"WEB","url":"https://git.kernel.org/stable/c/70051a57786d5b23f059fbaf5c8241eca14d42ed"},{"type":"WEB","url":"https://git.kernel.org/stable/c/d17e88b6b60ff4ef64e0dd1444f935cb13dee1cd"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ea30dc5267e367b8a5e1e06cc074f813bcbf18b2"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/80xxx/CVE-2026-80850.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-80850"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"248411b8cb8974a1e1c8e43123c1e682fbd64969"},{"fixed":"594ba77210a1f065832211851a2d7e14d11fcbdb"},{"fixed":"70051a57786d5b23f059fbaf5c8241eca14d42ed"},{"fixed":"284d7fd0eec8774bd6214921fbf525cf907c590e"},{"fixed":"d17e88b6b60ff4ef64e0dd1444f935cb13dee1cd"},{"fixed":"ea30dc5267e367b8a5e1e06cc074f813bcbf18b2"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-80850.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.108"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.49"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.1.13"}]},{"type":"ECOSYSTEM","events":[{"introduced":"7.2.0"},{"fixed":"7.2.3"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-80850.json"}}],"schema_version":"1.9.0"}