CVE-2026-90157

bpf: Reject negative optlen in cgroup getsockopt hook

Published Sep 17, 2026 CVSS n/a EPSS < 1% KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

bpf: Reject negative optlen in cgroup getsockopt hook

A cgroup getsockopt BPF program can shrink ctx->optlen after the
kernel getsockopt handler has run. The kernel-buffer variant, used by
TCP_ZEROCOPY_RECEIVE, only rejects values larger than the original
length.

If BPF writes a negative optlen, that value is accepted and propagated
back to the TCP getsockopt code. It can then be passed to
copy_to_sockptr() as a size_t and trigger the hardened usercopy
bytes > INT_MAX warning.

Reject negative ctx.optlen in __cgroup_bpf_run_filter_getsockopt_kern(),
matching the lower-bound validation already present in the sockptr-based
getsockopt hook.

Analysis

AI-generated

Technical impact

A BPF program attached to a cgroup getsockopt hook can reduce the optlen field after the kernel handler has executed. Because the kernel accepts negative optlen values, they are propagated to the TCP getsockopt path and ultimately cast to size_t for copy_to_sockptr(). This may trigger a hardened usercopy warning for bytes greater than INT_MAX and can potentially result in memory corruption or a failure of the hardened copy logic. The weakness involves improper input validation and length handling in kernel code.

Affected Systems

All Linux kernel builds are impacted because the vulnerability resides in the core BPF and getsockopt logic. Versions prior to the application of the patch that rejects negative optlen values are susceptible; specific version identifiers are not provided in the report.

Risk and Exploitability

The EPSS score is below 1% and the vulnerability is not listed in the CISA KEV catalog, indicating a low likelihood of exploitation at present. The attack requires delivery of a BPF program that runs in a cgroup getsockopt hook, which typically requires local or privileged access to load the program. Because the flaw involves kernel memory handling, successful exploitation could lead to privilege escalation or denial of service, but no publicly available exploits are known.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel patch that enforces non‑negative optlen values in __cgroup_bpf_run_filter_getsockopt_kern()
  • Limit the use of cgroup getsockopt BPF programs to trusted code, or avoid enabling the hook if not required
  • Configure the system to reject or quarantine untrusted BPF programs that target socket options

Generated by OpenCVE AI on September 20, 2026 at 01:54 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4817-1 linux-6.12 security update
Debian DLA Debian DLA DLA-4841-1 linux security update
Debian DSA Debian DSA DSA-6528-1 linux security update
Ubuntu USN Ubuntu USN USN-8961-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9019-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9020-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9022-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9023-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9024-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9025-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9026-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9029-1 Linux kernel (Raspberry Pi) vulnerabilities
Ubuntu USN Ubuntu USN USN-9039-1 Linux kernel (Azure CVM) vulnerabilities
Ubuntu USN Ubuntu USN USN-9040-1 Linux kernel (Low Latency NVIDIA) vulnerabilities
Ubuntu USN Ubuntu USN USN-9066-1 Linux kernel (HWE) vulnerabilities
Ubuntu USN Ubuntu USN USN-9091-1 Linux kernel (NVIDIA Tegra) vulnerabilities
Ubuntu USN Ubuntu USN USN-9160-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9183-1 Linux kernel (FIPS) vulnerabilities
History
Type Values Removed Values Added
Weaknesses CWE-119
CWE-20
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: Reject negative optlen in cgroup getsockopt hook A cgroup getsockopt BPF program can shrink ctx->optlen after the kernel getsockopt handler has run. The kernel-buffer variant, used by TCP_ZEROCOPY_RECEIVE, only rejects values larger than the original length. If BPF writes a negative optlen, that value is accepted and propagated back to the TCP getsockopt code. It can then be passed to copy_to_sockptr() as a size_t and trigger the hardened usercopy bytes > INT_MAX warning. Reject negative ctx.optlen in __cgroup_bpf_run_filter_getsockopt_kern(), matching the lower-bound validation already present in the sockptr-based getsockopt hook.
Title bpf: Reject negative optlen in cgroup getsockopt hook
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-119

    Improper Restriction of Operations within the Bounds of a Memory Buffer

  • CWE-20

    Improper Input Validation

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Oct 19, 2026, 8:58 AM
Reserved
Sep 11, 2026, 7:38 PM
Status
Received
Published
Sep 17, 2026, 5:17 PM
Modified
Oct 19, 2026, 9:19 AM