# CVE-2023-52504: x86/alternatives: Disable KASAN in apply_alternatives()

- Severity: High 7.1 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.27%, higher than 21% of CVEs (2026-12-01)
- Published: 2024-03-02T21:52:18.500Z
- Modified: 2026-06-17T06:42:52.927Z
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

x86/alternatives: Disable KASAN in apply_alternatives()

Fei has reported that KASAN triggers during apply_alternatives() on
a 5-level paging machine:

	BUG: KASAN: out-of-bounds in rcu_is_watching()
	Read of size 4 at addr ff110003ee6419a0 by task swapper/0/0
	...
	__asan_load4()
	rcu_is_watching()
	trace_hardirqs_on()
	text_poke_early()
	apply_alternatives()
	...

On machines with 5-level paging, cpu_feature_enabled(X86_FEATURE_LA57)
gets patched. It includes KASAN code, where KASAN_SHADOW_START depends on
__VIRTUAL_MASK_SHIFT, which is defined with cpu_feature_enabled().

KASAN gets confused when apply_alternatives() patches the
KASAN_SHADOW_START users. A test patch that makes KASAN_SHADOW_START
static, by replacing __VIRTUAL_MASK_SHIFT with 56, works around the issue.

Fix it for real by disabling KASAN while the kernel is patching alternatives.

[ mingo: updated the changelog ]

(As written by CVE List.)

## Affected

- Linux Linux: from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7 before 3719d3c36aa853d5a2401af9f8d6b116c91ad5ae; from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7 before 3770c38cd6a60494da29ac2da73ff8156440a2d1; from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7 before 6788b10620ca6e98575d1e06e72a8974aad7657e; from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7 before ecba5afe86f30605eb9dfb7f265a8de0218d4cfc; from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7 before 5b784489c8158518bf7a466bb3cc045b0fb66b4b; from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7 before cd287cc208dfe6bd6da98e7f88e723209242c9b4; from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7 before d35652a5fc9944784f6f50a5c979518ff8dacf61; 4.17 (not affected: before 4.17; from 4.19.297 up to 4.19.*; from 5.4.270 up to 5.4.*; from 5.10.199 up to 5.10.*; from 5.15.136 up to 5.15.*; from 6.1.59 up to 6.1.*; from 6.5.8 up to 6.5.*; from 6.6 up to *)
- linux linux_kernel: from 4.17 before 4.19.297; from 4.20 before 5.4.270; from 5.5 before 5.10.199; from 5.11 before 5.15.136; from 5.16 before 6.1.59; from 6.2 before 6.5.8; 6.6

## References

- <https://git.kernel.org/stable/c/3719d3c36aa853d5a2401af9f8d6b116c91ad5ae> (patch)
- <https://git.kernel.org/stable/c/3770c38cd6a60494da29ac2da73ff8156440a2d1> (patch)
- <https://git.kernel.org/stable/c/6788b10620ca6e98575d1e06e72a8974aad7657e> (patch)
- <https://git.kernel.org/stable/c/ecba5afe86f30605eb9dfb7f265a8de0218d4cfc> (patch)
- <https://git.kernel.org/stable/c/5b784489c8158518bf7a466bb3cc045b0fb66b4b> (patch)
- <https://git.kernel.org/stable/c/cd287cc208dfe6bd6da98e7f88e723209242c9b4> (patch)
- <https://git.kernel.org/stable/c/d35652a5fc9944784f6f50a5c979518ff8dacf61> (patch)

## Sources

- CVE List: [CVE-2023-52504](https://www.cve.org/CVERecord?id=CVE-2023-52504), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2023-52504](https://nvd.nist.gov/vuln/detail/CVE-2023-52504), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2023-52504 · Whole record: https://cve.day/CVE-2023-52504.json · Rebuilt by cve.day 2026-11-25T22:58:33.152Z
