Executive brief
A vulnerability exists in the Linux kernel's block device management system, which handles how the operating system interacts with storage hardware like hard drives and SSDs. A local attacker could exploit a mathematical error in how the system checks for data boundaries to potentially cause system instability or gain unauthorized access. This issue affects various versions of the Linux kernel and has been addressed in recent updates.
Technical details
An integer overflow vulnerability exists in 'block/ioctl.c' within the Linux kernel. The 'blkpg_do_ioctl' function performed an unsafe addition ('p.start + p.length < 0') to check for partition overflows, which could itself trigger a signed integer overflow when processing large values. This was identified using the Undefined Behavior Sanitizer (UBSAN). A local attacker with permissions to call IOCTLs on block devices could exploit this to bypass boundary checks. The fix replaces the direct addition with a subtraction-based check ('LLONG_MAX - p.length < p.start') to prevent the overflow from occurring during the validation logic itself. Patch versions include 5.10.221, 5.15.162, 6.1.96, 6.6.36, and 6.9.7.
Affected products
- Linux Linux Kernel up to 5.10.221, 5.11 to 5.15.162, 5.16 to 6.1.96, 6.2 to 6.6.36, 6.7 to 6.9.7
Timeline
- 2024-07-12: advisory: CVE published by NVD
- 2024-05-07: patched: Initial patch submitted by Justin Stitt
References
- https://git.kernel.org/stable/c/3220c90f4dbdc6d20d0608b164d964434a810d66
- https://git.kernel.org/stable/c/54160fb1db2de367485f21e30196c42f7ee0be4e
- https://git.kernel.org/stable/c/58706e482bf45c4db48b0c53aba2468c97adda24
- https://git.kernel.org/stable/c/61ec76ec930709b7bcd69029ef1fe90491f20cf9
- https://git.kernel.org/stable/c/ccb326b5f9e623eb7f130fbbf2505ec0e2dcaff9
- https://git.kernel.org/stable/c/fd841ee01fb4a79cb7f5cc424b5c96c3a73b2d1e
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html