GCVE Workshop - 22 September 2026 (14:00-18:00), Luxembourg Before The Vulnopticon Conference - Registration

CVE-2025-40169 (GCVE-0-2025-40169)

Vulnerability from cvelistv5 – Published: 2025-11-12 10:46 – Updated: 2026-08-05 12:08
VLAI
Title
bpf: Reject negative offsets for ALU ops
Summary
In the Linux kernel, the following vulnerability has been resolved: bpf: Reject negative offsets for ALU ops When verifying BPF programs, the check_alu_op() function validates instructions with ALU operations. The 'offset' field in these instructions is a signed 16-bit integer. The existing check 'insn->off > 1' was intended to ensure the offset is either 0, or 1 for BPF_MOD/BPF_DIV. However, because 'insn->off' is signed, this check incorrectly accepts all negative values (e.g., -1). This commit tightens the validation by changing the condition to '(insn->off != 0 && insn->off != 1)'. This ensures that any value other than the explicitly permitted 0 and 1 is rejected, hardening the verifier against malformed BPF programs.
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: ec0e2da95f72d4a46050a4d994e4fe471474fd80 , < 3bce44b344040e5eef3d64d38b157c15304c0aab (git)
Affected: ec0e2da95f72d4a46050a4d994e4fe471474fd80 , < 5017c302ca4b2a45149ad64e058fa2d5623c068f (git)
Affected: ec0e2da95f72d4a46050a4d994e4fe471474fd80 , < 21167bf70dbe400563e189ac632258d35eda38b5 (git)
Affected: ec0e2da95f72d4a46050a4d994e4fe471474fd80 , < 55c0ced59fe17dee34e9dfd5f7be63cbab207758 (git)
guessed Create a notification for this product.
Linux Linux Affected: 6.6
Unaffected: 0 , < 6.6 (semver)
Unaffected: 6.6.112 , ≤ 6.6.* (semver)
Unaffected: 6.12.53 , ≤ 6.12.* (semver)
Unaffected: 6.17.3 , ≤ 6.17.* (semver)
Unaffected: 6.18 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "kernel/bpf/verifier.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "3bce44b344040e5eef3d64d38b157c15304c0aab",
              "status": "affected",
              "version": "ec0e2da95f72d4a46050a4d994e4fe471474fd80",
              "versionType": "git"
            },
            {
              "lessThan": "5017c302ca4b2a45149ad64e058fa2d5623c068f",
              "status": "affected",
              "version": "ec0e2da95f72d4a46050a4d994e4fe471474fd80",
              "versionType": "git"
            },
            {
              "lessThan": "21167bf70dbe400563e189ac632258d35eda38b5",
              "status": "affected",
              "version": "ec0e2da95f72d4a46050a4d994e4fe471474fd80",
              "versionType": "git"
            },
            {
              "lessThan": "55c0ced59fe17dee34e9dfd5f7be63cbab207758",
              "status": "affected",
              "version": "ec0e2da95f72d4a46050a4d994e4fe471474fd80",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "kernel/bpf/verifier.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.6"
            },
            {
              "lessThan": "6.6",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.112",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.53",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.17.*",
              "status": "unaffected",
              "version": "6.17.3",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.18",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.112",
                  "versionStartIncluding": "6.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.53",
                  "versionStartIncluding": "6.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17.3",
                  "versionStartIncluding": "6.6",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18",
                  "versionStartIncluding": "6.6",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Reject negative offsets for ALU ops\n\nWhen verifying BPF programs, the check_alu_op() function validates\ninstructions with ALU operations. The \u0027offset\u0027 field in these\ninstructions is a signed 16-bit integer.\n\nThe existing check \u0027insn-\u003eoff \u003e 1\u0027 was intended to ensure the offset is\neither 0, or 1 for BPF_MOD/BPF_DIV. However, because \u0027insn-\u003eoff\u0027 is\nsigned, this check incorrectly accepts all negative values (e.g., -1).\n\nThis commit tightens the validation by changing the condition to\n\u0027(insn-\u003eoff != 0 \u0026\u0026 insn-\u003eoff != 1)\u0027. This ensures that any value\nother than the explicitly permitted 0 and 1 is rejected, hardening the\nverifier against malformed BPF programs."
        }
      ],
      "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 vulnerable code is reached through the local `bpf(BPF_PROG_LOAD)` syscall, which invokes `bpf_check()` \u2192 `do_check()` \u2192 `check_alu_op()`. Although the resulting program later executes on packet receive, loading the malformed instruction requires local system access.\nAC:L - Exploitation is fully deterministic: emit a `BPF_DIV`/`BPF_MOD` instruction with `off = -1`, set the dividend to `LLONG_MIN` and the divisor to `-1`, and run it. There is no race, no timing window, and no dependence on memory layout or system state the attacker cannot control.\nPR:L - `sysctl_unprivileged_bpf_disabled` defaults to 0 unless `CONFIG_BPF_UNPRIV_DEFAULT_OFF` is built in (Android and many embedded/distro configs leave it enabled), and `kernel/bpf/syscall.c:2941` explicitly permits `BPF_PROG_TYPE_SOCKET_FILTER` and `BPF_PROG_TYPE_CGROUP_SKB` loads with no `bpf_cap`; the program is then triggered via `SO_ATTACH_BPF` on the attacker\u0027s own socket. Where unprivileged BPF is disabled, `bpf_token_capable()` grants `ns_capable()`-level CAP_BPF inside a delegated user namespace, so real root is never required.\nUI:N - The attacker loads and triggers the BPF program entirely on their own, by attaching it to a socket they own and sending themselves a packet. No victim action of any kind is involved.\nS:U - The verifier bypass, the JIT\u0027d signed division, and the resulting fault all occur within the kernel\u0027s own security authority. No VM, IOMMU, or hypervisor boundary is crossed.\nC:H - On the s390 JIT the `switch (off)` in the DIV/MOD handlers has no default, so no divide instruction is emitted while the trailing `lgr %dst,%rc` still executes, copying the uninitialized kernel scratch register `%r0`/`%r1` \u2014 potentially a kernel pointer \u2014 into a BPF register that the program can write to a map and read from userspace, repeatably and at attacker-chosen program points. The x86 divide-error oops additionally dumps full register and stack state, defeating KASLR.\nI:H - The verifier accepts an instruction whose runtime semantics it never models \u2014 the JIT executes a signed division while the fixup layer applies only the unsigned guards, and on s390 uncontrolled kernel register contents are injected into verified program state. This is a verifier validation bypass in which JIT-emitted code and the verifier\u0027s model of that code diverge, so integrity of the sandbox\u0027s guarantees is not preserved.\nA:H - Because `is_sdiv`/`is_smod` in `do_misc_fixups()` test `insn-\u003eoff == 1`, the `LLONG_MIN sdiv -1` overflow guards are skipped while the x86-64 JIT still emits `cqo; idiv`, producing a #DE with no exception-table entry \u2014 `do_trap()` reaches `die(\"divide error\")`, oopsing the kernel. Triggered from a socket-filter/tc/XDP program this fires in softirq context, yielding \"Fatal exception in interrupt\" and a full system panic."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:08:14.652Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/3bce44b344040e5eef3d64d38b157c15304c0aab"
        },
        {
          "url": "https://git.kernel.org/stable/c/5017c302ca4b2a45149ad64e058fa2d5623c068f"
        },
        {
          "url": "https://git.kernel.org/stable/c/21167bf70dbe400563e189ac632258d35eda38b5"
        },
        {
          "url": "https://git.kernel.org/stable/c/55c0ced59fe17dee34e9dfd5f7be63cbab207758"
        }
      ],
      "title": "bpf: Reject negative offsets for ALU ops",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-40169",
    "datePublished": "2025-11-12T10:46:51.736Z",
    "dateReserved": "2025-04-16T07:20:57.176Z",
    "dateUpdated": "2026-08-05T12:08:14.652Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-40169",
      "date": "2026-09-17",
      "epss": "0.00142",
      "percentile": "0.03917"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-40169\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-11-12T11:15:47.270\",\"lastModified\":\"2026-07-30T06:24:15.357\",\"vulnStatus\":\"Deferred\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbpf: Reject negative offsets for ALU ops\\n\\nWhen verifying BPF programs, the check_alu_op() function validates\\ninstructions with ALU operations. The \u0027offset\u0027 field in these\\ninstructions is a signed 16-bit integer.\\n\\nThe existing check \u0027insn-\u003eoff \u003e 1\u0027 was intended to ensure the offset is\\neither 0, or 1 for BPF_MOD/BPF_DIV. However, because \u0027insn-\u003eoff\u0027 is\\nsigned, this check incorrectly accepts all negative values (e.g., -1).\\n\\nThis commit tightens the validation by changing the condition to\\n\u0027(insn-\u003eoff != 0 \u0026\u0026 insn-\u003eoff != 1)\u0027. This ensures that any value\\nother than the explicitly permitted 0 and 1 is rejected, hardening the\\nverifier against malformed BPF programs.\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"programFiles\":[\"kernel/bpf/verifier.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"ec0e2da95f72d4a46050a4d994e4fe471474fd80\",\"lessThan\":\"3bce44b344040e5eef3d64d38b157c15304c0aab\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"ec0e2da95f72d4a46050a4d994e4fe471474fd80\",\"lessThan\":\"5017c302ca4b2a45149ad64e058fa2d5623c068f\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"ec0e2da95f72d4a46050a4d994e4fe471474fd80\",\"lessThan\":\"21167bf70dbe400563e189ac632258d35eda38b5\",\"versionType\":\"git\",\"status\":\"affected\"},{\"version\":\"ec0e2da95f72d4a46050a4d994e4fe471474fd80\",\"lessThan\":\"55c0ced59fe17dee34e9dfd5f7be63cbab207758\",\"versionType\":\"git\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"programFiles\":[\"kernel/bpf/verifier.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"6.6\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"6.6\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.6.112\",\"lessThanOrEqual\":\"6.6.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.12.53\",\"lessThanOrEqual\":\"6.12.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.17.3\",\"lessThanOrEqual\":\"6.17.*\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.18\",\"lessThanOrEqual\":\"*\",\"versionType\":\"original_commit_for_fix\",\"status\":\"unaffected\"}]}]}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9}]},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/21167bf70dbe400563e189ac632258d35eda38b5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/3bce44b344040e5eef3d64d38b157c15304c0aab\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/5017c302ca4b2a45149ad64e058fa2d5623c068f\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/55c0ced59fe17dee34e9dfd5f7be63cbab207758\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}",
    "redhat_vex": {
      "aggregate_severity": "Low",
      "current_release_date": "2026-07-30T10:08:09+00:00",
      "cve": "CVE-2025-40169",
      "id": "CVE-2025-40169",
      "initial_release_date": "2025-11-12T00:00:00+00:00",
      "product_status:known_affected": "184",
      "product_status:known_not_affected": "90",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: bpf: Reject negative offsets for ALU ops",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-40169.json",
      "version": "3"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…