{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-22048",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2024-12-29T08:45:45.810Z",
        "datePublished": "2025-04-16T14:12:07.679Z",
        "dateUpdated": "2026-08-05T11:56:20.708Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T11:56:20.708Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nLoongArch: BPF: Don't override subprog's 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": {
                        "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"
                    },
                    "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 — 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 — 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's 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 — 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."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "arch/loongarch/net/bpf_jit.c"
                    ],
                    "versions": [
                        {
                            "version": "0c8d50501bc13cacecc19caaddc10db372592a39",
                            "lessThan": "7df2696256a034405d3c5a71b3a4c54725de4404",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "d5d83242a1d778ceb6d8b07c6b491cf7483ca112",
                            "lessThan": "223d565d8892481684091cfbaf3466f2b0e289d3",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "73c359d1d356cf10236ccd358bd55edab33e9424",
                            "lessThan": "780628a780b622759d9e5adc76d15432144da1a3",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "73c359d1d356cf10236ccd358bd55edab33e9424",
                            "lessThan": "996e90ab446641553e8e21707b38b9709605e0e0",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "73c359d1d356cf10236ccd358bd55edab33e9424",
                            "lessThan": "60f3caff1492e5b8616b9578c4bedb5c0a88ed14",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "8382e92f90b601acf6d426121e6f4991502e767d",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "3b75f627b73d96787a493e2f1187543ba9c056a4",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "6.6.64",
                            "lessThan": "6.6.87",
                            "status": "affected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.2",
                            "lessThan": "6.12.23",
                            "status": "affected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1.120",
                            "lessThan": "6.2",
                            "status": "affected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.11.11",
                            "lessThan": "6.12",
                            "status": "affected",
                            "versionType": "semver"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "arch/loongarch/net/bpf_jit.c"
                    ],
                    "versions": [
                        {
                            "version": "6.13",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.13",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.87",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.23",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.13.11",
                            "lessThanOrEqual": "6.13.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.14.2",
                            "lessThanOrEqual": "6.14.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.15",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.6.64",
                                    "versionEndExcluding": "6.6.87"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.12.2",
                                    "versionEndExcluding": "6.12.23"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.13",
                                    "versionEndExcluding": "6.13.11"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.13",
                                    "versionEndExcluding": "6.14.2"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.13",
                                    "versionEndExcluding": "6.15"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.1.120"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.11.11"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "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't override subprog's return value",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}