upatch.dev

CVE-2026-98432

ipv4: free inet_opt and ireq_opt after an RCU grace period

Refuses IPv4 TCP connection requests carrying echoed IP options to mitigate CVE-2026-98432.

Critical 9.8Vetted

EPSS 82%: the estimated chance this CVE is exploited in the next 30 days, as of 24 Nov 2026.

At a glance

CVE-2026-98432 is a critical (CVSS 9.8) vulnerability in the Linux kernel, published 15 October 2026. A vetted upatch, cve-2026-98432-ireq-opt-block, blocks it on running Linux machines with shirudo until the kernel is patched.

Severity
Critical 9.8 CVSS 3.1
Chance of exploitation
82% in the next 30 days (EPSS, 24 Nov 2026)
Known exploited
No, not on CISA’s KEV list
Weakness
CWE-416
Affected software
Linux kernel
Upatch status
Vetted, merged into the registry
How to apply
Build, sign and roll out with shirudo

Overview

CVE-2026-98432, "ipv4: free inet_opt and ireq_opt after an RCU grace period", was published on 15 October 2026. When an IPv4 TCP listener receives a SYN carrying IP options that the kernel echoes in replies (such as Record Route, Timestamp, or Source Route), tcp_v4_init_req() (and cookie_v4_check() for syncookies) saves them into ireq->ireq_opt via tcp_v4_save_options(). tcp_v4_syn_recv_sock() then transfers ownership of ireq->ireq_opt to the child socket (newinet->inet_opt) without copying it, and reqsk_timer_handler() / inet_reqsk_clone() share ireq_opt across migrated request sockets. Because inet_sock_destruct() and tcp_v4_reqsk_destructor() freed those options with kfree() instead of kfree_rcu(), a concurrent CPU processing a retransmitted SYN in tcp_check_req() -> tcp_v4_send_synack() under rcu_read_lock() only could read ireq->ireq_opt while it was freed, causing a use-after-free in ip_build_and_send_pkt() and ip_options_build().

Official description

In the Linux kernel, the following vulnerability has been resolved: ipv4: free inet_opt and ireq_opt after an RCU grace period tcp_v4_syn_recv_sock() transfers ownership of ireq->ireq_opt to the child socket (newinet->inet_opt) without copying it. Another cpu can concurrently process a retransmitted SYN for the same request socket, and send a SYNACK from tcp_check_req(). tcp_v4_send_synack() and inet_csk_route_req() read ireq->ireq_opt under rcu_read_lock() only, and ip_build_and_send_pkt() and ip_options_build() then read opt->optlen twice. Note that the SYNACK timer itself is not an issue: it holds a reference on its request socket, and inet_csk_reqsk_queue_drop() calls timer_delete_sync() before the child can be freed. Since commit 079096f103fa ("tcp/dccp: install syn_recv requests into ehash table"), request sockets are processed without holding the listener lock, so nothing prevents the child socket from being freed while the SYNACK is still being built. TCP child sockets do not have SOCK_RCU_FREE, and inet_sock_destruct() frees inet_opt with a plain kfree(), leading to a use-after-free in ip_options_build(). A similar issue exists with request socket migration (net.ipv4.tcp_migrate_req=1, or a BPF_SK_REUSEPORT_SELECT_OR_MIGRATE program). reqsk_timer_handler() clones the request socket with inet_reqsk_clone(), so that the old request socket and its clone share the same ireq_opt, then reqsk_migrate_reset() clears the pointer in the old one. Another cpu holding a reference on the old request socket can still be using these options (sending a SYNACK, or creating a child in tcp_v4_syn_recv_sock()) when the clone is freed, and tcp_v4_reqsk_destructor() also uses a plain kfree(). Readers already use RCU, and other paths replacing inet_opt (do_ip_setsockopt(), cipso_v4_sock_setattr()...) already use kfree_rcu(). Use kfree_rcu() in inet_sock_destruct() and tcp_v4_reqsk_destructor() as well. IPv6 is not affected by the first issue, because tcp_v6_syn_recv_sock() duplicates the options. tcp_v6_reqsk_destructor() has the same migration issue with ipv6_opt, which is only set by CALIPSO. This will be addressed in a separate patch.

Affected versions

The bug was introduced in Linux 4.4 by commit 079096f103fa ("tcp/dccp: install syn_recv requests into ehash table") and by commit c905dee62232 ("tcp: Migrate TCP_NEW_SYN_RECV requests at retransmitting SYN+ACKs.").

Branch Bug added in Fixed in Fix commit
5.10 4.4 5.10.272 b3b027ef0cd3
5.15 4.4 5.15.223 95a8c8fa9f27
6.1 4.4 6.1.190 89b5b1eb7d63
6.6 4.4 6.6.159 742f73df544e
6.12 4.4 6.12.113 11a03ce3c4a6
6.18 4.4 6.18.56 a47406c769f7
7.2 4.4 7.2.10 26d4c36d318c
mainline 4.4 7.3 e3f33b0a1d89

Sources

