{"id":"CVE-2022-49001","summary":"riscv: fix race when vmap stack overflow","details":"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.]","modified":"2026-08-12T03:51:17.791373284Z","published":"2024-10-21T20:06:15.443Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49001.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/7e1864332fbc1b993659eab7974da9fe8bf8c128"},{"type":"WEB","url":"https://git.kernel.org/stable/c/879fabc5a95401d9bce357e4b1d24ae4a360a81f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ac00301adb19df54f2eae1efc4bad7447c0156ce"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49001.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49001"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"31da94c25aea835ceac00575a9fd206c5a833fed"},{"fixed":"ac00301adb19df54f2eae1efc4bad7447c0156ce"},{"fixed":"879fabc5a95401d9bce357e4b1d24ae4a360a81f"},{"fixed":"7e1864332fbc1b993659eab7974da9fe8bf8c128"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49001.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.14.0"},{"fixed":"5.15.82"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.0.12"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49001.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}