{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2026-31413",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2026-31413"
  ],
  "published": "2026-04-12T05:36:32Z",
  "summary": "bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR\n\nmaybe_fork_scalars() is called for both BPF_AND and BPF_OR when the\nsource operand is a constant.  When dst has signed range [-1, 0], it\nforks the verifier state: the pushed path gets dst = 0, the current\npath gets dst = -1.\n\nFor BPF_AND this is correct: 0 & K == 0.\nFor BPF_OR this is wrong:    0 | K == K, not 0.\n\nThe pushed path therefore tracks dst as 0 when the runtime value is K,\nproducing an exploitable verifier/runtime divergence that allows\nout-of-bounds map access.\n\nFix this by passing env->insn_idx (instead of env->insn_idx + 1) to\npush_stack(), so the pushed path re-executes the ALU instruction with\ndst = 0 and naturally computes the correct result for any opcode.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.12.75-1+rpt1~bookworm"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.12.75+rpt-rpi-2712",
            "binary_version": "1:6.12.75-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.75+rpt-rpi-v6",
            "binary_version": "1:6.12.75-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.75+rpt-rpi-v7",
            "binary_version": "1:6.12.75-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.75+rpt-rpi-v7l",
            "binary_version": "1:6.12.75-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.75+rpt-rpi-v8",
            "binary_version": "1:6.12.75-1+rpt1~bookworm"
          },
          {
            "binary_name": "linux-image-6.12.75+rpt-rpi-v8-rt",
            "binary_version": "1:6.12.75-1+rpt1~bookworm"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.12.75-1+rpt1~bookworm": {
            "linux_commit": "89050b1059997d38d55462b323b099a6436dc10d",
            "upstream_version": "6.12.75",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.80"
          }
        }
      }
    },
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:13",
        "name": "linux"
      },
      "versions": [
        "1:6.12.75-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.12.75+rpt-rpi-2712",
            "binary_version": "1:6.12.75-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.75+rpt-rpi-v6",
            "binary_version": "1:6.12.75-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.75+rpt-rpi-v7",
            "binary_version": "1:6.12.75-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.75+rpt-rpi-v8",
            "binary_version": "1:6.12.75-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.12.75+rpt-rpi-v8-rt",
            "binary_version": "1:6.12.75-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.12.75-1+rpt1": {
            "linux_commit": "89050b1059997d38d55462b323b099a6436dc10d",
            "upstream_version": "6.12.75",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.12.80"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2026-31413"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/342aa1ee995ef5bbf876096dc3a5e51218d76fa4"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/58bd87d0e69204dbd739e4387a1edb0c4b1644e7"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d13281ae7ea8902b21d99d10a2c8caf0bdec0455"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/c845894ebd6fb43226b3118d6b017942550910c5"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T13:16:28Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerable verifier path is reached through the local bpf() syscall during BPF_PROG_LOAD, not through a remote protocol. A plausible path is an attacker-supplied socket-filter BPF program using attacker-created maps.\nAC:L - The attacker controls the BPF bytecode, map layout, and scalar values needed to trigger the verifier/runtime divergence. There is no race or external condition beyond attacker control.\nPR:L - Exploitation requires a local user able to load BPF programs, which can be a basic unprivileged user where unprivileged BPF is enabled or a delegated BPF capability path exists. It does not inherently require real init-namespace root for the vulnerable verifier logic.\nUI:N - No victim action is required after the attacker loads and runs the crafted BPF program. The trigger is fully under the local attacker's control.\nS:U - This is a standard kernel privilege-escalation style BPF verifier flaw within the same host kernel security authority. It does not cross a VM, hypervisor, or IOMMU boundary.\nC:H - The verifier/runtime divergence allows out-of-bounds map-value reads, which can expose adjacent kernel heap data and be developed into broader kernel memory disclosure. BPF verifier OOB map-access bugs are commonly exploitable as kernel read primitives.\nI:H - The same incorrect bounds reasoning can be applied to writes through map-value pointers, enabling out-of-bounds kernel heap corruption. That is sufficient for arbitrary kernel memory modification or code execution in a defensible worst case.\nA:H - Out-of-bounds BPF memory access can corrupt kernel memory or fault the kernel, causing an oops, panic, or hang. Even failed exploitation can be repeatedly triggered by the local attacker."
    }
  }
}
