# CVE-2026-98432: ipv4: free inet_opt and ireq_opt after an RCU grace period

The Markdown version of <https://upatch.dev/cve/CVE-2026-98432>. Last updated 25 Nov 2026.

## At a glance

CVE-2026-98432 is rated Critical 9.8 (CVSS 3.1, CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H). It affects the Linux kernel and was published on 15 Oct 2026. It is not in CISA's Known Exploited Vulnerabilities catalog. Its EPSS score is 82%: the estimated chance it is exploited in the next 30 days, as of 24 Nov 2026. The upatch `cve-2026-98432-ireq-opt-block` mitigates it, and is vetted (merged into the registry).

A upatch is a signed BPF program that shirudo loads into a running Linux kernel to block the code path this CVE's exploit takes. It holds the line until the fix ships; it does not replace patching.

## The vulnerability

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.

## What the upatch does

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.

The policy: [`cve-2026-98432-ireq-opt-block.bpf.c`](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-98432), 30 lines of BPF C attached at `lsm/inet_conn_request`, licensed GPL-2.0 OR BSD-2-Clause.

## 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.

## 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` |

## How it was tested

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

| State           | IPv4 TCP connect with Record Route IP option | Plain IPv4 TCP connect without IP options |
| --------------- | -------------------------------------------- | ----------------------------------------- |
| Before loading  | connected                                    | connected                                 |
| Upatch loaded   | refused (SYN dropped)                        | connected                                 |
| After unloading | connected                                    | connected                                 |

## How to apply

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:

```sh
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:

```sh
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>
```

## Review

- Contributors: romanlab.
- Reviewers: none recorded yet.

## Sources and links

- [CVE-2026-98432 record (Linux kernel CNA JSON)](https://git.kernel.org/pub/scm/linux/security/vulns.git/plain/cve/published/2026/CVE-2026-98432.json)
- [Announcement with affected and fixed versions](https://git.kernel.org/pub/scm/linux/security/vulns.git/plain/cve/published/2026/CVE-2026-98432.mbox)
- [Mainline fix commit e3f33b0a1d89](https://git.kernel.org/stable/c/e3f33b0a1d89d738e2b913dab519226eaf76e15b)
- [Stable fix commits: 7.2.10 26d4c36d318c](https://git.kernel.org/stable/c/26d4c36d318cffbbd160884a0e4cec0da4da4936), [6.18.56 a47406c769f7](https://git.kernel.org/stable/c/a47406c769f72c070386985488f1c4d057df86b2), [6.12.113 11a03ce3c4a6](https://git.kernel.org/stable/c/11a03ce3c4a62d84c10ccdfe47f8075006498568), [6.6.159 742f73df544e](https://git.kernel.org/stable/c/742f73df544e03744f2981c467d6542fe8172a2a), [6.1.190 89b5b1eb7d63](https://git.kernel.org/stable/c/89b5b1eb7d633c33832b7ff2c02e19a144705036), [5.15.223 95a8c8fa9f27](https://git.kernel.org/stable/c/95a8c8fa9f27dce64c40c41c062de7728bf34ab5), [5.10.272 b3b027ef0cd3](https://git.kernel.org/stable/c/b3b027ef0cd322bfa839b9aaf5b27551eea54cf6)

### Links

- [CVE-2026-98432 on upatch.dev](https://upatch.dev/cve/CVE-2026-98432) (this page, as HTML)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-98432)
- [CVE.org](https://www.cve.org/CVERecord?id=CVE-2026-98432)
- [CWE-416](https://cwe.mitre.org/data/definitions/416.html)
- Upatch source: [upatches/cve-2026-98432](https://github.com/copper-helm/upatch-registry/tree/main/upatches/cve-2026-98432)

### More references from NVD (12)

- [git.kernel.org](https://git.kernel.org/stable/c/11a03ce3c4a62d84c10ccdfe47f8075006498568) (Patch)
- [git.kernel.org](https://git.kernel.org/stable/c/26d4c36d318cffbbd160884a0e4cec0da4da4936) (Patch)
- [git.kernel.org](https://git.kernel.org/stable/c/742f73df544e03744f2981c467d6542fe8172a2a) (Patch)
- [git.kernel.org](https://git.kernel.org/stable/c/89b5b1eb7d633c33832b7ff2c02e19a144705036) (Patch)
- [git.kernel.org](https://git.kernel.org/stable/c/95a8c8fa9f27dce64c40c41c062de7728bf34ab5) (Patch)
- [git.kernel.org](https://git.kernel.org/stable/c/a47406c769f72c070386985488f1c4d057df86b2) (Patch)
- [git.kernel.org](https://git.kernel.org/stable/c/b3b027ef0cd322bfa839b9aaf5b27551eea54cf6) (Patch)
- [git.kernel.org](https://git.kernel.org/stable/c/e3f33b0a1d89d738e2b913dab519226eaf76e15b) (Patch)
- [openwall.com](http://www.openwall.com/lists/oss-security/2026/10/30/1) (Mailing List, Third Party Advisory)
- [openwall.com](http://www.openwall.com/lists/oss-security/2026/10/30/6) (Mailing List, Third Party Advisory)
- [openwall.com](http://www.openwall.com/lists/oss-security/2026/10/31/5) (Mailing List, Third Party Advisory)
- [openwall.com](http://www.openwall.com/lists/oss-security/2026/11/03/1) (Mailing List, Third Party Advisory)
