Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-98378 Overview
CVE-2026-98378 is a use-after-free vulnerability in the Linux kernel's Berkeley Packet Filter (BPF) subsystem. The flaw resides in the BPF link iterator, which fails to skip unsettled links during iteration. When bpf_link_prime() inserts a link into link_idr before anon_inode_getfile() completes, the iterator can take a reference to a link that has not yet published its ID. If file creation subsequently fails, the creator frees the link directly, leaving the iterator with a dangling reference. The next call to bpf_link_put() accesses freed memory, triggering a KASAN slab-use-after-free report and kernel panic.
Critical Impact
Local attackers with BPF access can trigger a use-after-free in kernel memory, leading to denial of service or potential privilege escalation.
Affected Products
- Linux kernel BPF subsystem (kernel/bpf/link_iter.c, kernel/bpf/syscall.c)
- Multiple stable kernel branches referenced in upstream fix commits
- Systems exposing BPF link iteration to unprivileged or sandboxed workloads
Discovery Timeline
- 2026-10-09 - CVE CVE-2026-98378 published to NVD
- 2026-10-09 - Last updated in NVD database
Technical Details for CVE-2026-98378
Vulnerability Analysis
The vulnerability lives in the BPF link lifecycle management code. bpf_link_prime() inserts a new link into the link_idr IDR before the backing anonymous inode file is successfully created. During this window, the link exists in the IDR with its link->id field still zero because bpf_link_settle() has not yet published the identifier.
bpf_link_by_id() correctly treats ID-zero entries as unsettled and skips them. However, bpf_link_get_curr_or_next(), used by the link iterator, lacks the equivalent check. The iterator consequently takes a reference on a link whose creation has not completed.
If anon_inode_getfile() fails, the creator path removes the IDR entry and frees the still-private link directly. The iterator now holds a dangling reference, and the subsequent bpf_link_put() writes into freed slab memory. KASAN flags this as a slab-use-after-free in the bpf_link_put -> bpf_link_seq_next -> bpf_seq_read call chain.
Root Cause
The root cause is a missing synchronization check in the link iterator. bpf_link_get_curr_or_next() does not validate that an IDR entry has been fully settled before acquiring a reference. The upstream fix teaches the iterator to treat ID-zero entries as transient, mirroring the behavior of bpf_link_by_id().
Attack Vector
A local attacker able to open BPF link iterators and race BPF link creation failures can trigger the use-after-free. The reproducer referenced in the KASAN report exercises the race through bpf_seq_read() on a BPF iterator file descriptor. Successful exploitation requires concurrent BPF link creation that fails at the anon_inode_getfile() step, timed against an active iterator read.
The vulnerability is described in prose because only patch commits are available. See the upstream fix at Kernel Git Commit 50e80e2 for the authoritative code change.
Detection Methods for CVE-2026-98378
Indicators of Compromise
- KASAN reports showing slab-use-after-free in bpf_link_put with call traces through bpf_link_seq_next and bpf_seq_read.
- Unexpected kernel panics on hosts that permit BPF link iteration to non-root workloads.
- Repeated failed BPF link creation attempts correlated with reads on /sys/fs/bpf iterator file descriptors.
Detection Strategies
- Enable KASAN on test and staging kernels to surface use-after-free conditions during BPF stress testing.
- Audit bpf() syscall telemetry for processes that create short-lived BPF links alongside concurrent link iterator reads.
- Monitor kernel ring buffer output for BUG: KASAN entries referencing kernel/bpf/link_iter.c or kernel/bpf/syscall.c.
Monitoring Recommendations
- Collect dmesg and /var/log/kern.log for KASAN or Oops signatures from BPF code paths.
- Track BPF syscall usage per workload using auditd rules on syscall=bpf to baseline expected behavior.
- Alert on kernel panics across fleets to catch opportunistic exploitation attempts.
How to Mitigate CVE-2026-98378
Immediate Actions Required
- Apply the upstream patch that teaches bpf_link_get_curr_or_next() to skip ID-zero link entries.
- Update to a kernel release that includes the fix commits referenced in the NVD advisory.
- Restrict bpf() syscall access to trusted workloads using seccomp, LSM policy, or kernel.unprivileged_bpf_disabled=1.
Patch Information
The fix has been merged across multiple stable branches. Refer to the upstream commits: Kernel Git Commit 50e80e2, Kernel Git Commit 68930f8, Kernel Git Commit 6e271f0, Kernel Git Commit 798a61e, Kernel Git Commit 87ce4b5, and Kernel Git Commit c251ed4.
Workarounds
- Set sysctl kernel.unprivileged_bpf_disabled=1 to block unprivileged BPF usage until patches land.
- Deny or restrict CAP_BPF and CAP_SYS_ADMIN for container and sandbox workloads that do not require BPF.
- Disable BPF link iteration surfaces by removing read access to BPF iterator file descriptors from untrusted users.
# Disable unprivileged BPF system-wide
sysctl -w kernel.unprivileged_bpf_disabled=1
echo 'kernel.unprivileged_bpf_disabled=1' >> /etc/sysctl.d/99-bpf-hardening.conf
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

