# CVE-2023-52504: x86/alternatives: Disable KASAN in apply\_alternatives()

- Priority: **Routine**
- Reason: Not severe (CVSS 7.1, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-03-02 · Modified: 2026-05-11
- Aliases: UBUNTU-CVE-2023-52504, DEBIAN-CVE-2023-52504
- Record: https://cvemate.com/vulnerability/CVE-2023-52504 · JSON: https://cvemate.com/vulnerability/CVE-2023-52504/json

## Description

```text
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 ]
```

## Signals

- CVSS: 7.1 high (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
- EPSS: 0.275%, percentile 21.308%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 114)

- debian linux (Debian): \< 6.1.64-1 \| \< 6.5.8-1
- ubuntu linux (Ubuntu): \< 5.4.0-186.206 \| \< 5.15.0-94.104
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): \< 5.4.0-1126.136 \| \< 5.15.0-1053.58
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1053.58~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): \< 5.4.0-1126.136~18.04.1
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-fips (Ubuntu): \< 5.4.0-1126.136+fips2 \| All versions (No fix recorded) \| \< 5.15.0-1053.58+fips1
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 5.4.0-1131.138 \| \< 5.15.0-1056.64
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.15 (Ubuntu): \< 5.15.0-1056.64~20.04.1
- ubuntu linux-azure-5.19 (Ubuntu): All versions (No fix recorded)

## References

- <https://git.kernel.org/stable/c/3719d3c36aa853d5a2401af9f8d6b116c91ad5ae>
- <https://git.kernel.org/stable/c/3770c38cd6a60494da29ac2da73ff8156440a2d1>
- <https://git.kernel.org/stable/c/6788b10620ca6e98575d1e06e72a8974aad7657e>
- <https://git.kernel.org/stable/c/ecba5afe86f30605eb9dfb7f265a8de0218d4cfc>
- <https://git.kernel.org/stable/c/5b784489c8158518bf7a466bb3cc045b0fb66b4b>
- <https://git.kernel.org/stable/c/cd287cc208dfe6bd6da98e7f88e723209242c9b4>
- <https://git.kernel.org/stable/c/d35652a5fc9944784f6f50a5c979518ff8dacf61>
- <https://ubuntu.com/security/CVE-2023-52504>
- <https://git.kernel.org/linus/d35652a5fc9944784f6f50a5c979518ff8dacf61>
- <https://www.cve.org/CVERecord?id=CVE-2023-52504>
- <https://ubuntu.com/security/notices/USN-6831-1>
- <https://ubuntu.com/security/notices/USN-6867-1>
- <https://security-tracker.debian.org/tracker/CVE-2023-52504>

---

Data as of 2026-12-05T04:50:51.392Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