More references from NVD (12)

Mitigation

It attaches to the lsm/inet_conn_request hook (security_inet_conn_request(sk, skb, req)). In both tcp_v4_route_req() (net/ipv4/tcp_ipv4.c) and cookie_v4_check() (net/ipv4/syncookies.c), the kernel calls tcp_v4_save_options() and assigns ireq->ireq_opt immediately before calling security_inet_conn_request(). When req->__req_common.skc_family is AF_INET (2) and inet_rsk(req)->ireq_opt is non-NULL, the program returns -EPERM. The caller then drops the connection request and frees req before it is inserted into the ehash table or creates a child socket, so neither tcp_check_req() nor request-socket migration can ever race on ireq_opt. A non-zero return value from an earlier BPF LSM program on the same hook is passed on unchanged.

Side effects

  • Incoming IPv4 TCP connection requests (SYN, or ACK in the syncookie path) that carry IPv4 options echoed by __ip_options_echo() (Record Route, Timestamp, Source Route, or CIPSO) are dropped during the handshake.
  • Normal IPv4 TCP connections without IP options, and all IPv6 TCP connections, work as before.
  • Outgoing TCP connections and non-TCP protocols are unaffected.

Preemption model and cost

The program keeps no state: no maps, no locks, and no shared or per-CPU data. It is safe under every preemption model, including PREEMPT_LAZY, preemptible RCU, and PREEMPT_RT. It runs only on incoming connection requests (SYN), never on established data packets, and costs two CO-RE field reads (skc_family and ireq_opt) per connection request.

The policy

30 lines of BPF C, attached at lsm/inet_conn_request.

// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause

#include "vmlinux.h"
#include <bpf/bpf_core_read.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>

#define AF_INET	2
#define EPERM	1

char _license[] SEC("license") = "Dual BSD/GPL";

SEC("lsm/inet_conn_request")
int BPF_PROG(cve_2026_98432_ireq_opt_block, const struct sock *sk,
	     struct sk_buff *skb, struct request_sock *req, int ret)
{
	struct inet_request_sock *ireq;

	if (ret)
		return ret;
	if (!req)
		return 0;
	if (BPF_CORE_READ(req, __req_common.skc_family) != AF_INET)
		return 0;
	ireq = (struct inet_request_sock *)req;
	if (BPF_CORE_READ(ireq, ireq_opt))
		return -EPERM;
	return 0;
}

Process

How this upatch was written, checked and reviewed, from the registry’s history.

  1. 15 Oct 2026CVECVE published
  2. 25 Nov 2026Pull requestPull request #7 openedAdd CVE-2026-98432: Refuses IPv4 TCP connection requests carrying echoed IP optionsromanlab
  3. 25 Nov 2026ReviewReviewedqodo-code-review[bot] (automated)
  4. 25 Nov 2026MergeMerged #7romanlab

No human review is recorded on GitHub for this upatch yet.

Evidence

While loaded, IPv4 TCP connection requests carrying a Record Route IP option were refused at lsm/inet_conn_request while plain IPv4 TCP connections succeeded. The test kernel (7.4) already includes the mainline fix from 7.3, so this verifies the refusal of option-bearing connection requests rather than UAF prevention on an unpatched kernel.

Tested
25 Nov 2026
Target
Linux 7.4 IPv4 TCP stack (inet_conn_request with IP_OPTIONS)
Kernel
7.4-shirudo-ci-20261123
Architecture
x86_64
Machine
shirudo test VM
Results
StateIPv4 TCP connect with Record Route IP optionPlain IPv4 TCP connect without IP options
Before loadingconnectedconnected
Upatch loadedrefused (SYN dropped)connected
After unloadingconnectedconnected
tools-test.log tools/test --setup output showing reached before, blocked while loaded, and reached after
tools/test --setup, 2026-11-25T09:48:06Z
Target: shirudo test VM, Linux 7.4-shirudo-ci-20261123, x86_64, swtpm
cve-2026-98432
  before  reached      IPv4 TCP handshake with Record Route IP option succeeded, populating ireq_opt
  loaded  blocked      IPv4 TCP SYN with Record Route IP option was refused at inet_conn_request
  after   reached      IPv4 TCP handshake with Record Route IP option succeeded, populating ireq_opt
  PASS: reached before, blocked while loaded, reached again after

Use it

Build the upatch from source, sign it with your own shirudo key, and publish it to your own OCI registry. Machines that follow your upatch tree load it within about a minute.

Build and sign
git clone https://github.com/copper-helm/upatch-registry
cd upatch-registry
tools/build <shirudo-checkout> <keys-dir> 1.0.0 upatches/cve-2026-98432
Publish and roll out
shirudo bpm push build/packages/cve-2026-98432-1.0.0.bee oci://<registry>/<namespace>/cve-2026-98432 --keys-dir <keys-dir>
shirudo bpm tree append build/packages/cve-2026-98432-1.0.0.bee oci://<registry>/<namespace>/<tree> --tree-id <tree-id> --keys-dir <keys-dir>