HID: picolcd: prevent NULL pointer dereference in picolcd_send_and_wait()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ fabdbf2fd22fa170b4c5340dbdda5c8cd88fb205 · < d354e523c6f740db758cafcd4c11bb7913285ed8| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
HID: picolcd: prevent NULL pointer dereference in picolcd_send_and_wait()
In picolcd_send_and_wait(), an integer overflow of the signed loop counter 'k' can theoretically lead to a NULL pointer dereference of 'raw_data'. If the loop executes more than INT_MAX times, 'k' becomes negative, making the condition 'k < size' true even when 'size' is 0.
Change the type of 'k' to 'unsigned int' to prevent the overflow and eliminate the out-of-bounds access.
Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool.
[jkosina@suse.com: extended hash length]
From the CVE record · Linux
In the Linux kernel’s picolcd_send_and_wait() function, a signed loop counter can theoretically overflow after more than INT_MAX iterations, leading to a NULL pointer dereference. The input does not identify an attacker path or specify whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with the HID picolcd component should check their versions; affected versions are not specified.