cve.bz

CVE-2023-52452 linux linux kernel: Improper Initialization

7.8 highEPSS 0.3%Fix available

High (7.8) in linux linux kernel. EPSS 0.3% estimated probability of exploitation activity in the next 30 days.

On this page
In the Linux kernel, the following vulnerability has been resolved: bpf: Fix accesses to uninit stack slots Privileged programs are supposed to be able to read uninitialized stack memory (ever since 6715df8d5) but, before this patch, these accesses were permitted inconsistently. In particular, accesses were permitted above state->allocated_stack, but not below it. In other words, if the stack was already "large enough", the access was permitted, but otherwise the access was rejected instead of being allowed to "grow the stack". This undesired rejection was happening in two places: - in check_stack_slot_within_bounds() - in check_stack_range_initialized() This patch arranges for these accesses to be permitted. A bunch of tests that were relying on the old rejection had to change; all of them were changed to add also run unprivileged, in which case the old behavior persists. One tests couldn't be updated - global_func16 - because it can't run unprivileged for other reasons. This patch also fixes the tracking of the stack size for variable-offset reads. This second fix is bundled in the same commit as the first one because they're inter-related. Before this patch, writes to the stack using registers containing a variable offset (as opposed to registers with fixed, known values) were not properly contributing to the function's needed stack size. As a result, it was possible for a program to verify, but then to attempt to read out-of-bounds data at runtime because a too small stack had been allocated for it. Each function tracks the size of the stack it needs in bpf_subprog_info.stack_depth, which is maintained by update_stack_depth(). For regular memory accesses, check_mem_access() was calling update_state_depth() but it was passing in only the fixed part of the offset register, ignoring the variable offset. This was incorrect; the minimum possible value of that register should be used instead. This tracking is now fixed by centralizing the tracking of stack size in grow_stack_state(), and by lifting the calls to grow_stack_state() to check_stack_access_within_bounds() as suggested by Andrii. The code is now simpler and more convincingly tracks the correct maximum stack size. check_stack_range_initialized() can now rely on enough stack having been allocated for the access; this helps with the fix for the first issue. A few tests were changed to also check the stack depth computation. The one that fails without this patch is verifier_var_off:stack_write_priv_vs_unpriv.

Severity

CVSS 3.1

