# CVE-2026-74714: bpf: tcp: Fix use-after-free in bpf\_iter\_tcp\_established\_batch()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.17% (percentile 4, 2026-11-26)
- **Published:** 2026-08-22T15:33:09.643Z
- **Modified:** 2026-10-16T20:17:54.033Z

## Who should check

- Anyone running Linux \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< cc0295f89296ed351fc4b0b48fee887ba02c5d24; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< ddbe966b5d1fe212ada749bc3d0b410f1a7dea74; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< 7d2b60a4bc0499f62ff8520af6309bbe170882fd; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< cefcbbe20846a45f9a7dae868f7ef1000953e2df; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< 97e74d3e45d653c07c2d406fc530a9bbe3df8396; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< e5fd3f514e27db1f05fbd72ba615d74941e23c51
- Anyone running Linux 5.15

## Description

In the Linux kernel, the following vulnerability has been resolved:

bpf: tcp: Fix use-after-free in bpf\_iter\_tcp\_established\_batch()

reqsk\_queue\_hash\_req() publishes a TCP\_NEW\_SYN\_RECV request\_sock onto
the ehash chain, drops the bucket lock, and only afterwards sets
rsk\_refcnt to 3.

Lockless readers such as \_\_inet\_lookup\_established() handle this with
refcount\_inc\_not\_zero(), but bpf\_iter\_tcp\_established\_batch() uses plain
sock\_hold() while holding the bucket lock, on the assumption that the
lock guarantees sk\_refcnt \> 0. That assumption does not hold for
request\_sock:

  CPU 0                                CPU 1
  -----                                -----
  tcp\_conn\_request()
   reqsk\_queue\_hash\_req()
    inet\_ehash\_insert(req)
     spin\_lock(bucket)
     \_\_sk\_nulls\_add\_node\_rcu(req)      // rsk\_refcnt == 0
     spin\_unlock(bucket)
                                       bpf\_iter\_tcp\_established\_batch()
                                        spin\_lock(bucket)
                                        sock\_hold(req)   \<-- addition on 0
                                        spin\_unlock(bucket)
    refcount\_set(&req-\>rsk\_refcnt, 3)  // clobbers saturated value

which surfaces as:

  refcount\_t: addition on 0; use-after-free.
  WARNING: lib/refcount.c:25 at refcount\_warn\_saturate+0x48/0x90, CPU\#1
  Call Trace:
   bpf\_iter\_tcp\_established\_batch+0x14e/0x170
   bpf\_iter\_tcp\_batch+0x53/0x200
   bpf\_iter\_tcp\_seq\_next+0x27/0x70
   bpf\_seq\_read+0x107/0x410
   vfs\_read+0xb9/0x380

The iterator's stolen reference is lost when the publishing CPU's
refcount\_set() overwrites the count, leaving the socket one reference
short. When the last legitimate owner drops its reference the reqsk is
freed while still reachable, leading to use-after-free.

This reproduces in seconds with tcp\_syncookies=0, a handful of threads
doing connect()/close() to a local listener while others read an
iter/tcp link in a tight loop.

Use refcount\_inc\_not\_zero() and skip the socket on failure. A skipped
socket is still part of the bucket, so keep counting it in expected.
The reallocations are sized from expected, and a request sock whose
refcount gets published while the lock is held across the last realloc
must already have room.

A skipped socket is counted in expected but never batched, so end\_sk
can be short of expected on a batch that is actually complete. Decide
completeness by whether the walk left any socket behind instead. The
WARN after the locked realloc checks the same, replacing an
end\_sk == expected check that could not hold on that path since
commit cdec67a489d4 ("bpf: tcp: Make sure iter-\>batch always
contains a full bucket snapshot").

If every matching socket in a bucket is mid-init (refcount 0), end\_sk
stays 0. Advance to the next bucket rather than returning a batch entry
that was never filled this round.

## Affected and fixed versions

- Linux: \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< cc0295f89296ed351fc4b0b48fee887ba02c5d24; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< ddbe966b5d1fe212ada749bc3d0b410f1a7dea74; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< 7d2b60a4bc0499f62ff8520af6309bbe170882fd; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< cefcbbe20846a45f9a7dae868f7ef1000953e2df; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< 97e74d3e45d653c07c2d406fc530a9bbe3df8396; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< e5fd3f514e27db1f05fbd72ba615d74941e23c51 (cvelist)
- Linux: 5.15 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-74714. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-74714.md
Affected: Linux >= 04c7820b776f1c4b48698574c47de9e940d368e8, < cc0295f89296ed351fc4b0b48fee887ba02c5d24; >= 04c7820b776f1c4b48698574c47de9e940d368e8, < ddbe966b5d1fe212ada749bc3d0b410f1a7dea74; >= 04c7820b776f1c4b48698574c47de9e940d368e8, < 7d2b60a4bc0499f62ff8520af6309bbe170882fd; >= 04c7820b776f1c4b4869857…
Fixed in: Linux 7d2b60a4bc0499f62ff8520af6309bbe170882fd, Linux 97e74d3e45d653c07c2d406fc530a9bbe3df8396

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-74714 being exploited?

There is no confirmed exploitation: CVE-2026-74714 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.17% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-74714?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-74714?

Linux \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< cc0295f89296ed351fc4b0b48fee887ba02c5d24; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< ddbe966b5d1fe212ada749bc3d0b410f1a7dea74; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< 7d2b60a4bc0499f62ff8520af6309bbe170882fd; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< cefcbbe20846a45f9a7dae868f7ef1000953e2df; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< 97e74d3e45d653c07c2d406fc530a9bbe3df8396; \>= 04c7820b776f1c4b48698574c47de9e940d368e8, \< e5fd3f514e27db1f05fbd72ba615d74941e23c51; Linux 5.15.

### Is there a fix for CVE-2026-74714?

Yes. Fixed in Linux 7d2b60a4bc0499f62ff8520af6309bbe170882fd, Linux 97e74d3e45d653c07c2d406fc530a9bbe3df8396. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-74714?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/cc0295f89296ed351fc4b0b48fee887ba02c5d24>
- other: <https://git.kernel.org/stable/c/ddbe966b5d1fe212ada749bc3d0b410f1a7dea74>
- other: <https://git.kernel.org/stable/c/7d2b60a4bc0499f62ff8520af6309bbe170882fd>
- other: <https://git.kernel.org/stable/c/cefcbbe20846a45f9a7dae868f7ef1000953e2df>
- other: <https://git.kernel.org/stable/c/97e74d3e45d653c07c2d406fc530a9bbe3df8396>
- other: <https://git.kernel.org/stable/c/e5fd3f514e27db1f05fbd72ba615d74941e23c51>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-74714>

HTML: <https://flawdb.com/CVE-2026-74714> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-74714>
