CVE-2025-22048 (GCVE-0-2025-22048)
Vulnerability from cvelistv5
Published
2025-04-16 14:12
Modified
2026-10-30 12:21
Summary
In the Linux kernel, the following vulnerability has been resolved: LoongArch: BPF: Don't override subprog's return value The verifier test `calls: div by 0 in subprog` triggers a panic at the ld.bu instruction. The ld.bu insn is trying to load byte from memory address returned by the subprog. The subprog actually set the correct address at the a5 register (dedicated register for BPF return values). But at commit 73c359d1d356 ("LoongArch: BPF: Sign-extend return values") we also sign extended a5 to the a0 register (return value in LoongArch). For function call insn, we later propagate the a0 register back to a5 register. This is right for native calls but wrong for bpf2bpf calls which expect zero-extended return value in a5 register. So only move a0 to a5 for native calls (i.e. non-BPF_PSEUDO_CALL).
Impacted products
Vendor Product Version
Linux Linux Version: 8382e92f90b601acf6d426121e6f4991502e767d
Version: 0c8d50501bc13cacecc19caaddc10db372592a39
Version: d5d83242a1d778ceb6d8b07c6b491cf7483ca112
Version: 73c359d1d356cf10236ccd358bd55edab33e9424
Version: 73c359d1d356cf10236ccd358bd55edab33e9424
Version: 73c359d1d356cf10236ccd358bd55edab33e9424
Version: 3b75f627b73d96787a493e2f1187543ba9c056a4
Version: 6.1.120   ≤
Version: 6.6.64   ≤
Version: 6.12.2   ≤
Version: 6.11.11   ≤
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "arch/loongarch/net/bpf_jit.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "d99845f672cce0b610f7c51248ef95d7df63927e",
              "status": "affected",
              "version": "8382e92f90b601acf6d426121e6f4991502e767d",
              "versionType": "git"
            },
            {
              "lessThan": "7df2696256a034405d3c5a71b3a4c54725de4404",
              "status": "affected",
              "version": "0c8d50501bc13cacecc19caaddc10db372592a39",
              "versionType": "git"
            },
            {
              "lessThan": "223d565d8892481684091cfbaf3466f2b0e289d3",
              "status": "affected",
              "version": "d5d83242a1d778ceb6d8b07c6b491cf7483ca112",
              "versionType": "git"
            },
            {
              "lessThan": "780628a780b622759d9e5adc76d15432144da1a3",
              "status": "affected",
              "version": "73c359d1d356cf10236ccd358bd55edab33e9424",
              "versionType": "git"
            },
            {
              "lessThan": "996e90ab446641553e8e21707b38b9709605e0e0",
              "status": "affected",
              "version": "73c359d1d356cf10236ccd358bd55edab33e9424",
              "versionType": "git"
            },
            {
              "lessThan": "60f3caff1492e5b8616b9578c4bedb5c0a88ed14",
              "status": "affected",
              "version": "73c359d1d356cf10236ccd358bd55edab33e9424",
              "versionType": "git"
            },
            {
              "status": "affected",
              "version": "3b75f627b73d96787a493e2f1187543ba9c056a4",
              "versionType": "git"
            },
            {
              "lessThan": "6.1.191",
              "status": "affected",
              "version": "6.1.120",
              "versionType": "semver"
            },
            {
              "lessThan": "6.6.87",
              "status": "affected",
              "version": "6.6.64",
              "versionType": "semver"
            },
            {
              "lessThan": "6.12.23",
              "status": "affected",
              "version": "6.12.2",
              "versionType": "semver"
            },
            {
              "lessThan": "6.12",
              "status": "affected",
              "version": "6.11.11",
              "versionType": "semver"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "arch/loongarch/net/bpf_jit.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.13"
            },
            {
              "lessThan": "6.13",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.191",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.87",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.23",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.13.*",
              "status": "unaffected",
              "version": "6.13.11",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.14.*",
              "status": "unaffected",
              "version": "6.14.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.15",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.191",
                  "versionStartIncluding": "6.1.120",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.87",
                  "versionStartIncluding": "6.6.64",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.23",
                  "versionStartIncluding": "6.12.2",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.13.11",
                  "versionStartIncluding": "6.13",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.14.2",
                  "versionStartIncluding": "6.13",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.15",
                  "versionStartIncluding": "6.13",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionStartIncluding": "6.11.11",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: BPF: Don\u0027t override subprog\u0027s return value\n\nThe verifier test `calls: div by 0 in subprog` triggers a panic at the\nld.bu instruction. The ld.bu insn is trying to load byte from memory\naddress returned by the subprog. The subprog actually set the correct\naddress at the a5 register (dedicated register for BPF return values).\nBut at commit 73c359d1d356 (\"LoongArch: BPF: Sign-extend return values\")\nwe also sign extended a5 to the a0 register (return value in LoongArch).\nFor function call insn, we later propagate the a0 register back to a5\nregister. This is right for native calls but wrong for bpf2bpf calls\nwhich expect zero-extended return value in a5 register. So only move a0\nto a5 for native calls (i.e. non-BPF_PSEUDO_CALL)."
        }
      ],
      "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 - Exploitation requires loading a JITed eBPF program containing a bpf2bpf subprog call via the bpf() syscall on the local system. Per kernel scoring guidance, BPF is a Local attack vector.\nAC:L - The miscompilation is deterministic \u2014 every bpf2bpf call site in a JITed program on LoongArch unconditionally clobbers R0 with the sign-extended low 32 bits, with no race, timing, or memory-layout precondition for the corruption itself. The attacker fully controls the program text, the returned pointer type, and the dereference offset.\nPR:L - Loading a subprog-containing SOCKET_FILTER/CGROUP_SKB program needs no capability at all when kernel.unprivileged_bpf_disabled=0, a supported and widely-deployed setting (and the default when CONFIG_BPF_UNPRIV_DEFAULT_OFF=n, common on vendor/embedded LoongArch kernels). Otherwise only CAP_BPF is required, which is by design not root-equivalent and is exactly the low-privilege principal the verifier is supposed to contain.\nUI:N - The attacker loads the program and triggers it entirely on their own \u2014 e.g. attaching a socket filter to their own socket and sending a loopback packet. No victim action is involved.\nS:U - The corruption and its consequences are confined to the kernel\u0027s own security authority; there is no VM, IOMMU, or sandbox boundary crossed. This is standard in-kernel privilege escalation territory.\nC:H - The caller dereferences a verifier-blessed but JIT-corrupted pointer, giving a BPF_LDX read at an attacker-influenced wild address that can land in mapped kernel memory (vmemmap/KFENCE region for bit31-set values); the loaded bytes can be stashed into a BPF map and read out from userspace, yielding kernel memory disclosure.\nI:H - The identical primitive works in the store direction \u2014 BPF_STX/BPF_ST through the corrupted R0 writes fully attacker-controlled 8-byte values at an attacker-chosen displacement, an out-of-bounds kernel write leverageable for control-flow hijacking.\nA:H - The upstream commit documents a confirmed kernel panic at the ld.bu instruction from the in-tree verifier test, and the wild-pointer dereference reliably oopses whenever the corrupted address is unmapped."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-10-30T12:21:09.247Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/d99845f672cce0b610f7c51248ef95d7df63927e"
        },
        {
          "url": "https://git.kernel.org/stable/c/7df2696256a034405d3c5a71b3a4c54725de4404"
        },
        {
          "url": "https://git.kernel.org/stable/c/223d565d8892481684091cfbaf3466f2b0e289d3"
        },
        {
          "url": "https://git.kernel.org/stable/c/780628a780b622759d9e5adc76d15432144da1a3"
        },
        {
          "url": "https://git.kernel.org/stable/c/996e90ab446641553e8e21707b38b9709605e0e0"
        },
        {
          "url": "https://git.kernel.org/stable/c/60f3caff1492e5b8616b9578c4bedb5c0a88ed14"
        }
      ],
      "title": "LoongArch: BPF: Don\u0027t override subprog\u0027s return value",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-22048",
    "datePublished": "2025-04-16T14:12:07.679Z",
    "dateReserved": "2024-12-29T08:45:45.810Z",
    "dateUpdated": "2026-10-30T12:21:09.247Z",
    "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…