7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
0.3% (unchanged from 0.2% a week ago; 0.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 18th percentile. Scored 2026-11-30. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2024-02-22. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-665 Improper Initialization
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2023-52452 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2023-52452?via=ask-ai-copy and https://cve.bz/cve/CVE-2023-52452?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2023-52452 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Linuxfrom 5.10.33 before 5.11
Linuxfrom 5.11.17 before 5.12
Linux5.12 and later

Fixed in

ProductRelease lineFixed in
Linux6.16.1.191
Linux6.66.6.14
Linux6.76.7.2
Linuxlater releases6.8

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12linux6.1.192-1DEBIAN-CVE-2023-52452 DLA-4906-1
Debian13, 14linux6.6.15-1DEBIAN-CVE-2023-52452
Ubuntu16.04:LTSlinux-hwe-edgeno fix listedUBUNTU-CVE-2023-52452
Ubuntu18.04:LTSlinux-gcp, linux-hwe, linux-oem and 11 moreno fix listedUBUNTU-CVE-2023-52452
Ubuntu20.04:LTSlinux-gke, linux-riscv, linux-raspi2 and 25 moreno fix listedUBUNTU-CVE-2023-52452
Ubuntu22.04:LTSlinux, linux-aws, linux-gcp and 38 moreno fix listedUBUNTU-CVE-2023-52452
Ubuntu22.04:LTSlinux-azure-6.56.5.0-1022.23~22.04.1UBUNTU-CVE-2023-52452 USN-6819-1
Ubuntu22.04:LTSlinux-gcp-6.56.5.0-1022.24~22.04.1UBUNTU-CVE-2023-52452 USN-6818-1
Ubuntu22.04:LTSlinux-hwe-6.56.5.0-41.41~22.04.2UBUNTU-CVE-2023-52452 USN-6818-4
Ubuntu22.04:LTSlinux-lowlatency-hwe-6.56.5.0-41.41.1~22.04.1UBUNTU-CVE-2023-52452 USN-6818-1
Ubuntu22.04:LTSlinux-nvidia-6.56.5.0-1021.22UBUNTU-CVE-2023-52452 USN-6818-3
Ubuntu22.04:LTSlinux-oem-6.56.5.0-1024.25UBUNTU-CVE-2023-52452 USN-6819-3
Ubuntu22.04:LTSlinux-oracle-6.56.5.0-1024.24~22.04.1UBUNTU-CVE-2023-52452 USN-6819-4
Ubuntu22.04:LTSlinux-riscv-6.56.5.0-40.40.1~22.04.1UBUNTU-CVE-2023-52452
6 more for Ubuntu in the JSON and on Ubuntu's page.
SUSELinux Enterprise High Availability Extension 15 SP4, Linux Enterprise Live Patching 15 SP4, Linux Enterprise Micro 5.3 and 2 morekernel-default5.14.21-150400.24.111.2SUSE-SU-2024:0900-1
SUSELinux Enterprise High Availability Extension 15 SP5, Linux Enterprise Live Patching 15 SP5, Linux Enterprise Micro 5.5 and 2 morekernel-default5.14.21-150500.55.52.1SUSE-SU-2024:0858-1
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSSkernel-64kb, kernel-docs, kernel-default5.14.21-150400.24.111.2SUSE-SU-2024:0900-1
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise Micro 5.3 and 5 morekernel-default-base5.14.21-150400.24.111.2.150400.24.52.1SUSE-SU-2024:0900-1
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise Server 15 SP4-LTSS and 1 morekernel-syms, kernel-source, kernel-obs-build5.14.21-150400.24.111.1SUSE-SU-2024:0900-1
SUSELinux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4-RT_Update_191-150400.1.3.1SUSE-SU-2024:0977-1
SUSELinux Enterprise Live Patching 15 SP4kernel-livepatch-SLE15-SP4_Update_241-150400.9.3.1SUSE-SU-2024:0900-1
SUSELinux Enterprise Live Patching 15 SP5kernel-livepatch-SLE15-SP5-RT_Update_111-150500.11.3.1SUSE-SU-2024:0910-1
SUSELinux Enterprise Live Patching 15 SP5kernel-livepatch-SLE15-SP5_Update_111-150500.11.3.1SUSE-SU-2024:0858-1
SUSELinux Enterprise Micro 5.3, Linux Enterprise Micro 5.4kernel-rt, kernel-source-rt5.14.21-150400.15.71.1SUSE-SU-2024:0977-1
SUSELinux Enterprise Micro 5.5kernel-rt, kernel-source-rt5.14.21-150500.13.38.1SUSE-SU-2024:0910-1
SUSELinux Enterprise Micro 5.5, Linux Enterprise Module for Basesystem 15 SP5kernel-default-base5.14.21-150500.55.52.1.150500.6.23.1SUSE-SU-2024:0858-1
10 more for SUSE in the JSON and on SUSE's page.
openSUSELeap 15.5dtb-aarch64, kernel-64kb, kernel-docs and 8 more5.14.21-150500.55.52.1SUSE-SU-2024:0858-1
openSUSELeap 15.5kernel-azure, kernel-syms-azure, kernel-source-azure5.14.21-150500.33.37.1SUSE-SU-2024:0855-1
openSUSELeap 15.5kernel-default-base5.14.21-150500.55.52.1.150500.6.23.1SUSE-SU-2024:0858-1
openSUSELeap 15.5kernel-rt, kernel-syms-rt, kernel-rt_debug and 1 more5.14.21-150500.13.38.1SUSE-SU-2024:0910-1
openSUSELeap Micro 5.3, Leap Micro 5.4kernel-default5.14.21-150400.24.111.2SUSE-SU-2024:0900-1
openSUSELeap Micro 5.3, Leap Micro 5.4kernel-default-base5.14.21-150400.24.111.2.150400.24.52.1SUSE-SU-2024:0900-1
openSUSELeap Micro 5.3, Leap Micro 5.4kernel-rt5.14.21-150400.15.71.1SUSE-SU-2024:0977-1
Azure Linux2kernelno fix listedAZL-35905
Alpaquita23linux-lts6.1.191-r0BELL-CVE-2023-52452
Alpaquita25, streamlinux-lts6.12.41-r0BELL-CVE-2023-52452

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE · Alpaquita.

Red Hat

Red Hat rates this Low.

Red Hat's statement

This flaw is rated as having Moderate impact because of the need to have elevated privileges or non-standard configuration for running BPF script.

Red Hat's mitigation

As a temporary solution, set the following sysctl:

kernel.unprivileged_bpf_disabled = 1

ProductPackageStateAdvisory
Red Hat Enterprise Linux 6kernelNot affected
Red Hat Enterprise Linux 7kernelNot affected
Red Hat Enterprise Linux 7kernel-rtNot affected
Red Hat Enterprise Linux 8kernelFix deferred
Red Hat Enterprise Linux 8kernel-rtFix deferred
Red Hat Enterprise Linux 9kernelFix deferred
Red Hat Enterprise Linux 9kernel-rtFix deferred

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2023-52452.

Attack patterns (CAPEC)

  • CAPEC-26 Leveraging Race Conditions Likelihood: High · Severity: High
  • CAPEC-29 Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON