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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2024-03-02T21:52:18.500Z
- **Modified:** 2026-06-17T06:42:52.927Z

## Who should check

- Anyone running Linux \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 3719d3c36aa853d5a2401af9f8d6b116c91ad5ae; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 3770c38cd6a60494da29ac2da73ff8156440a2d1; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 6788b10620ca6e98575d1e06e72a8974aad7657e; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< ecba5afe86f30605eb9dfb7f265a8de0218d4cfc; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 5b784489c8158518bf7a466bb3cc045b0fb66b4b; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< cd287cc208dfe6bd6da98e7f88e723209242c9b4; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< d35652a5fc9944784f6f50a5c979518ff8dacf61
- Anyone running Linux 4.17

## 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 \]

## Affected and fixed versions

- Linux: \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 3719d3c36aa853d5a2401af9f8d6b116c91ad5ae; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 3770c38cd6a60494da29ac2da73ff8156440a2d1; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 6788b10620ca6e98575d1e06e72a8974aad7657e; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< ecba5afe86f30605eb9dfb7f265a8de0218d4cfc; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 5b784489c8158518bf7a466bb3cc045b0fb66b4b; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< cd287cc208dfe6bd6da98e7f88e723209242c9b4; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< d35652a5fc9944784f6f50a5c979518ff8dacf61 (cvelist)
- Linux: 4.17 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-52504. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-52504.md
Affected: Linux >= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, < 3719d3c36aa853d5a2401af9f8d6b116c91ad5ae; >= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, < 3770c38cd6a60494da29ac2da73ff8156440a2d1; >= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, < 6788b10620ca6e98575d1e06e72a8974aad7657e; >= 6657fca06e3ffab8d0b3f9d…
Fixed in: Linux 3719d3c36aa853d5a2401af9f8d6b116c91ad5ae, Linux 3770c38cd6a60494da29ac2da73ff8156440a2d1, Linux 6788b10620ca6e98575d1e06e72a8974aad7657e, Linux 5b784489c8158518bf7a466bb3cc045b0fb66b4b

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-52504 being exploited?

There is no confirmed exploitation: CVE-2023-52504 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.32% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-52504?

High: CVSS 7.1 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-52504?

Linux \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 3719d3c36aa853d5a2401af9f8d6b116c91ad5ae; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 3770c38cd6a60494da29ac2da73ff8156440a2d1; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 6788b10620ca6e98575d1e06e72a8974aad7657e; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< ecba5afe86f30605eb9dfb7f265a8de0218d4cfc; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< 5b784489c8158518bf7a466bb3cc045b0fb66b4b; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< cd287cc208dfe6bd6da98e7f88e723209242c9b4; \>= 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, \< d35652a5fc9944784f6f50a5c979518ff8dacf61; Linux 4.17.

### Is there a fix for CVE-2023-52504?

Yes. Fixed in Linux 3719d3c36aa853d5a2401af9f8d6b116c91ad5ae, Linux 3770c38cd6a60494da29ac2da73ff8156440a2d1, Linux 6788b10620ca6e98575d1e06e72a8974aad7657e, Linux 5b784489c8158518bf7a466bb3cc045b0fb66b4b. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-52504?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <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>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-52504>

HTML: <https://flawdb.com/CVE-2023-52504> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-52504>
