Skip to main content

CVE-2022-49778: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2022-49778cvecve-2022-49778
Published: Thu May 01 2025 (05/01/2025, 14:09:13 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: arm64/mm: fix incorrect file_map_count for non-leaf pmd/pud The page table check trigger BUG_ON() unexpectedly when collapse hugepage: ------------[ cut here ]------------ kernel BUG at mm/page_table_check.c:82! Internal error: Oops - BUG: 00000000f2000800 [#1] SMP Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 6 PID: 68 Comm: khugepaged Not tainted 6.1.0-rc3+ #750 Hardware name: linux,dummy-virt (DT) pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : page_table_check_clear.isra.0+0x258/0x3f0 lr : page_table_check_clear.isra.0+0x240/0x3f0 [...] Call trace: page_table_check_clear.isra.0+0x258/0x3f0 __page_table_check_pmd_clear+0xbc/0x108 pmdp_collapse_flush+0xb0/0x160 collapse_huge_page+0xa08/0x1080 hpage_collapse_scan_pmd+0xf30/0x1590 khugepaged_scan_mm_slot.constprop.0+0x52c/0xac8 khugepaged+0x338/0x518 kthread+0x278/0x2f8 ret_from_fork+0x10/0x20 [...] Since pmd_user_accessible_page() doesn't check if a pmd is leaf, it decrease file_map_count for a non-leaf pmd comes from collapse_huge_page(). and so trigger BUG_ON() unexpectedly. Fix this problem by using pmd_leaf() insteal of pmd_present() in pmd_user_accessible_page(). Moreover, use pud_leaf() for pud_user_accessible_page() too.

AI-Powered Analysis

AILast updated: 06/30/2025, 01:26:49 UTC

Technical Analysis

CVE-2022-49778 is a vulnerability identified in the Linux kernel specifically affecting the ARM64 architecture's memory management subsystem. The issue arises from an incorrect handling of page table entries during the collapse of huge pages, a memory optimization technique used to improve performance by merging multiple small pages into a larger one. The vulnerability is rooted in the function pmd_user_accessible_page(), which fails to verify whether a Page Middle Directory (PMD) entry is a leaf node before decrementing the file_map_count. This incorrect decrement occurs when the PMD is non-leaf, leading to an unexpected kernel BUG_ON() trigger during huge page collapse operations. The kernel panic manifests as an internal error with an Oops message, indicating a critical failure in the kernel's page table check logic. The root cause is that pmd_user_accessible_page() uses pmd_present() to check the PMD entry, which does not distinguish leaf from non-leaf entries. The fix involves replacing pmd_present() with pmd_leaf() to ensure only leaf PMD entries are processed, and similarly updating pud_user_accessible_page() to use pud_leaf() for Page Upper Directory (PUD) entries. This correction prevents the erroneous decrement of file_map_count and avoids the kernel panic. The vulnerability affects Linux kernel versions prior to the patch and is specific to ARM64 platforms. No known exploits are reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations relying on ARM64-based Linux systems, particularly those utilizing huge page memory optimizations, this vulnerability can cause unexpected kernel panics leading to system crashes and potential denial of service. Such disruptions can affect critical infrastructure, cloud services, and embedded systems running Linux on ARM64 hardware. The impact on confidentiality and integrity is minimal as the vulnerability primarily causes availability issues through system instability. However, frequent crashes can degrade service reliability, impact business operations, and increase maintenance overhead. Organizations running ARM64 Linux kernels in data centers, edge computing, or IoT devices may experience operational interruptions if the vulnerable kernel versions are deployed. Given the kernel panic occurs in the khugepaged kernel thread responsible for managing huge pages, workloads with heavy memory usage or performance tuning relying on huge pages are at higher risk. The absence of known exploits reduces immediate risk, but unpatched systems remain vulnerable to accidental crashes or potential future exploitation if attackers find ways to trigger the bug deliberately.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernels to versions that include the fix for CVE-2022-49778. Specifically, ensure that the ARM64 kernel is patched to use pmd_leaf() and pud_leaf() checks as per the official Linux kernel patches. For systems where immediate patching is not feasible, consider disabling huge page collapsing features temporarily to avoid triggering the bug, though this may impact performance. Monitoring kernel logs for BUG_ON() messages related to page_table_check.c can help detect attempts to trigger the vulnerability. Additionally, implement robust system monitoring and automated reboot mechanisms to minimize downtime caused by kernel panics. For embedded or specialized ARM64 Linux deployments, coordinate with hardware and software vendors to obtain patched kernel releases. Finally, maintain strict change management and testing procedures to validate kernel updates in staging environments before production deployment to avoid regressions.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-04-16T07:17:33.805Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982cc4522896dcbe4b53

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

Last enriched: 6/30/2025, 1:26:49 AM

Last updated: 7/28/2025, 11:59:43 AM

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