partition table handling: Linux kernel partitions: mac partition table handling out-of-bounds memory (DoS) (CVE-2025-21772) #shorts
Summary
Welcome to Security Spotlight. Today we’re unpacking CVE-2025-21772, a Linux kernel vulnerability that mishandles malformed partition tables. Disclosed in late February 2025 and patched in early spring, this flaw can lead to out-of-bounds memory access and denial of service on affected systems. SUSE recently released critical updates for both regular and real-time kernels.
Product details
This issue lives in the Linux kernel’s partition probing code, specifically the mac partition table handler. Any distribution or device running a kernel built from Git commits prior to the official fix (merged around commit 6.14) is at risk. SUSE has published updates for their SUSE Linux Enterprise and RT kernels, and other vendors are expected to follow suit.
Vulnerability type summary
CVE-2025-21772 is a memory-safety defect: improper bounds checks and string operations in partition table parsing. It can be triggered by a crafted storage device or disk image, causing kernel crashes or hangs and resulting in a denial of service condition.
Details of the vulnerability
Under the hood, three coding errors were identified: 1) on encountering a bad partition offset, the code failed to call put_dev_sector(), leaking resources; 2) if the table claims an abnormal sector size—such as 0xfff bytes—entries may straddle boundaries, leading to out-of-bounds reads; and 3) the code used strlen() and strcmp() on untrusted table data instead of safe alternatives, risking buffer overruns. Together these flaws can be weaponized by feeding a system a malicious partition table and driving the kernel into a panic loop or hang.
Conclusion
To stay safe, update your Linux kernels immediately—install SUSE’s published fixes or pull in the 6.14 upstream commit that addresses CVE-2025-21772. Validate your disk utilities and ensure any custom storage appliances are rebuilt with the patched code. That’s it for today’s deep dive—stay tuned for more security updates on Security Spotlight.
Watch the full video on YouTube: CVE-2025-21772
Remediation and exploitation details
This chain involves the following actors
- Malicious user: Creates or supplies malformed partition tables
- System administrator: Maintains systems and applies security updates
- Kernel developer: Implements and reviews kernel fixes
This following systems are involved
- Linux kernel (Manage hardware resources and provide core system services): Contains vulnerable partition probing code
- Disk partition table (Describe layout of a storage device): Carrier of malformed data that triggers the bug
Attack entry point
- Partition probing routine: Kernel code path that reads, validates and parses the partition table from a storage device
Remediation actions
Exploitation actions
Create out-of-bounds memory layout
- Use a disk image tool to set the reported sector size to 4095 bytes
- Populate partition name fields without a terminating zero byte
Trigger the kernel’s partition probing path
- Boot a physical machine from a USB stick containing the crafted image
- Start a virtual machine with the malicious disk file attached
Access memory beyond the allocated buffer
- read_part_sector succeeds but put_dev_sector is not called on bailout
- Use of strlen and strcmp past the end of a non-terminated field
Denial of service by kernel panic
- OOPS: Kernel panic due to out-of-bounds read
- System halt with call trace showing partition driver
Related Content
NOTE: The following related content has not been vetted and may be unsafe.
- https://git.kernel.org/stable/c/a3e77da9f843e4ab93917d30c314f0283e28c124
- https://git.kernel.org/stable/c/213ba5bd81b7e97ac6e6190b8f3bc6ba76123625
- https://git.kernel.org/stable/c/40a35d14f3c0dc72b689061ec72fc9b193f37d1f
- https://git.kernel.org/stable/c/27a39d006f85e869be68c1d5d2ce05e5d6445bf5
- https://git.kernel.org/stable/c/92527100be38ede924768f4277450dfe8a40e16b
- https://git.kernel.org/stable/c/6578717ebca91678131d2b1f4ba4258e60536e9f
- https://git.kernel.org/stable/c/7fa9706722882f634090bfc9af642bf9ed719e27
- https://git.kernel.org/stable/c/80e648042e512d5a767da251d44132553fe04ae0
- [2025-07-19] SUSE releases important Linux Kernel RT fixes for CVE-2025-21772 and CVE-2025-22115.
- [2025-07-21] SUSE releases an important security fix for the Linux Kernel partition table vulnerability CVE-2025-21772.
- [2025-07-24] SUSE releases an important Linux Kernel update to address a denial of service vulnerability (CVE-2025-21772).