CVE-2023-52504

x86/alternatives: Disable KASAN in apply_alternatives()

No CVSS score yet EPSS 0.27%

Published 2 Mar 2024 Updated 11 May 2026 CNA: Linux

Check your servers for CVE-2023-52504

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-52504 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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 ]

Exploitation

EPSS 0.27%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 21.3% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 5 Mar 2024):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, before 3719d3c36aa853d5a2401af9f8d6b116c91ad5ae
affected from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, before 3770c38cd6a60494da29ac2da73ff8156440a2d1
affected from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, before 6788b10620ca6e98575d1e06e72a8974aad7657e
affected from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, before ecba5afe86f30605eb9dfb7f265a8de0218d4cfc
affected from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, before 5b784489c8158518bf7a466bb3cc045b0fb66b4b
affected from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, before cd287cc208dfe6bd6da98e7f88e723209242c9b4
affected from 6657fca06e3ffab8d0b3f9d8b397f5ee498952d7, before d35652a5fc9944784f6f50a5c979518ff8dacf61
Other versions: unaffected
Linux
affected 4.17
unaffected before 4.17
unaffected from 4.19.297 up to and including 4.19.*
unaffected from 5.4.270 up to and including 5.4.*
unaffected from 5.10.199 up to and including 5.10.*
unaffected from 5.15.136 up to and including 5.15.*
unaffected from 6.1.59 up to and including 6.1.*
unaffected from 6.5.8 up to and including 6.5.*
unaffected 6.6 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2023-52504 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2023-52504

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2023-52504
trivy image --scanners vuln IMAGE | grep CVE-2023-52504

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2023-52504 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.