{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-40358",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T07:20:57.187Z",
        "datePublished": "2025-12-16T13:39:57.847Z",
        "dateUpdated": "2026-08-05T12:09:53.455Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T12:09:53.455Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nriscv: stacktrace: Disable KASAN checks for non-current tasks\n\nUnwinding the stack of a task other than current, KASAN would report\n\"BUG: KASAN: out-of-bounds in walk_stackframe+0x41c/0x460\"\n\nThere is a same issue on x86 and has been resolved by the commit\n84936118bdf3 (\"x86/unwind: Disable KASAN checks for non-current tasks\")\nThe solution could be applied to RISC-V too.\n\nThis patch also can solve the issue:\nhttps://seclists.org/oss-sec/2025/q4/23\n\n[pjw@kernel.org: clean up checkpatch issues]"
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H",
                        "baseScore": 7.1,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - The unwinder is reached through local interfaces only — reading /proc/PID/stack, or by inducing a hung-task/OOM-reaper/workqueue-stall stack dump from a local process. No network-facing code path reaches walk_stackframe on a non-current task.\nAC:L - The attacker controls both sides of the race: one thread spins in the kernel while a sibling thread reads the stack of the still-running task, which is exactly what the published syzkaller reproducer does. No memory layout or timing condition outside the attacker's influence is needed.\nPR:L - The demonstrated /proc/PID/stack path requires CAP_SYS_ADMIN in the initial user namespace, but the same non-current unwind is reached without privileges via default-enabled paths that dump a concurrently running task — hung_task's debug_show_blocker() on a running mutex owner, the OOM reaper failure dump, and the workqueue stall watchdog. An ordinary local account suffices for those.\nUI:N - The attacker triggers the stack walk entirely from its own threads; no action by another user or administrator is required.\nS:U - The faulty read and its consequences are confined to the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The unwinder performs an out-of-bounds read of another task's live kernel stack, following an attacker-influenced frame chain to essentially arbitrary offsets within that stack, and the resulting KASAN splat plus /proc/PID/stack output disclose raw kernel stack and text addresses, defeating KASLR.\nI:N - walk_stackframe only loads values from the stack and reports them through a bounded consumer callback; there is no write of any kind, so no kernel state can be modified.\nA:H - The KASAN report goes through check_panic_on_warn(\"KASAN\") and honors kasan.fault=panic, so a repeatable attacker-triggered splat becomes a kernel panic on such configurations, and unbounded report flooding degrades the system otherwise."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "arch/riscv/kernel/stacktrace.c"
                    ],
                    "versions": [
                        {
                            "version": "5d8544e2d0075a5f3c9a2cf27152354d54360da1",
                            "lessThan": "ef4d626ac59a56f8ec5cc09c1fef26f2923eec6f",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5d8544e2d0075a5f3c9a2cf27152354d54360da1",
                            "lessThan": "f34ba22989da61186f30a40b6a82e0b3337b96fc",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5d8544e2d0075a5f3c9a2cf27152354d54360da1",
                            "lessThan": "27379fcc15a10d3e3780fe79ba3fc7ed1ccd78e2",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5d8544e2d0075a5f3c9a2cf27152354d54360da1",
                            "lessThan": "2c8d2b53866fb229b438296526ef0fa5a990e5e5",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5d8544e2d0075a5f3c9a2cf27152354d54360da1",
                            "lessThan": "060ea84a484e852b52b938f234bf9b5503a6c910",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "arch/riscv/kernel/stacktrace.c"
                    ],
                    "versions": [
                        {
                            "version": "4.15",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "4.15",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1.167",
                            "lessThanOrEqual": "6.1.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.117",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.58",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.17.8",
                            "lessThanOrEqual": "6.17.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.18",
                            "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": "4.15",
                                    "versionEndExcluding": "6.1.167"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.15",
                                    "versionEndExcluding": "6.6.117"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.15",
                                    "versionEndExcluding": "6.12.58"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.15",
                                    "versionEndExcluding": "6.17.8"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.15",
                                    "versionEndExcluding": "6.18"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/ef4d626ac59a56f8ec5cc09c1fef26f2923eec6f"
                },
                {
                    "url": "https://git.kernel.org/stable/c/f34ba22989da61186f30a40b6a82e0b3337b96fc"
                },
                {
                    "url": "https://git.kernel.org/stable/c/27379fcc15a10d3e3780fe79ba3fc7ed1ccd78e2"
                },
                {
                    "url": "https://git.kernel.org/stable/c/2c8d2b53866fb229b438296526ef0fa5a990e5e5"
                },
                {
                    "url": "https://git.kernel.org/stable/c/060ea84a484e852b52b938f234bf9b5503a6c910"
                }
            ],
            "title": "riscv: stacktrace: Disable KASAN checks for non-current tasks",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}