From mboxrd@z Thu Jan 1 00:00:00 1970 From: AL-KERNEL To: kernel-cve@kernelcve.org Subject: [CVE-2026-72139][MODERATE 7.0] tcp: defer md5sig_info kfree past RCU grace period in tcp_connect Date: Sat, 15 Aug 2026 07:09:00 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-AL-KERNEL-CVE: CVE-2026-72139 X-AL-KERNEL-Priority: MODERATE 7.0 X-AL-KERNEL-Severity: MODERATE 7.0 X-AL-KERNEL-Base-Severity: MODERATE X-AL-KERNEL-KPANIC: YES X-AL-KERNEL-ActionableScore: 5 X-AL-KERNEL-ActionableScore-Lower: 4 X-AL-KERNEL-Commit: 33a1bee413628378fd036a4f2b17ba86b0bc560c List-Id: CVE: CVE-2026-72139 Priority: MODERATE 7.0 AL-KERNEL base severity: MODERATE KPANIC flag: YES Patch: tcp: defer md5sig_info kfree past RCU grace period in tcp_connect Commit: 33a1bee413628378fd036a4f2b17ba86b0bc560c Upstream patch: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=33a1bee413628378fd036a4f2b17ba86b0bc560c Original CVE announcement: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-72139 Analysis date: Sat, 15 Aug 2026 07:09:00 -0400 ActionableScore: 5 ActionableScore lower bound: 4 Actionable bucket: Strong Important candidate / Actionable Moderate at minimum**:: Actionable Moderate at minimum. Manual review should not be auto-closed because this is a real RCU lifetime UAF in TCP authentication state, even though practical LPE evidence is not demonstrated. Manual review required: YES Summary: A race in TCP MD5/TCP AO cleanup can free md5sig_info and tcp_md5sig_key objects before RCU readers in the softirq RX path finish traversing them, creating a local RCU use-after-free that can crash the kernel and warrants manual review. ====================================================================== ABOUT THIS REPORT ====================================================================== The original Linux kernel CVE announcement for CVE-2026-72139 is available here: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-72139 The original announcement does not normally provide a security severity estimate, CVSS assessment, or enough information to determine whether the reported kernel bug represents a practically relevant security issue. This report was generated by AL-KERNEL, an AI-assisted Linux kernel vulnerability analysis system developed by Alexander Larkin. It combines an autonomous classifier with LLM-assisted technical analysis and a separate ActionableScore mechanism. The purpose of this report is to prioritize Linux kernel CVEs before manual review, identify cases that require prompt investigation, and support automatic closure of issues that are unlikely to have meaningful security impact. Published priority for this report: MODERATE 7.0 Manual review required: YES A detailed explanation of the methodology and priority rules is included at the end of this message. ====================================================================== AL-KERNEL CLASSIFICATION RESULT ====================================================================== CVE-2026-72139 MODERATE CHECK WITH IMPACT FROM ORIG NN IMPORTANT Maybe valid. Check manually. Hints by AL-KERNEL: The best (paranoid) CVSS is 'AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H';*CWE-416;CWE-362;CWE-667;Other CVSS 'AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H';BEST CVSS score: '7';DESCR 'A race in TCP MD5 and TCP AO handling can free md5sig_info and tcp_md5sig_key objects before all RCU readers have completed. A concurrent softirq RX path reader in __tcp_md5_do_lookup or __tcp_md5_do_lookup_exact can keep traversing the key list after tcp_connect has removed and freed the same per-key slab object, creating a use-after-free condition. For the CVSS the PR:L is used because reliable triggering needs local code able to configure TCP_MD5SIG/TCP_AO and start connect, and this may be available through user namespaces or delegated CAP_NET_ADMIN rather than full host root. The issue is not directly network reachable by a remote peer alone in the generic case, although network RX timing participates in the race. Impact is at least local denial of service via kernel crash and in the paranoid case may allow confidentiality and integrity impact due to kernel memory corruption.';YES REQUIRES MANUAL CHECK; ,and ActionableScore result is Strong Important candidate / Actionable Moderate at minimum (with actual score 5) SKIP CVE-2026-72139 UNKNOWN SKIP The Fixes patch not applied yet, so unlikely that actual: 51e547e8c89c661f6fbede4a28b1d33b13625683 YES NO NO unknown MAYBE REMOTE RACE UAF NETWORK LINUS KPANIC KPANIC DECREASED_TO_MODERATE70_BASED_ON_ACTIONABLESCORELOWERTHAN6 - - checked ====================================================================== ACTIONABLESCORE ANALYSIS ====================================================================== ActionableScore=5 ActionableScoreLower=4 ## 1. ActionableScore * Conservative score: 4 * Paranoid score: 5 * Final recommended bucket: **Strong Important candidate / Actionable Moderate at minimum**:: Actionable Moderate at minimum. Manual review should not be auto-closed because this is a real RCU lifetime UAF in TCP authentication state, even though practical LPE evidence is not demonstrated. ## 2. Signal breakdown Conservative signals: * Local unprivileged trigger: +1 Triggering requires local socket setup and TCP_MD5SIG/TCP_AO configuration. In strict host deployments this may require CAP_NET_ADMIN, but user namespaces or delegated netns capabilities can make this reachable by a local unprivileged user. * Memory corruption, weak primitive: +1 The patch fixes a per-key slab use-after-free where tcp_md5sig_key objects are freed while RCU readers may still traverse them. No controlled reclaim, overwrite, callback control, or type confusion is shown. * Real lifetime corruption: +1 This is explicitly an RCU lifetime bug involving hlist traversal, hlist_del versus hlist_del_rcu, kfree versus kfree_rcu, and md5sig_info lifetime. * Reliable kernel crash / strong DoS: +1 A softirq RX reader can dereference freed TCP MD5 key state. The related class already produced splats, and this branch is described as symmetric. * Common networking core path or packet-processing path: +1 The affected reader is in TCP RX authentication lookup paths, although practical exposure requires TCP MD5/AO configuration. Subtract: * Hard or unreliable race / special timing required: -1 The bug depends on a race between tcp_connect cleanup and softirq RX-path RCU readers. Paranoid uplift: * Paranoid score increases to 5 because this is real kernel UAF in networking RCU state and should be manually reviewed, but the race-UAF downgrade rule prevents treating it as a strong LPE primitive without demonstrated reclaim or write control. ## 3. Reachability analysis The bug is not directly triggerable by a remote peer alone in the generic case. A remote packet can participate in the RX timing window, but the vulnerable state is created by a local process configuring TCP MD5/TCP AO and initiating connect. Privileges depend on deployment. In typical host networking, TCP_MD5SIG/TCP_AO configuration is gated by CAP_NET_ADMIN. In systems with unprivileged user namespaces or delegated network namespaces, a local unprivileged user may obtain the needed capability inside a namespace while still attacking the host kernel. The affected code is in TCP, but the specific feature path is not default for ordinary TCP sockets. Realistic exploitation requires TCP MD5/AO setup plus a race window during connect and RX processing. Call-site confidence: high. The commit message and patch identify both the freeing site and the RCU reader functions. ## 4. Severity interpretation This is stronger than an ordinary Moderate cleanup because it fixes a real RCU use-after-free of TCP authentication objects in a packet-processing path. Realistic impact is most clearly local DoS through kernel crash or KASAN splat. Practical privilege escalation is not proven because the patch does not show attacker-controlled reclaim, writable stale object use, callback dispatch, refcount takeover, or type confusion. The paranoid view keeps it actionable because kernel networking UAFs are historically under-triaged, and this bug affects slab objects reachable from softirq RCU readers. ## 5. One-sentence report phrase A race in TCP MD5/TCP AO cleanup can free md5sig_info and tcp_md5sig_key objects before RCU readers in the softirq RX path finish traversing them, creating a local RCU use-after-free that can crash the kernel and warrants manual review. ## 6. Manual review recommendation MANUAL CHECK REQUIRED Reason: real UAF plus RCU lifetime violation in TCP RX-related authentication lookup paths. No strong LPE primitive is demonstrated, but the bug class and subsystem make auto-closure unsafe. ====================================================================== UPSTREAM PATCH SUMMARY ====================================================================== Patch: tcp: defer md5sig_info kfree past RCU grace period in tcp_connect Commit: 33a1bee413628378fd036a4f2b17ba86b0bc560c Upstream URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=33a1bee413628378fd036a4f2b17ba86b0bc560c Commit description: The md5+ao reconciliation in tcp_connect() (net/ipv4/tcp_output.c) has two symmetric branches: if (needs_md5) { tcp_ao_destroy_sock(sk, false); } else if (needs_ao) { tcp_clear_md5_list(sk); kfree(rcu_replace_pointer(tp->md5sig_info, NULL, ...)); } Both branches free a per-socket auth-info object while the socket is in TCP_SYN_SENT and is already on the inet ehash (inserted by inet_hash_connect() in tcp_v4_connect()). Both branches are reachable by softirq RX-path readers that load the corresponding info pointer via implicit RCU before bh_lock_sock_nested() is taken. The needs_md5 branch is fixed in the prior patch by re-introducing the call_rcu() free in tcp_ao_destroy_sock(): the equivalent per-key loop runs inside tcp_ao_info_free_rcu(), the RCU callback, so by the time it frees each tcp_ao_key all softirq readers that captured the container have already completed rcu_read_unlock(). The needs_ao branch is not symmetric in the same way. The container free can be deferred via kfree_rcu(md5sig, rcu) -- struct tcp_md5sig_info already has the required rcu member (include/net/tcp.h:1999-2002), and the rest of the tree already does this in the tcp_md5sig_info_add() rollback paths (net/ipv4/tcp_ipv4.c:1410, 1436). But the per-key teardown is done by tcp_clear_md5_list() in process context BEFORE the container's RCU grace period: it walks &md5sig->head and frees each tcp_md5sig_key with bare hlist_del + kfree. A concurrent softirq reader in __tcp_md5_do_lookup() / __tcp_md5_do_lookup_exact() (tcp_ipv4.c:1253, 1298) walks the same list via hlist_for_each_entry_rcu() and races with that bare kfree on the keys themselves -- a per-key slab use-after-free of the same class as the TCP-AO bug, on the same race window. Fix this in two halves: 1. Convert the bare kfree() in tcp_connect() to kfree_rcu() so the md5sig_info container joins the rest of the md5sig lifecycle. The local-variable lift is mechanical and required because kfree_rcu() is a macro that expects an lvalue. 2. Make tcp_clear_md5_list() RCU-safe by replacing hlist_del + kfree(key) with hlist_del_rcu + kfree_rcu(key, rcu). struct tcp_md5sig_key already carries the rcu member (include/net/tcp.h:1995) and tcp_md5_do_del() (net/ipv4/tcp_ipv4.c:1456) already uses kfree_rcu, so this restores the lifecycle invariant the rest of the file follows rather than introducing a one-off. The other caller of tcp_clear_md5_list() is tcp_md5_destruct_sock() (net/ipv4/tcp.c:412), which runs from the sock destructor when the socket is already unhashed and unreachable; the extra grace period there is unnecessary but harmless. Making the helper unconditionally RCU-safe is the cleaner contract. The needs_ao branch is not reachable by the userns reproducer used to demonstrate the AO-side splat (the repro installs both keys but ends up in the needs_md5 branch because the connect peer matches the MD5 key, not the AO key); however the symmetric race exists and a maintainer touching this code should not have to think about which branch escapes RCU and which one does not. Fixes: 51e547e ("tcp: Free TCP-AO/TCP-MD5 info/keys without RCU") Cc: stable@vger.kernel.org # v6.18+ Suggested-by: Eric Dumazet Signed-off-by: Michael Bommarito Reviewed-by: Dmitry Safonov Reviewed-by: Eric Dumazet [also credits to Qihang, who found that this races with tcp-diag] Reported-by: Qihang Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com> Link: https://patch.msgid.link/20260625-tcp-md5-connect-v3-2-1fd313d6c1e0@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman Changed files: net/ipv4/tcp_output.c include/net/tcp.h net/ipv4/tcp_ipv4.c net/ipv4/tcp.c Diff excerpt: Not included in this email. See the upstream URL for the full patch. Full patch: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=33a1bee413628378fd036a4f2b17ba86b0bc560c ====================================================================== DETAILED REPORT METHODOLOGY ====================================================================== The original Linux kernel CVE announcement for CVE-2026-72139 can be found here: https://lore.kernel.org/linux-cve-announce/?q=CVE-2026-72139 The original CVE announcement normally does not include a security-level estimate. In particular, it may not contain a CVSS assessment, an impact level, or enough information to determine whether the reported bug is a practically relevant security issue. One purpose of this parallel CVE list is to provide that missing technical and prioritization information. The original goal of the AL-KERNEL project was to prioritize Linux kernel CVE analysis automatically before manual review. The system can also help identify non-security issues that may be suitable for automatic closure. This report was generated by AL-KERNEL, an AI-assisted Linux kernel vulnerability analysis system developed by Alexander Larkin. The first analysis stage combines an autonomous classifier with additional LLM-based analysis. The autonomous classifier runs locally on a CPU and is based on a backpropagation neural network. Together, these mechanisms produce a technical vulnerability description, identify likely weakness types, estimate CVSS severity, and provide input for ActionableScore. Two CVSS estimates are retained because incomplete kernel vulnerability information often permits more than one defensible interpretation: Conservative CVSS vector: AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H The Best / paranoid CVSS vector: AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H The Best / paranoid CVSS score: 7 The conservative vector represents a lower-impact interpretation. The Best/paranoid vector intentionally represents a plausible upper-bound interpretation and should not automatically be treated as demonstrated real-world impact. CVSS may also need to be adjusted for a particular Linux deployment, because actual reachability, privileges, enabled kernel configuration, hardware, namespaces, exposed device nodes, and other environmental conditions can differ significantly between systems. A separate ActionableScore mechanism evaluates practical remediation urgency. Its analysis may include reachability, attack prerequisites, subsystem exposure, memory-corruption characteristics, denial-of-service reliability, and possible confidentiality, integrity, or privilege-escalation impact. Conservative ActionableScore: 4 Paranoid ActionableScore: 5 The final base severity is taken directly from the second tab-separated field of the AL-KERNEL classification result. ActionableScore does not replace or independently override that final AL-KERNEL decision, and if ActionableScore adjusted impact level of ALKERNEL, then you would see self-readable flags above like INCREASED_TO_HIGH_BASED_ON_ACTIONABLESCOREHIGHEREQTHAN7. For an AL-KERNEL result of MODERATE, this report uses the following additional presentation split: ActionableScore below 5 -> MODERATE REGULAR ActionableScore 5 or more -> MODERATE 7.0 The distinction between MODERATE REGULAR and MODERATE 7.0 makes it possible to identify Moderate issues that should receive manual analysis and fixes before lower-priority MODERATE REGULAR issues. In many cases, MODERATE REGULAR fixes may wait for a later rebase or routine update. There is one override in which MODERATE REGULAR becomes MODERATE 7.0 even when the ActionableScore is below 5. When the AL-KERNEL result contains the KPANIC flag, a MODERATE result is always presented as MODERATE 7.0. The KPANIC flag selected with few regexps without usage of AI at all, so it helps to detect cases when Kernel Crash happens and similar (to filter False-Negative results from the LLM usage). KPANIC indicates that a reliable kernel crash, kernel panic, or similarly serious kernel availability impact was identified by the classification workflow. AL-KERNEL base severity for this report: MODERATE KPANIC detected for this report: YES Published priority for this report (same as in Subject): MODERATE 7.0 These results are intended to support engineering triage. They are machine-generated estimates, and cases marked for manual review should be validated by a human security engineer before final disposition. For more info read docs linked from here: https://kernelcve.org/ (and you can submit you own patch there to generate such a report for non-existant CVE-id yet). Note that in many cases this AI tool selects higher severity, than real is (means you can expect Importants instead of Moderate 7.0 or Moderates 7.0 instead of regular Moderates). If you see such cases, please use reply email interface to add additional manual analyses info to this particular CVE. And please, please, let me know when you see Lows instead of Importants or Important instead of Low (because particular for such cases I need to tune this AI tool to make it better for this one and next similar). My contact email for such notifications is alexanjelausa@gmail.com (and both send reply to CVE record itself too and see "reply" button below for howto reply).