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

bpf: fix BPF_PROG_QUERY OOB write and cgroup backward compat

BPF_PROG_QUERY writes back the 'query.revision' field unconditionally to
userspace. If userspace passes a smaller 'bpf_attr' structure (e.g. 40
bytes, which was the layout before the addition of 'query.revision'),
the kernel performs an out-of-bounds write.

Fix this by propagating the user-provided attribute size 'uattr_size'
down to the cgroup query handlers, and conditionally skipping writing
the revision field to userspace when the provided buffer size is
insufficient.

query.revision in bpf_mprog_query is structurally identical to the
cgroup case: a late tail field, written unconditionally.

But the backward-compat hazard is not the same.

The min-historical-size test is per command, and bpf_mprog_query only
serves attach types that were born with revision in the struct:

- tcx_prog_query -> BPF_TCX_INGRESS/EGRESS
- netkit_prog_query -> BPF_NETKIT_PRIMARY/PEER

tcx, netkit, the revision field, and bpf_mprog_query itself all landed in
the same v6.6 merge window (053c8e1f235d added the mprog query API +
revision; tcx in e420bed02507, netkit in 35dfaad7188c). There has never
been a tcx/netkit BPF_PROG_QUERY userspace that doesn't know about
revision. So for these commands the minimum legitimate struct already
covers offset 56-64 — no old binary can be broken here.

Contrast with cgroup: BPF_PROG_QUERY on cgroup attach types shipped in
2017; revision write-back was bolted on years later (120933984460). That
path has a real population of pre-revision callers.
Published: 2026-08-15
Score: 7.8 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

An out‑of‑bounds write occurs when the kernel processes a BPF_PROG_QUERY request. The kernel writes the "query.revision" field back to userspace without verifying that the supplied attribute structure is large enough. If an attacker passes a smaller structure, the kernel writes beyond the provided buffer, corrupting memory. Depending on the memory region overwritten, this flaw can allow an attacker to execute arbitrary code in the kernel, leading to privilege escalation or denial of service.

Affected Systems

The vulnerability affects any Linux kernel that implements the BPF_PROG_QUERY interface before the patch is applied, regardless of the distribution vendor. The affected code paths involve both the generic BPF query handling and the cgroup attach type query handlers. Since the patch was merged into the mainline kernel, all releases older than the commit that introduced the fix are potentially impacted.

Risk and Exploitability

The CVSS score of 7.8 classifies the vulnerability as High severity. The EPSS score is less than 1%, indicating a very low but nonzero probability of exploitation. The vulnerability is not listed in the CISA KEV catalog, so no known public exploits have been reported to date. The flaw allows an out‑of‑bounds write to kernel memory, which, if successfully targeted, could enable an attacker to execute arbitrary code in the kernel, leading to privilege escalation. The attack likely requires local code execution to craft a custom BPF program with an undersized attribute structure, but could also be achieved through a container or unprivileged process that interacts with the BPF subsystem. Given the lack of public exploits, the risk remains significant for systems that have not yet applied the kernel fix.

Generated by OpenCVE AI on August 21, 2026 at 23:49 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the patch from commit 21c4b99b27f3f85b89256e81b3e997dec0a460d0 or upgrade to a kernel that includes this commit.
  • Reboot the system to load the kernel with the patch applied.
  • Monitor distribution security advisories and schedule kernel updates in your regular patch management process.

Generated by OpenCVE AI on August 21, 2026 at 23:49 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 21 Aug 2026 00:15:00 +0000

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

None

threat_severity

Moderate


Mon, 17 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-120

Mon, 17 Aug 2026 13:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-787

Mon, 17 Aug 2026 06:00:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

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


Sat, 15 Aug 2026 13:45:00 +0000

Type Values Removed Values Added
Weaknesses CWE-787

Sat, 15 Aug 2026 06:15:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: bpf: fix BPF_PROG_QUERY OOB write and cgroup backward compat BPF_PROG_QUERY writes back the 'query.revision' field unconditionally to userspace. If userspace passes a smaller 'bpf_attr' structure (e.g. 40 bytes, which was the layout before the addition of 'query.revision'), the kernel performs an out-of-bounds write. Fix this by propagating the user-provided attribute size 'uattr_size' down to the cgroup query handlers, and conditionally skipping writing the revision field to userspace when the provided buffer size is insufficient. query.revision in bpf_mprog_query is structurally identical to the cgroup case: a late tail field, written unconditionally. But the backward-compat hazard is not the same. The min-historical-size test is per command, and bpf_mprog_query only serves attach types that were born with revision in the struct: - tcx_prog_query -> BPF_TCX_INGRESS/EGRESS - netkit_prog_query -> BPF_NETKIT_PRIMARY/PEER tcx, netkit, the revision field, and bpf_mprog_query itself all landed in the same v6.6 merge window (053c8e1f235d added the mprog query API + revision; tcx in e420bed02507, netkit in 35dfaad7188c). There has never been a tcx/netkit BPF_PROG_QUERY userspace that doesn't know about revision. So for these commands the minimum legitimate struct already covers offset 56-64 — no old binary can be broken here. Contrast with cgroup: BPF_PROG_QUERY on cgroup attach types shipped in 2017; revision write-back was bolted on years later (120933984460). That path has a real population of pre-revision callers.
Title bpf: fix BPF_PROG_QUERY OOB write and cgroup backward compat
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-08-17T05:46:26.445Z

Reserved: 2026-08-15T05:44:03.889Z

Link: CVE-2026-74371

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-15T06:22:38.857

Modified: 2026-08-17T06:19:31.903

Link: CVE-2026-74371

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-08-15T00:00:00Z

Links: CVE-2026-74371 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-22T00:00:16Z

Weaknesses
  • CWE-120

    Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

  • CWE-787

    Out-of-bounds Write