pinctrl: check the return value of pinmux_ops::get_function_name()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ f913cfce4ee49a3382a9ff95696f49a46e56e974 · < 688c688e0bf55824f4a38f8c2180046f089a3e3b| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel's pinctrl code can pass a NULL function name to strcmp() when adding new pinfunctions, causing a NULL pointer dereference. The input does not establish whether an attacker can trigger this behavior or specify any access or user-interaction requirements.
Engineers running the Linux kernel should check whether their kernel includes the affected pinctrl code; affected versions were not provided.