CVE-2025-40030
kernel: pinctrl: check the return value of pinmux_ops::get_function_name()
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · October 28, 2025
Updated · June 30, 2026
Description
In the Linux kernel, the following vulnerability has been resolved:
pinctrl: check the return value of pinmux_ops::get_function_name()
While the API contract in docs doesn't specify it explicitly, the generic implementation of the get_function_name() callback from struct pinmux_ops - pinmux_generic_get_function_name() - can fail and return NULL. This is already checked in pinmux_check_ops() so add a similar check in pinmux_func_name_to_selector() instead of passing the returned pointer right down to strcmp() where the NULL can get dereferenced. This is normal operation when adding new pinfunctions.
Statement
The patch fixes a potential NULL pointer dereference in pinmux_func_name_to_selector() when pinmux_ops::get_function_name() returns NULL (e.g., during addition of new pin functions). Without this check, strcmp() could access an invalid pointer, leading to a kernel oops during driver initialization. No remote or unprivileged attack surface: impact limited to local crash when loading or probing faulty pinctrl drivers.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 5.5CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CWE-476 · NULL Pointer Dereference