{"id":6800,"date":"2026-09-04T18:49:17","date_gmt":"2026-09-04T10:49:17","guid":{"rendered":"https:\/\/www.54iter.cn\/?vuln=cve-2026-72139"},"modified":"2026-09-04T18:49:17","modified_gmt":"2026-09-04T10:49:17","slug":"cve-2026-72139","status":"publish","type":"vuln","link":"https:\/\/www.54iter.cn\/?vuln=cve-2026-72139","title":{"rendered":"CVE-2026-72139 [CRITICAL] &#8211; In the Linux kernel, the following vulnerability has been resolved:\n\ntcp: defer md5sig_inf"},"content":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>tcp: defer md5sig_info kfree past RCU grace period in tcp_connect<\/p>\n<p>The md5+ao reconciliation in tcp_connect() (net\/ipv4\/tcp_output.c)<br \/>\nhas two symmetric branches:<\/p>\n<p>\tif (needs_md5) {<br \/>\n\t\ttcp_ao_destroy_sock(sk, false);<br \/>\n\t} else if (needs_ao) {<br \/>\n\t\ttcp_clear_md5_list(sk);<br \/>\n\t\tkfree(rcu_replace_pointer(tp-&gt;md5sig_info, NULL, &#8230;));<br \/>\n\t}<\/p>\n<p>Both branches free a per-socket auth-info object while the socket is<br \/>\nin TCP_SYN_SENT and is already on the inet ehash (inserted by<br \/>\ninet_hash_connect() in tcp_v4_connect()). Both branches are reachable<br \/>\nby softirq RX-path readers that load the corresponding info pointer<br \/>\nvia implicit RCU before bh_lock_sock_nested() is taken.<\/p>\n<p>The needs_md5 branch is fixed in the prior patch by re-introducing<br \/>\nthe call_rcu() free in tcp_ao_destroy_sock(): the equivalent per-key<br \/>\nloop runs inside tcp_ao_info_free_rcu(), the RCU callback, so by the<br \/>\ntime it frees each tcp_ao_key all softirq readers that captured the<br \/>\ncontainer have already completed rcu_read_unlock().<\/p>\n<p>The needs_ao branch is not symmetric in the same way. The container<br \/>\nfree can be deferred via kfree_rcu(md5sig, rcu) &#8212; struct<br \/>\ntcp_md5sig_info already has the required rcu member<br \/>\n(include\/net\/tcp.h:1999-2002), and the rest of the tree already does<br \/>\nthis in the tcp_md5sig_info_add() rollback paths<br \/>\n(net\/ipv4\/tcp_ipv4.c:1410, 1436). But the per-key teardown is done<br \/>\nby tcp_clear_md5_list() in process context BEFORE the container&#8217;s<br \/>\nRCU grace period: it walks &amp;md5sig-&gt;head and frees each<br \/>\ntcp_md5sig_key with bare hlist_del + kfree. A concurrent softirq<br \/>\nreader in __tcp_md5_do_lookup() \/ __tcp_md5_do_lookup_exact()<br \/>\n(tcp_ipv4.c:1253, 1298) walks the same list via<br \/>\nhlist_for_each_entry_rcu() and races with that bare kfree on the<br \/>\nkeys themselves &#8212; a per-key slab use-after-free of the same class<br \/>\nas the TCP-AO bug, on the same race window.<\/p>\n<p>Fix this in two halves:<\/p>\n<p>  1. Convert the bare kfree() in tcp_connect() to kfree_rcu() so the<br \/>\n     md5sig_info container joins the rest of the md5sig lifecycle.<br \/>\n     The local-variable lift is mechanical and required because<br \/>\n     kfree_rcu() is a macro that expects an lvalue.<\/p>\n<p>  2. Make tcp_clear_md5_list() RCU-safe by replacing hlist_del +<br \/>\n     kfree(key) with hlist_del_rcu + kfree_rcu(key, rcu). struct<br \/>\n     tcp_md5sig_key already carries the rcu member<br \/>\n     (include\/net\/tcp.h:1995) and tcp_md5_do_del()<br \/>\n     (net\/ipv4\/tcp_ipv4.c:1456) already uses kfree_rcu, so this<br \/>\n     restores the lifecycle invariant the rest of the file follows<br \/>\n     rather than introducing a one-off.<\/p>\n<p>The other caller of tcp_clear_md5_list() is tcp_md5_destruct_sock()<br \/>\n(net\/ipv4\/tcp.c:412), which runs from the sock destructor when the<br \/>\nsocket is already unhashed and unreachable; the extra grace period<br \/>\nthere is unnecessary but harmless. Making the helper unconditionally<br \/>\nRCU-safe is the cleaner contract.<\/p>\n<p>The needs_ao branch is not reachable by the userns reproducer used<br \/>\nto demonstrate the AO-side splat (the repro installs both keys but<br \/>\nends up in the needs_md5 branch because the connect peer matches<br \/>\nthe MD5 key, not the AO key); however the symmetric race exists<br \/>\nand a maintainer touching this code should not have to think about<br \/>\nwhich branch escapes RCU and which one does not.<\/p>\n<p>[also credits to Qihang, who found that this races with tcp-diag]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>tcp: defer md5sig_info kfree past RCU grace period in tcp_connect<\/p>\n<p>The md5+ao reconciliation in tcp_connect() (net\/ipv4\/tcp_output.<\/p>\n","protected":false},"template":"","meta":[],"categories":[],"tags":[],"class_list":["post-6800","vuln","type-vuln","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln\/6800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln"}],"about":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/types\/vuln"}],"wp:attachment":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}