Linux Kernel
CVE-2024-38587
HIGH
Severity by source
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Local-only exploitation via an authenticated low-privilege user; out-of-bounds kernel memory access yields full C/I/A impact with no scope change beyond the kernel.
Primary rating from Vendor (416baaa9-dc9f-4396-8d5f-8c081fb06d67).
CVSS VectorVendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Lifecycle Timeline
6DescriptionCVE.org
In the Linux kernel, the following vulnerability has been resolved:
speakup: Fix sizeof() vs ARRAY_SIZE() bug
The "buf" pointer is an array of u16 values. This code should be using ARRAY_SIZE() (which is 256) instead of sizeof() (which is 512), otherwise it can the still got out of bounds.
AnalysisAI
Out-of-bounds kernel memory access in the Linux kernel speakup accessibility driver allows a local low-privileged user to read or corrupt kernel memory due to a sizeof() versus ARRAY_SIZE() confusion bug. The speakup driver's 'buf' variable is a u16 array of 256 elements; the flawed check used sizeof() returning 512 (bytes) instead of ARRAY_SIZE() returning 256 (elements), effectively doubling the permitted index range and enabling out-of-bounds access. Nine patch commits have been applied across multiple stable kernel branches; there is no CISA KEV listing, no public exploit code, and EPSS stands at 0.16%, indicating low real-world exploitation probability despite the 7.8 CVSS score.
Technical ContextAI
The speakup subsystem is a Linux kernel screen reader driver providing text-console accessibility for visually impaired users. The defect lies in a bounds-checking expression where 'buf' is declared as an array of u16 (16-bit unsigned integers, 2 bytes each). Using sizeof(buf) returns the buffer's byte size (256 elements × 2 bytes = 512), while ARRAY_SIZE(buf) returns the element count (256). The check therefore accepted array indices up to 511, exactly double the valid maximum of 255, allowing out-of-bounds reads or writes into adjacent kernel memory. CWE-129 (Improper Validation of Array Index) precisely describes this root cause: the index is validated against the wrong upper bound, permitting access beyond the allocated array. The CPE entries (cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*) span multiple stable branches, reflecting the patch being backported across the kernel's long-term support trees.
RemediationAI
Apply the upstream kernel patches available across multiple stable branches via the nine referenced commits at https://git.kernel.org/stable/c/008ab3c53bc4f0b2f20013c8f6c204a3203d0b8b and siblings. Because exact minimum patched release versions per stable branch are not confirmed from the available data (commits are referenced but no tagged release version is specified), consult your Linux distribution's security tracker - Debian DSA, Ubuntu USN, Red Hat RHSA, SUSE SLES advisories - to identify the specific updated package version to deploy. As a compensating control on systems where text-console accessibility is not required, blacklist the speakup module by adding 'blacklist speakup' to /etc/modprobe.d/blacklist.conf and running 'depmod -a'; this prevents the module from loading on next boot with no side effects on non-accessibility workloads. If the module is currently loaded, unloading it with 'rmmod speakup' (if no active users) eliminates the attack surface without a reboot. Note that blacklisting disables text-console screen reader functionality for visually impaired users - evaluate the operational impact before applying on accessibility-dependent systems.
Same weakness CWE-129 – Improper Validation of Array Index
View allSame technique Information Disclosure
View allShare
External POC / Exploit Code
Leaving vuln.today