CVE-2026-74371 (GCVE-0-2026-74371)
Vulnerability from cvelistv5
Published
2026-08-15 05:58
Modified
2026-08-17 05:46
Summary
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.
Impacted products
Vendor Product Version
Linux Linux Version: 1209339844601ec1766f4ff430673fbcfe42bb51
Version: 1209339844601ec1766f4ff430673fbcfe42bb51
Version: 1209339844601ec1766f4ff430673fbcfe42bb51
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "include/linux/bpf-cgroup.h",
            "kernel/bpf/cgroup.c",
            "kernel/bpf/syscall.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "a7131340d0f95df9a541257dccab5d85e6bcdd2b",
              "status": "affected",
              "version": "1209339844601ec1766f4ff430673fbcfe42bb51",
              "versionType": "git"
            },
            {
              "lessThan": "d3d630e8a7f3421bc2d204b87bdff35b4432a8e3",
              "status": "affected",
              "version": "1209339844601ec1766f4ff430673fbcfe42bb51",
              "versionType": "git"
            },
            {
              "lessThan": "21c4b99b27f3f85b89256e81b3e997dec0a460d0",
              "status": "affected",
              "version": "1209339844601ec1766f4ff430673fbcfe42bb51",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "include/linux/bpf-cgroup.h",
            "kernel/bpf/cgroup.c",
            "kernel/bpf/syscall.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.17"
            },
            {
              "lessThan": "6.17",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.18.*",
              "status": "unaffected",
              "version": "6.18.40",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "7.1.*",
              "status": "unaffected",
              "version": "7.1.5",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "7.2",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18.40",
                  "versionStartIncluding": "6.17",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "7.1.5",
                  "versionStartIncluding": "6.17",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "7.2",
                  "versionStartIncluding": "6.17",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: fix BPF_PROG_QUERY OOB write and cgroup backward compat\n\nBPF_PROG_QUERY writes back the \u0027query.revision\u0027 field unconditionally to\nuserspace. If userspace passes a smaller \u0027bpf_attr\u0027 structure (e.g. 40\nbytes, which was the layout before the addition of \u0027query.revision\u0027),\nthe kernel performs an out-of-bounds write.\n\nFix this by propagating the user-provided attribute size \u0027uattr_size\u0027\ndown to the cgroup query handlers, and conditionally skipping writing\nthe revision field to userspace when the provided buffer size is\ninsufficient.\n\nquery.revision in bpf_mprog_query is structurally identical to the\ncgroup case: a late tail field, written unconditionally.\n\nBut the backward-compat hazard is not the same.\n\nThe min-historical-size test is per command, and bpf_mprog_query only\nserves attach types that were born with revision in the struct:\n\n- tcx_prog_query -\u003e BPF_TCX_INGRESS/EGRESS\n- netkit_prog_query -\u003e BPF_NETKIT_PRIMARY/PEER\n\ntcx, netkit, the revision field, and bpf_mprog_query itself all landed in\nthe same v6.6 merge window (053c8e1f235d added the mprog query API +\nrevision; tcx in e420bed02507, netkit in 35dfaad7188c). There has never\nbeen a tcx/netkit BPF_PROG_QUERY userspace that doesn\u0027t know about\nrevision. So for these commands the minimum legitimate struct already\ncovers offset 56-64 \u2014 no old binary can be broken here.\n\nContrast with cgroup: BPF_PROG_QUERY on cgroup attach types shipped in\n2017; revision write-back was bolted on years later (120933984460). That\npath has a real population of pre-revision callers."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The flaw is reached only through the bpf(2) syscall BPF_PROG_QUERY command on cgroup attach types via __sys_bpf()\u2192bpf_prog_query()\u2192cgroup_bpf_prog_query(); per kernel CNA guidance BPF/tc/netlink paths are Local, not Network.\nAC:L - The attacker fully controls the bpf_attr buffer, its declared size (e.g. 40 bytes pre-revision), placement in memory, cgroup2 target_fd, and attach_type; passing a short size reliably triggers the 8-byte revision copy_to_user at offset 56 with no race or external precondition.\nPR:L - bpf_prog_query() enforces bpf_net_capable(), requiring CAP_NET_ADMIN or CAP_SYS_ADMIN; both are delegable and obtainable inside an unprivileged user namespace (unshare -Urn) on typical distributions, so this is Low rather than init-namespace administrator.\nUI:N - Exploitation requires only the attacker\u0027s own bpf(BPF_PROG_QUERY) syscall (or an auto-invoked legacy-sized query after kernel upgrade); no separate victim mount, file open, or interactive action is needed.\nS:U - copy_to_user() writes past the caller-supplied userspace buffer boundary, corrupting adjacent mappings in the calling process; it does not corrupt kernel heap/slab memory or cross VM, IOMMU, or container-to-host security boundaries.\nC:H - The kernel performs an out-of-bounds 8-byte write past the declared bpf_attr size; per CNA guidance any such memory corruption can be leveraged for information disclosure via adjacent userspace secrets, not merely a bounded metadata leak.\nI:H - The unconditional copy_to_user of query.revision at offset 56 when size is below offsetofend(revision) is an out-of-bounds write of up to 8 bytes (revision value partly influenced by prior cgroup BPF attach/detach), enabling userspace heap/stack corruption and potential code execution.\nA:H - The OOB write can crash or hang privileged BPF/cgroup management daemons (containerd, Cilium, kubelet) still issuing legacy-sized BPF_PROG_QUERY after a 6.17+ upgrade, and malicious CAP_NET_ADMIN callers can repeatedly corrupt adjacent mappings to induce process termination."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-17T05:46:26.445Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/a7131340d0f95df9a541257dccab5d85e6bcdd2b"
        },
        {
          "url": "https://git.kernel.org/stable/c/d3d630e8a7f3421bc2d204b87bdff35b4432a8e3"
        },
        {
          "url": "https://git.kernel.org/stable/c/21c4b99b27f3f85b89256e81b3e997dec0a460d0"
        }
      ],
      "title": "bpf: fix BPF_PROG_QUERY OOB write and cgroup backward compat",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2026-74371",
    "datePublished": "2026-08-15T05:58:51.610Z",
    "dateReserved": "2026-08-15T05:44:03.889Z",
    "dateUpdated": "2026-08-17T05:46:26.445Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…