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

bpf, sockmap: Reject max_entries > INT_MAX in sock_map_alloc

sock_map_alloc() only rejects max_entries == 0 and otherwise allows any
u32 value. sock_map_free() then walks the sks[] array with a signed int
iterator:

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

When a SOCKMAP is created with max_entries = 0xffffffff (UINT_MAX), the
allocation of 32 GiB can succeed on large-memory hosts. During free the
counter reaches 0x80000000, wraps to INT_MIN, is sign-extended by movslq
and turned into a ~16 GiB negative offset from stab->sks, pointing far
below the allocation.

The faulting access is an xchg() write in sock_map_free(). Without
KASAN, the same out-of-bounds write can fault on an unmapped vmalloc page
or corrupt an unrelated allocation if that vmalloc address is populated.
On a KASAN kernel with CONFIG_KASAN_VMALLOC=y, the shadow check for that
address hits an unmapped shadow page and oopses first:

BUG: unable to handle page fault for address: fffff521b59c5a00
RIP: 0010:kasan_check_range+0x107/0x190
Call Trace:
sock_map_free+0x93/0x190
map_create+0x68d/0xb30
__sys_bpf+0x21e/0x2e70

Vmcore confirmed stab->map.max_entries == 0xffffffff, stab->sks ==
0xffffc911ace2d000, and the faulting address sks + (s64)INT_MIN * 8
exactly at 0xffffc90dace2d000. The same buggy path is reached on the
normal close()/bpf_map_free_deferred() path whenever such a map is
destroyed.

sock_map_alloc() used to bound its allocation size through
bpf_map_charge_init(), but the bound was dropped when rlimit-based memory
accounting was removed. Reject max_entries > INT_MAX at creation time so
the signed iterator in sock_map_free() never sees a value that would
overflow.

Triggered by syzkaller and reproduced on both a 6.6-based KASAN kernel
and the upstream v7.3-rc2 kernel.
Published: 2026-10-18
Score: 4.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Kernel memory corruption
Action: Patch immediately
AI Analysis

Impact

In the Linux kernel, sock_map_alloc() accepts any unsigned 32‑bit value for the sockmap size (max_entries) without enforcing an upper bound of INT_MAX. When a map is created with max_entries set to 0xffffffff, the kernel may allocate several gigabytes of memory. The free routine sock_map_free() iterates over the allocated array with a signed 32‑bit counter; as the counter overflows, it writes to a negative offset far outside the bounds of the allocation, causing an out‑of‑bounds write that can corrupt arbitrary kernel memory or trigger a crash.

Affected Systems

All Linux kernel releases that do not yet include the patch adding the INT_MAX check on sock_map_alloc® are affected. The vulnerability applies to the core kernel code handling BPF sockmaps and is thus relevant to any payload that can load a BPF program to create such a map.

Risk and Exploitability

The flaw is a classic out‑of‑bounds memory write (CWE-124) stemming from an unchecked integer overflow. Exploitation requires the ability to load a BPF program and specify a sockmap size exceeding INT_MAX, a capability that is normally restricted to privileged users or applications with BPF access. The direct impact is memory corruption, which could lead to a kernel panic or arbitrary data modification; however, the CVSS score of 4.1 and the EPSS score of <1% suggest a low likelihood of exploitation. The vulnerability is not listed in CISA’s KEV catalog.

Generated by OpenCVE AI on October 22, 2026 at 21:53 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply a kernel update that includes the check limiting sock_map_alloc() to a maximum of INT_MAX entries
  • Ensure that BPF programs cannot create sockmaps larger than INT_MAX by enforcing policy or tightening BPF capabilities
  • Monitor kernel logs for BPF‑related crashes or out‑of‑bounds writes and configure alerts to detect potential exploitation attempts

Generated by OpenCVE AI on October 22, 2026 at 21:53 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4850-1 linux-6.12 security update
Ubuntu USN Ubuntu USN USN-8961-1 Linux kernel vulnerabilities
History

Tue, 20 Oct 2026 20:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-122
CWE-680

Tue, 20 Oct 2026 12:45:00 +0000

Type Values Removed Values Added
Weaknesses CWE-124
References
Metrics threat_severity

None

cvssV3_1

{'score': 4.1, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate


Sun, 18 Oct 2026 19:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-122
CWE-680

Sun, 18 Oct 2026 15:30:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf, sockmap: Reject max_entries > INT_MAX in sock_map_alloc sock_map_alloc() only rejects max_entries == 0 and otherwise allows any u32 value. sock_map_free() then walks the sks[] array with a signed int iterator: int i; for (i = 0; i < stab->map.max_entries; i++) struct sock **psk = &stab->sks[i]; When a SOCKMAP is created with max_entries = 0xffffffff (UINT_MAX), the allocation of 32 GiB can succeed on large-memory hosts. During free the counter reaches 0x80000000, wraps to INT_MIN, is sign-extended by movslq and turned into a ~16 GiB negative offset from stab->sks, pointing far below the allocation. The faulting access is an xchg() write in sock_map_free(). Without KASAN, the same out-of-bounds write can fault on an unmapped vmalloc page or corrupt an unrelated allocation if that vmalloc address is populated. On a KASAN kernel with CONFIG_KASAN_VMALLOC=y, the shadow check for that address hits an unmapped shadow page and oopses first: BUG: unable to handle page fault for address: fffff521b59c5a00 RIP: 0010:kasan_check_range+0x107/0x190 Call Trace: sock_map_free+0x93/0x190 map_create+0x68d/0xb30 __sys_bpf+0x21e/0x2e70 Vmcore confirmed stab->map.max_entries == 0xffffffff, stab->sks == 0xffffc911ace2d000, and the faulting address sks + (s64)INT_MIN * 8 exactly at 0xffffc90dace2d000. The same buggy path is reached on the normal close()/bpf_map_free_deferred() path whenever such a map is destroyed. sock_map_alloc() used to bound its allocation size through bpf_map_charge_init(), but the bound was dropped when rlimit-based memory accounting was removed. Reject max_entries > INT_MAX at creation time so the signed iterator in sock_map_free() never sees a value that would overflow. Triggered by syzkaller and reproduced on both a 6.6-based KASAN kernel and the upstream v7.3-rc2 kernel.
Title bpf, sockmap: Reject max_entries > INT_MAX in sock_map_alloc
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-10-19T09:22:13.833Z

Reserved: 2026-09-25T10:25:14.358Z

Link: CVE-2026-98588

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-18T16:17:11.393

Modified: 2026-10-19T10:19:19.777

Link: CVE-2026-98588

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-10-18T00:00:00Z

Links: CVE-2026-98588 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-22T22:00:15Z

Weaknesses
  • CWE-124

    Buffer Underwrite ('Buffer Underflow')