Skip to main content

CVE-2022-48731: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2022-48731cvecve-2022-48731
Published: Thu Jun 20 2024 (06/20/2024, 11:13:19 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: mm/kmemleak: avoid scanning potential huge holes When using devm_request_free_mem_region() and devm_memremap_pages() to add ZONE_DEVICE memory, if requested free mem region's end pfn were huge(e.g., 0x400000000), the node_end_pfn() will be also huge (see move_pfn_range_to_zone()). Thus it creates a huge hole between node_start_pfn() and node_end_pfn(). We found on some AMD APUs, amdkfd requested such a free mem region and created a huge hole. In such a case, following code snippet was just doing busy test_bit() looping on the huge hole. for (pfn = start_pfn; pfn < end_pfn; pfn++) { struct page *page = pfn_to_online_page(pfn); if (!page) continue; ... } So we got a soft lockup: watchdog: BUG: soft lockup - CPU#6 stuck for 26s! [bash:1221] CPU: 6 PID: 1221 Comm: bash Not tainted 5.15.0-custom #1 RIP: 0010:pfn_to_online_page+0x5/0xd0 Call Trace: ? kmemleak_scan+0x16a/0x440 kmemleak_write+0x306/0x3a0 ? common_file_perm+0x72/0x170 full_proxy_write+0x5c/0x90 vfs_write+0xb9/0x260 ksys_write+0x67/0xe0 __x64_sys_write+0x1a/0x20 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae I did some tests with the patch. (1) amdgpu module unloaded before the patch: real 0m0.976s user 0m0.000s sys 0m0.968s after the patch: real 0m0.981s user 0m0.000s sys 0m0.973s (2) amdgpu module loaded before the patch: real 0m35.365s user 0m0.000s sys 0m35.354s after the patch: real 0m1.049s user 0m0.000s sys 0m1.042s

AI-Powered Analysis

AILast updated: 06/30/2025, 19:56:04 UTC

Technical Analysis

CVE-2022-48731 is a medium-severity vulnerability in the Linux kernel related to the memory management subsystem, specifically the kernel memory leak detector (kmemleak) and its handling of ZONE_DEVICE memory regions. The issue arises when the kernel functions devm_request_free_mem_region() and devm_memremap_pages() are used to add ZONE_DEVICE memory with very large end page frame numbers (PFNs), such as 0x400000000. This causes the node_end_pfn() function to return an excessively large value, creating a huge gap or "hole" between node_start_pfn() and node_end_pfn(). On some AMD APUs, the amdkfd driver requests such large free memory regions, triggering this condition. The kmemleak scanning code then enters a busy loop iterating over this huge hole by repeatedly calling test_bit() on a large range of PFNs. This results in a soft lockup where the CPU is stuck for an extended period (e.g., 26 seconds), severely degrading system responsiveness and potentially causing system instability. The vulnerability does not lead to confidentiality or integrity compromise but impacts availability by causing a denial-of-service (DoS) condition through CPU resource exhaustion. The patch fixes the issue by preventing scanning over these huge holes, thereby avoiding the busy loop and soft lockup. Performance tests show that before the patch, systems with the amdgpu module loaded experienced a significant delay (35 seconds) due to the busy loop, which was reduced to approximately 1 second after patching. Systems without the amdgpu module were unaffected. This vulnerability requires local privileges (PR:L) and low attack complexity (AC:L) but no user interaction (UI:N). It affects Linux kernel versions containing the vulnerable code and is particularly relevant for systems running AMD APUs with the amdkfd driver enabled.

Potential Impact

For European organizations, the primary impact of CVE-2022-48731 is a potential denial-of-service condition on Linux systems running AMD APUs with the affected kernel versions. This could disrupt critical services, especially in environments relying on Linux servers or workstations with AMD hardware for compute or graphical workloads. The soft lockup can cause system hangs or degraded performance, impacting availability of applications and services. Industries such as research institutions, media production, and enterprises using AMD-based Linux servers or desktops could face operational interruptions. While the vulnerability does not expose sensitive data or allow privilege escalation, the availability impact could lead to downtime, loss of productivity, and increased operational costs due to system restarts or troubleshooting. Given the reliance on Linux in many European public sector and private sector infrastructures, unpatched systems could experience service degradation. However, the requirement for local privileges limits remote exploitation, reducing the risk of widespread attacks but emphasizing the need for internal security controls to prevent unauthorized local access.

Mitigation Recommendations

1. Apply the official Linux kernel patch that addresses CVE-2022-48731 as soon as possible to prevent the busy loop and soft lockup condition. 2. For organizations unable to immediately patch, consider disabling or unloading the amdgpu and amdkfd kernel modules if AMD APUs are not critical to operations. 3. Implement strict access controls and monitoring to prevent unauthorized local access to Linux systems, as exploitation requires local privileges. 4. Monitor system logs and kernel messages for signs of soft lockups or CPU hangs related to kmemleak scanning. 5. Test kernel updates in a controlled environment before deployment to ensure compatibility with existing AMD hardware and drivers. 6. Maintain an inventory of Linux systems with AMD APUs to prioritize patching and mitigation efforts. 7. Use kernel lockdown features or mandatory access controls (e.g., SELinux, AppArmor) to restrict kernel module loading and memory management operations to trusted users and processes.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-06-20T11:09:39.053Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d982ec4522896dcbe5fc6

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

Last enriched: 6/30/2025, 7:56:04 PM

Last updated: 8/15/2025, 10:28:53 PM

Views: 12

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