Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-40114

CVE-2025-40114: Linux Kernel Buffer Overflow Vulnerability

CVE-2025-40114 is a buffer overflow vulnerability in the Linux Kernel's IIO light sensor driver that could lead to out-of-bounds memory access. This article covers the technical details, affected versions, and mitigation.

Updated:

CVE-2025-40114 Overview

CVE-2025-40114 affects the Linux kernel's Industrial I/O (IIO) subsystem, specifically the veml6075 ambient light sensor driver. The function veml6075_read_int_time_ms indexes into the veml6075_it_ms array using a value computed by veml6075_read_int_time_index. The array holds five 4-byte elements, but the computed index can range from 0 to 7. This mismatch enables an out-of-bounds read of up to 12 bytes past the array boundary. Coverity flagged the defect as CID 1574309 (OVERRUN). Maintainers describe the fix as hardening against potentially broken hardware rather than a critical issue requiring backport.

Critical Impact

A local attacker with driver access can trigger an out-of-bounds read in kernel memory, potentially leaking sensitive data or destabilizing the kernel.

Affected Products

  • Linux kernel versions containing the veml6075 IIO light sensor driver prior to the fix commits
  • Distributions shipping vulnerable stable kernel branches
  • Embedded and IoT systems using VEML6075 UV light sensors over I2C

Discovery Timeline

  • 2025-04-18 - CVE-2025-40114 published to NVD
  • 2025-10-01 - Last updated in NVD database

Technical Details for CVE-2025-40114

Vulnerability Analysis

The defect resides in drivers/iio/light/veml6075.c. The driver exposes integration time controls for the VEML6075 UV light sensor. The function veml6075_read_int_time_index returns an integer used to look up the millisecond value for a given integration time setting. The lookup table veml6075_it_ms declares only five entries, yet the index helper can return values up to 7. Reading at index 7 reaches 12 bytes beyond the table, producing an out-of-bounds read classified under [CWE-129] Improper Validation of Array Index.

Root Cause

The root cause is a missing array bounds check between the index producer and the array consumer. The original code assumed veml6075_read_int_time_index would always return an index within veml6075_it_ms, but the function's domain is wider than the table size. No range validation existed at the call site, so adjacent memory could be read and returned to userspace through sysfs.

Attack Vector

Exploitation requires local access and the ability to interact with the IIO sysfs interface for the veml6075 driver. An attacker with permission to read the integration time attribute can trigger the out-of-bounds read. The vulnerability is contingent on the device being present or simulated, which limits practical impact on general-purpose systems. Embedded platforms exposing the sensor to lower-privileged users carry higher risk. Reference patches are available in the upstream stable tree as commits 18a08b5, 7a40b52, 9c40a68, and ee735aa. See the Kernel Git Commit 18a08b5 for the canonical fix.

Detection Methods for CVE-2025-40114

Indicators of Compromise

  • Unexpected kernel log entries referencing veml6075 or KASAN out-of-bounds read reports against veml6075_it_ms
  • Userspace processes reading /sys/bus/iio/devices/iio:deviceX/in_intensity_integration_time on systems with the VEML6075 driver loaded
  • Anomalous sysfs reads from non-root accounts on embedded devices exposing IIO sensors

Detection Strategies

  • Enable KASAN (Kernel Address Sanitizer) on test kernels to identify the out-of-bounds read at runtime
  • Audit loaded kernel modules with lsmod | grep veml6075 and verify the running kernel includes one of the fix commits
  • Compare the running kernel source against patch hashes 18a08b5, 7a40b52, 9c40a68, and ee735aa

Monitoring Recommendations

  • Monitor dmesg and journalctl -k for KASAN, BUG, or WARN entries referencing the IIO light subsystem
  • Track sysfs access patterns on IIO device nodes through audit rules on /sys/bus/iio/
  • Inventory embedded fleets for VEML6075 hardware and confirm patched kernel deployment status

How to Mitigate CVE-2025-40114

Immediate Actions Required

  • Apply the upstream Linux kernel patches referenced by commits 18a08b5, 7a40b52, 9c40a68, and ee735aa
  • Update to a stable kernel release incorporating the bounds check in veml6075_read_int_time_ms
  • Restrict access to IIO sysfs attributes to privileged users on systems exposing the VEML6075 driver

Patch Information

The fix adds an explicit bounds check before indexing veml6075_it_ms. Patches are available in the Linux stable tree: Kernel Git Commit 18a08b5, Kernel Git Commit 7a40b52, Kernel Git Commit 9c40a68, and Kernel Git Commit ee735aa. Kernel maintainers note the fix is hardening and not mandatory to backport.

Workarounds

  • Unload or blacklist the veml6075 module on systems that do not require UV light sensing
  • Tighten permissions on IIO sysfs attributes to limit reads to root or trusted groups
  • Disable CONFIG_VEML6075 in custom kernel builds where the sensor is not present
bash
# Blacklist the veml6075 driver until a patched kernel is deployed
echo "blacklist veml6075" | sudo tee /etc/modprobe.d/blacklist-veml6075.conf
sudo rmmod veml6075 2>/dev/null
sudo update-initramfs -u

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.