Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-58007 Overview
CVE-2024-58007 is an out-of-bounds read vulnerability in the Linux kernel's Qualcomm socinfo driver. The flaw affects MSM8916-based devices running firmware that exposes SOCINFO_VERSION(0, 8), which lacks support for the serial_num field in the socinfo struct. An existing bounds check used offsetof() instead of offsetofend(), allowing the driver to expose data beyond the valid socinfo structure through the sysfs serial_number attribute. Reading this attribute returns bytes located after the structure in Shared Memory (SMEM), leaking adjacent kernel memory contents to any local user with sysfs read access. The vulnerability is classified under [CWE-125 Out-of-Bounds Read].
Critical Impact
A local attacker can read kernel memory beyond the socinfo struct through sysfs, exposing adjacent SMEM data and potentially triggering unavailability on affected Qualcomm SoC platforms.
Affected Products
- Linux Kernel on Qualcomm MSM8916-based devices
- Kernel builds including the soc/qcom/socinfo driver prior to the fix commits
- Debian LTS Linux kernel packages (addressed via LTS advisories)
Discovery Timeline
- 2025-02-27 - CVE-2024-58007 published to the National Vulnerability Database
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-58007
Vulnerability Analysis
The vulnerability resides in the Qualcomm socinfo driver (drivers/soc/qcom/socinfo.c), which exposes SoC metadata via sysfs under /sys/devices/soc0/. The driver retrieves the socinfo structure from Shared Memory Manager (SMEM) and selectively exposes fields based on the size reported by SMEM. One such field, serial_num, is only valid when the firmware exposes a sufficiently large structure.
On MSM8916 devices, firmware exposes SOCINFO_VERSION(0, 8), a layout that predates the serial_num field. The driver's guard incorrectly compared the SMEM item_size against the start offset of serial_num rather than its end offset. As a result, the check passed on hardware where the field did not actually exist, and the driver read beyond the valid structure.
The practical observation on affected db410c boards was a constant serial number value of 2644893864 across all devices. That constant was not a serial number at all but whatever bytes immediately followed the socinfo struct in SMEM, confirming the out-of-bounds read.
Root Cause
The root cause is an incorrect bounds check using offsetof(struct socinfo, serial_num) instead of offsetofend(struct socinfo, serial_num). The offsetof() macro returns the starting byte of the field, which omits the field's own size from the comparison. The fix replaces this with offsetofend(), ensuring the SMEM item_size fully covers the field before the driver dereferences it.
Attack Vector
Exploitation requires local access with permission to read sysfs attributes under /sys/devices/soc0/serial_number. No user interaction or elevated privileges beyond standard shell access are needed. The attacker reads the sysfs attribute, which returns the leaked bytes decoded as an unsigned integer. The disclosed memory is adjacent to the socinfo SMEM region and may contain other SMEM metadata useful for further analysis of the device.
No verified public exploit code is available for this issue. See the upstream commits linked under Patch Information for the authoritative change.
Detection Methods for CVE-2024-58007
Indicators of Compromise
- Constant serial_number value 2644893864 reported in /sys/devices/soc0/serial_number on MSM8916 devices, indicating the vulnerable code path is active.
- Unprivileged processes repeatedly reading /sys/devices/soc0/serial_number or related soc0 sysfs attributes on Qualcomm-based Linux systems.
- Kernel builds on MSM8916 hardware that have not integrated the upstream offsetofend() fix.
Detection Strategies
- Inventory Linux kernel versions across Qualcomm-based fleet devices and compare against the stable commits 0a92feddae06, 22cf4fae6660, 407c928305c1, 47470acd719d, and 9c88b3a3fae4.
- Audit the running socinfo driver source for the item_size boundary check and confirm it uses offsetofend() rather than offsetof().
- Use Linux auditd rules to log read access to /sys/devices/soc0/serial_number by non-root users.
Monitoring Recommendations
- Monitor sysfs access patterns on embedded and mobile Linux endpoints running Qualcomm SoCs for anomalous enumeration of /sys/devices/soc0/.
- Track Debian LTS advisories referenced in the CVE for kernel package updates applicable to your distribution.
- Alert on kernel package versions that remain below the patched build on fleet-managed devices.
How to Mitigate CVE-2024-58007
Immediate Actions Required
- Apply the upstream Linux kernel patches identified by commits 0a92feddae06, 22cf4fae6660, 407c928305c1, 47470acd719d, and 9c88b3a3fae4.
- Update Debian LTS kernel packages per the Debian LTS Announcement (March 2025) and Debian LTS Announcement (May 2025).
- Prioritize patching for MSM8916-based devices and other Qualcomm SoC platforms where the socinfo driver is enabled.
Patch Information
The fix changes the item_size boundary check in drivers/soc/qcom/socinfo.c from offsetof(struct socinfo, serial_num) to offsetofend(struct socinfo, serial_num). This ensures the SMEM-reported size fully contains the serial_num field before the driver reads it. Authoritative references are the stable tree commits listed in the vendor advisory URLs, including kernel.org commit 47470acd719d and kernel.org commit 9c88b3a3fae4.
Workarounds
- Restrict read permissions on /sys/devices/soc0/serial_number to the root user where feasible on affected devices.
- Disable the Qualcomm socinfo driver in kernel configuration on systems that do not require SoC metadata via sysfs.
- Limit local shell access on affected devices to trusted administrators until the patched kernel is deployed.
# Restrict access to the vulnerable sysfs attribute as a temporary mitigation
chmod 400 /sys/devices/soc0/serial_number
chown root:root /sys/devices/soc0/serial_number
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

