Linux Kernel Cros Ec Keyboard Driver Invalid Memory Access Vulnerability

Vulnerability

A vulnerability has been identified in the Linux kernel's Cros EC keyboard driver, specifically in the handling of key matrix events. When the function 'cros_ec_keyb_register_matrix()' is not called due to the 'buttons_switches_only' condition, the device input interface remains uninitialized. This oversight leads to an invalid memory access in 'cros_ec_keyb_process()', triggered by an 'EC_MKBP_EVENT_KEY_MATRIX' event. The kernel attempts to read from a virtual memory address that is not accessible, causing a fault. The issue arises because the driver does not properly initialize the necessary components before processing events, leaving the system vulnerable to memory access violations.

Impact

Exploitation of this vulnerability causes a kernel panic due to an invalid memory access, where the kernel tries to read from an unreadable memory address, leading to a crash.

Reproduction

To reproduce this vulnerability, load the Cros EC keyboard driver without initializing the key matrix registration. This can be done by setting the 'buttons_switches_only' option, which prevents the 'cros_ec_keyb_register_matrix()' function from being called during the probe process. Once the driver is loaded under these conditions, the vulnerability can be triggered by sending an 'EC_MKBP_EVENT_KEY_MATRIX' event to the driver, which will result in the kernel attempting to read from an invalid memory address and causing a crash.

Remediation

Users can ensure that the Cros EC keyboard driver properly initializes the key matrix by avoiding the 'buttons_switches_only' condition when loading the driver.

Added: Dec 4, 2025, 4:28 PM
Updated: Dec 4, 2025, 5:29 PM

Vulnerability Rating

Custom Algorithm
spread
9.0
impact
2.5
exploitability
4.3
remediation
7.7
relevance
1.2
threat
4.8
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.