CVE-2025-21851 in Linuxinfo

Summary

by MITRE • 03/12/2025

In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix softlockup in arena_map_free on 64k page kernel

On an aarch64 kernel with CONFIG_PAGE_SIZE_64KB=y, arena_htab tests cause a segmentation fault and soft lockup. The same failure is not observed with 4k pages on aarch64.

It turns out arena_map_free() is calling apply_to_existing_page_range() with the address returned by bpf_arena_get_kern_vm_start(). If this address is not page-aligned the code ends up calling apply_to_pte_range() with that unaligned address causing soft lockup.

Fix it by round up GUARD_SZ to PAGE_SIZE << 1 so that the division by 2 in bpf_arena_get_kern_vm_start() returns a page-aligned value.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 12/14/2025

The vulnerability CVE-2025-21851 represents a critical softlockup condition within the Linux kernel's eBPF subsystem specifically affecting aarch64 architectures configured with 64KB page sizes. This issue manifests when arena_htab tests are executed, leading to system-wide lockups that can compromise system stability and availability. The vulnerability is particularly significant because it only occurs under specific configuration conditions where CONFIG_PAGE_SIZE_64KB=y is enabled, making it a platform-specific issue that affects a subset of aarch64 systems running Linux kernels with eBPF support.

The technical root cause lies within the arena_map_free() function which improperly handles memory address alignment during page range operations. When bpf_arena_get_kern_vm_start() returns an address that is not page-aligned, the subsequent call to apply_to_existing_page_range() passes this unaligned address directly to apply_to_pte_range(). This misalignment causes the page table entry manipulation to fail catastrophically, resulting in a soft lockup condition where the system becomes unresponsive without triggering a kernel panic. The vulnerability demonstrates poor memory management practices and insufficient validation of address alignment before critical kernel operations.

The operational impact of this vulnerability extends beyond simple system instability to potentially enable denial of service attacks against systems running affected kernel versions. Systems utilizing 64KB page sizes on aarch64 platforms with eBPF functionality enabled become vulnerable to remote or local exploitation that could cause complete system lockup. This affects enterprise servers, embedded systems, and any infrastructure where aarch64 architecture with 64KB page configuration is deployed, particularly in environments where eBPF programs are actively used for network filtering, system monitoring, or security policy enforcement. The vulnerability is classified under CWE-129 as an improper validation of array index, and can be mapped to ATT&CK technique T1499.004 for network denial of service.

The fix implemented addresses the core alignment issue by ensuring that GUARD_SZ is rounded up to PAGE_SIZE << 1 before the division operation in bpf_arena_get_kern_vm_start(). This mathematical adjustment guarantees that the returned address is always page-aligned, preventing the cascade of failures that lead to soft lockup conditions. The solution follows established kernel development practices for memory management and alignment validation, ensuring that all memory operations maintain proper page boundaries. This patch demonstrates the importance of careful address validation in kernel space operations, particularly when dealing with memory mapping functions that require strict alignment guarantees. The mitigation approach aligns with industry standards for kernel security hardening and prevents similar alignment-related vulnerabilities from manifesting in other kernel subsystems that perform similar page range operations.

Responsible

Linux

Reservation

12/29/2024

Disclosure

03/12/2025

Moderation

accepted

CPE

ready

EPSS

0.00008

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!