Skip to main content

CVE-2023-52451: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2023-52451cvecve-2023-52451
Published: Thu Feb 22 2024 (02/22/2024, 16:21:42 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: powerpc/pseries/memhp: Fix access beyond end of drmem array dlpar_memory_remove_by_index() may access beyond the bounds of the drmem lmb array when the LMB lookup fails to match an entry with the given DRC index. When the search fails, the cursor is left pointing to &drmem_info->lmbs[drmem_info->n_lmbs], which is one element past the last valid entry in the array. The debug message at the end of the function then dereferences this pointer: pr_debug("Failed to hot-remove memory at %llx\n", lmb->base_addr); This was found by inspection and confirmed with KASAN: pseries-hotplug-mem: Attempting to hot-remove LMB, drc index 1234 ================================================================== BUG: KASAN: slab-out-of-bounds in dlpar_memory+0x298/0x1658 Read of size 8 at addr c000000364e97fd0 by task bash/949 dump_stack_lvl+0xa4/0xfc (unreliable) print_report+0x214/0x63c kasan_report+0x140/0x2e0 __asan_load8+0xa8/0xe0 dlpar_memory+0x298/0x1658 handle_dlpar_errorlog+0x130/0x1d0 dlpar_store+0x18c/0x3e0 kobj_attr_store+0x68/0xa0 sysfs_kf_write+0xc4/0x110 kernfs_fop_write_iter+0x26c/0x390 vfs_write+0x2d4/0x4e0 ksys_write+0xac/0x1a0 system_call_exception+0x268/0x530 system_call_vectored_common+0x15c/0x2ec Allocated by task 1: kasan_save_stack+0x48/0x80 kasan_set_track+0x34/0x50 kasan_save_alloc_info+0x34/0x50 __kasan_kmalloc+0xd0/0x120 __kmalloc+0x8c/0x320 kmalloc_array.constprop.0+0x48/0x5c drmem_init+0x2a0/0x41c do_one_initcall+0xe0/0x5c0 kernel_init_freeable+0x4ec/0x5a0 kernel_init+0x30/0x1e0 ret_from_kernel_user_thread+0x14/0x1c The buggy address belongs to the object at c000000364e80000 which belongs to the cache kmalloc-128k of size 131072 The buggy address is located 0 bytes to the right of allocated 98256-byte region [c000000364e80000, c000000364e97fd0) ================================================================== pseries-hotplug-mem: Failed to hot-remove memory at 0 Log failed lookups with a separate message and dereference the cursor only when it points to a valid entry.

AI-Powered Analysis

AILast updated: 07/01/2025, 09:10:45 UTC

Technical Analysis

CVE-2023-52451 is a vulnerability identified in the Linux kernel specifically affecting the powerpc/pseries architecture's memory hotplug handling code. The flaw exists in the function dlpar_memory_remove_by_index(), which is responsible for removing memory blocks (LMBs) dynamically in a hotplug environment. The vulnerability arises when the function attempts to locate a memory block by its DRC index but fails to find a matching entry in the drmem_info->lmbs array. Instead of properly handling the failure, the code leaves the cursor pointer referencing one element beyond the end of the array, leading to an out-of-bounds access when the code dereferences this pointer to log a debug message. This results in a slab-out-of-bounds read error detected by Kernel Address Sanitizer (KASAN), indicating a potential memory safety violation. The issue is triggered during the hot-remove operation of memory on pseries systems and can cause kernel crashes or undefined behavior due to invalid memory access. The root cause is insufficient boundary checking on the array index used for memory block lookup. The vulnerability was discovered through code inspection and confirmed with KASAN testing. The fix involves adding proper logging for failed lookups and ensuring the pointer is dereferenced only when it points to a valid array entry. This vulnerability affects Linux kernel versions containing the specified commit hashes and is relevant to systems running on IBM Power Systems (pseries) architecture that support dynamic logical partitioning (DLPAR) memory hotplug features.

Potential Impact

For European organizations using IBM Power Systems running Linux kernels with the affected versions, this vulnerability poses a risk of kernel instability or crashes during memory hot-remove operations. Such instability can lead to denial of service conditions impacting critical workloads, especially in data centers or enterprise environments relying on dynamic memory management for virtualization or partitioning. Although the vulnerability does not appear to allow privilege escalation or arbitrary code execution directly, the out-of-bounds access could be leveraged in complex attack scenarios to cause system crashes or potentially leak sensitive kernel memory. Organizations in sectors such as finance, telecommunications, and government that utilize Power Systems for high-availability services may experience service disruptions. The threat is limited to environments using the pseries architecture with memory hotplug enabled, which is a niche but important segment in enterprise Linux deployments. Since no known exploits are reported in the wild, the immediate risk is moderate but should not be underestimated given the potential for denial of service and system reliability degradation.

Mitigation Recommendations

1. Apply the official Linux kernel patches that address CVE-2023-52451 as soon as they become available from trusted sources or Linux distribution vendors. 2. For organizations unable to patch immediately, consider disabling memory hot-remove functionality on affected pseries systems to prevent triggering the vulnerable code path. 3. Monitor kernel logs for messages related to memory hotplug operations and KASAN reports indicating out-of-bounds accesses to detect potential exploitation attempts or system instability. 4. Implement strict change control and testing procedures when performing memory hotplug operations to minimize the risk of triggering the vulnerability in production environments. 5. Engage with hardware and Linux distribution vendors to confirm the presence of the fix in kernel updates and validate system stability post-patching. 6. Maintain up-to-date backups and disaster recovery plans to mitigate impact in case of system crashes caused by this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-02-20T12:30:33.293Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9831c4522896dcbe79dc

Added to database: 5/21/2025, 9:09:05 AM

Last enriched: 7/1/2025, 9:10:45 AM

Last updated: 8/12/2025, 4:17:27 PM

Views: 15

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats