Skip to main content
Vulnerability Database/CVE-2026-98588

CVE-2026-98588: Linux Kernel Privilege Escalation Vulnerability

CVE-2026-98588 is a privilege escalation flaw in the Linux kernel BPF sockmap that allows integer overflow leading to out-of-bounds memory writes. This post covers technical details, affected versions, and remediation.

Published:

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-98588 Overview

CVE-2026-98588 is a Linux kernel vulnerability in the Berkeley Packet Filter (BPF) sockmap subsystem. The flaw resides in sock_map_alloc(), which fails to reject max_entries values greater than INT_MAX. When a SOCKMAP is created with max_entries = 0xffffffff, a signed integer iterator in sock_map_free() wraps to INT_MIN, producing a large negative offset into the allocated sks[] array. The resulting out-of-bounds write faults on an unmapped vmalloc page or corrupts an unrelated kernel allocation. The issue was discovered through syzkaller fuzzing and reproduced on both a 6.6-based KASAN kernel and the upstream v7.3-rc2 kernel.

Critical Impact

A local user with permission to create BPF maps can trigger a kernel out-of-bounds write, leading to denial of service or potential memory corruption on large-memory hosts.

Affected Products

  • Linux kernel BPF sockmap subsystem
  • Confirmed on 6.6-based kernels with KASAN enabled
  • Confirmed on upstream Linux kernel v7.3-rc2

Discovery Timeline

  • 2026-10-18 - CVE-2026-98588 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-98588

Vulnerability Analysis

The vulnerability is an integer overflow leading to an out-of-bounds write [CWE-190, CWE-787] in the Linux kernel BPF sockmap implementation. sock_map_alloc() validates only that max_entries != 0 and accepts any other u32 value. On systems with enough memory, allocating 32 GiB for stab->sks can succeed with max_entries = UINT_MAX.

During teardown, sock_map_free() iterates the socket array using a signed int:

int i;
for (i = 0; i < stab->map.max_entries; i++)
struct sock **psk = &stab->sks[i];

Once the counter reaches 0x80000000, it wraps to INT_MIN. The movslq sign-extension produces a roughly 16 GiB negative offset from stab->sks, and the xchg() write targets memory far below the original allocation.

On kernels built with CONFIG_KASAN_VMALLOC=y, the shadow check in kasan_check_range faults first on an unmapped shadow page, producing a page-fault oops in sock_map_free+0x93/0x190. Without KASAN, the same path can silently corrupt neighboring vmalloc memory.

Root Cause

sock_map_alloc() previously bounded allocation size through bpf_map_charge_init(), but that upper bound was removed when rlimit-based memory accounting was retired. No replacement validation was added, allowing max_entries values that overflow the signed iterator used during cleanup.

Attack Vector

A local attacker with the capability to invoke the bpf(BPF_MAP_CREATE) syscall for a BPF_MAP_TYPE_SOCKMAP creates a map with max_entries = 0xffffffff. Any subsequent destruction path, either an explicit close() triggering bpf_map_free_deferred() or the error path within map_create(), reaches sock_map_free() and triggers the out-of-bounds write. Vmcore analysis confirmed stab->map.max_entries == 0xffffffff and the faulting address at sks + (s64)INT_MIN * 8.

Detection Methods for CVE-2026-98588

Indicators of Compromise

  • Kernel oops referencing sock_map_free in the call trace, often preceded by kasan_check_range on KASAN-enabled builds
  • Page-fault messages for high canonical addresses such as fffff521b59c5a00 originating from BPF map destruction
  • Unexpected kernel panics correlated with processes invoking bpf(BPF_MAP_CREATE) for sockmap types

Detection Strategies

  • Audit bpf() syscalls and flag BPF_MAP_CREATE calls where map_type is BPF_MAP_TYPE_SOCKMAP or BPF_MAP_TYPE_SOCKHASH with max_entries > INT_MAX
  • Enable kernel auditing (auditd) rules on the bpf syscall to retain evidence of suspicious map creation parameters
  • Correlate kernel log entries containing sock_map_free with the originating process via dmesg and journalctl

Monitoring Recommendations

  • Monitor for unprivileged or containerized workloads invoking the bpf() syscall; restrict via CAP_BPF and CAP_SYS_ADMIN policy
  • Watch for repeated kernel oops events on hosts with large physical memory, which are the only systems where the 32 GiB allocation can succeed
  • Ingest kernel audit and syslog telemetry into a centralized data lake for retrospective hunting across the fleet

How to Mitigate CVE-2026-98588

Immediate Actions Required

  • Apply the upstream kernel patches referenced below and reboot affected hosts
  • Restrict access to the bpf() syscall using seccomp profiles or by dropping CAP_BPF from untrusted workloads
  • On container platforms, ensure default seccomp policies block bpf() for non-privileged pods

Patch Information

The fix rejects max_entries > INT_MAX at creation time in sock_map_alloc(), preventing the signed iterator from ever observing an overflowing value. Backports are available in the following stable commits:

Workarounds

  • Disable unprivileged BPF by setting kernel.unprivileged_bpf_disabled = 1 via sysctl
  • Apply a seccomp filter that denies bpf(BPF_MAP_CREATE) for BPF_MAP_TYPE_SOCKMAP and BPF_MAP_TYPE_SOCKHASH from untrusted contexts
  • Where feasible, remove CAP_BPF and CAP_NET_ADMIN from workloads that do not require sockmap functionality
bash
# Configuration example
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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.