{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2022-49001",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2024-08-22T01:27:53.642Z",
        "datePublished": "2024-10-21T20:06:15.443Z",
        "dateUpdated": "2026-08-05T08:53:23.800Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T08:53:23.800Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nriscv: fix race when vmap stack overflow\n\nCurrently, when detecting vmap stack overflow, riscv firstly switches\nto the so called shadow stack, then use this shadow stack to call the\nget_overflow_stack() to get the overflow stack. However, there's\na race here if two or more harts use the same shadow stack at the same\ntime.\n\nTo solve this race, we introduce spin_shadow_stack atomic var, which\nwill be swap between its own address and 0 in atomic way, when the\nvar is set, it means the shadow_stack is being used; when the var\nis cleared, it means the shadow_stack isn't being used.\n\n[Palmer: Add AQ to the swap, and also some comments.]"
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 7,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - The vulnerable path is RISC-V kernel exception entry (`handle_kernel_stack_overflow` in `entry.S`) when a hart’s kernel stack has already overflowed; it is reached only via local kernel execution on the victim host, not via network protocols or physical buses.\nAC:H - Exploitation requires two or more harts to enter the overflow handler and share the global `shadow_stack` in the same narrow window; inducing simultaneous kernel stack exhaustion is an exceptional error condition with cross-CPU timing the attacker cannot reliably force at will, unlike races built from ordinary attacker-controlled ops.\nPR:L - An unprivileged local user can drive deep kernel call chains (syscalls, nested faults, filesystem recursion) that exhaust a task’s kernel stack on a multi-hart RISC-V system; real root or init-namespace admin rights are not required, and `CONFIG_VMAP_STACK` defaults to y.\nUI:N - No separate victim action (mount, open crafted file, etc.) is required; the attacker’s own workloads on multiple CPUs are sufficient to approach the overflow path.\nS:U - Corruption and panic stay inside the host kernel’s authority (shared shadow stack / overflow handling); this is not a VM escape, IOMMU bypass, or other cross-authority boundary break.\nC:H - Concurrent harts overwrite the shared `shadow_stack` while one may still be executing `get_overflow_stack()` on it, corrupting saved frames and register state (including user-influenced syscall args)—memory corruption that can be leveraged for information disclosure.\nI:H - The same race smashes another hart’s live shadow-stack frame and can load a wrong overflow SP before writing a full `pt_regs`, yielding out-of-bounds kernel writes and potential control-flow hijack via corrupted return/stack state.\nA:H - `handle_bad_stack()` always `panic(\"Kernel stack overflow\")`, and racing on the shared shadow stack can oops or corrupt state before that panic—full kernel availability loss."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "arch/riscv/include/asm/asm.h",
                        "arch/riscv/kernel/entry.S",
                        "arch/riscv/kernel/traps.c"
                    ],
                    "versions": [
                        {
                            "version": "31da94c25aea835ceac00575a9fd206c5a833fed",
                            "lessThan": "ac00301adb19df54f2eae1efc4bad7447c0156ce",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "31da94c25aea835ceac00575a9fd206c5a833fed",
                            "lessThan": "879fabc5a95401d9bce357e4b1d24ae4a360a81f",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "31da94c25aea835ceac00575a9fd206c5a833fed",
                            "lessThan": "7e1864332fbc1b993659eab7974da9fe8bf8c128",
                            "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/include/asm/asm.h",
                        "arch/riscv/kernel/entry.S",
                        "arch/riscv/kernel/traps.c"
                    ],
                    "versions": [
                        {
                            "version": "5.14",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "5.14",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.15.82",
                            "lessThanOrEqual": "5.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.0.12",
                            "lessThanOrEqual": "6.0.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1",
                            "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": "5.14",
                                    "versionEndExcluding": "5.15.82"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.14",
                                    "versionEndExcluding": "6.0.12"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.14",
                                    "versionEndExcluding": "6.1"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/ac00301adb19df54f2eae1efc4bad7447c0156ce"
                },
                {
                    "url": "https://git.kernel.org/stable/c/879fabc5a95401d9bce357e4b1d24ae4a360a81f"
                },
                {
                    "url": "https://git.kernel.org/stable/c/7e1864332fbc1b993659eab7974da9fe8bf8c128"
                }
            ],
            "title": "riscv: fix race when vmap stack overflow",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        },
        "adp": [
            {
                "metrics": [
                    {
                        "other": {
                            "type": "ssvc",
                            "content": {
                                "id": "CVE-2022-49001",
                                "role": "CISA Coordinator",
                                "options": [
                                    {
                                        "Exploitation": "none"
                                    },
                                    {
                                        "Automatable": "no"
                                    },
                                    {
                                        "Technical Impact": "partial"
                                    }
                                ],
                                "version": "2.0.3",
                                "timestamp": "2024-10-22T13:15:10.722004Z"
                            }
                        }
                    }
                ],
                "title": "CISA ADP Vulnrichment",
                "providerMetadata": {
                    "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
                    "shortName": "CISA-ADP",
                    "dateUpdated": "2024-10-22T13:18:40.637Z"
                }
            }
        ]
    }
}