CVE-2022-50131

HID: mcp2221: prevent a buffer overflow in mcp_smbus_write()

HIGH
7.8
CVSS Score
Published: June 18, 2025 at 11:02 AM UTC
Updated: August 5, 2026 at 09:24 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.8
Exploit prediction
EPSS 0.2%

Description

In the Linux kernel, the following vulnerability has been resolved: HID: mcp2221: prevent a buffer overflow in mcp_smbus_write() Smatch Warning: drivers/hid/hid-mcp2221.c:388 mcp_smbus_write() error: __memcpy() '&mcp->txbuf[5]' too small (59 vs 255) drivers/hid/hid-mcp2221.c:388 mcp_smbus_write() error: __memcpy() 'buf' too small (34 vs 255) The 'len' variable can take a value between 0-255 as it can come from data->block[0] and it is user data. So add an bound check to prevent a buffer overflow in memcpy().

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

5.11 ≤ v < 5.15.615.16 ≤ v < 5.18.185.19 ≤ v < 5.19.25.7 ≤ v < 5.10.1375.7 ≤ v < 5.15.615.7 ≤ v < 5.18.185.7 ≤ v < 5.19.25.7 ≤ v < 6.05.767a95c21463d066060b0f66d65a75d45bb386ffb
Vendor states this is fixed in 3c0f8a59f2cc8841ee6653399a77f4f3e6e9a270 (fixed)
Vendor states this is fixed in 62ac2473553a00229e67bdf3cb023b62cf7f5a9a (fixed)
Vendor states this is fixed in 6402116a7b5ec80fa40fd145a80c813019cd555f (fixed)
Vendor states this is fixed in 66c8e816f2f2ca4a61b406503bd10bad1b35f72f (fixed)
Vendor states this is fixed in 91443c669d280937968f0aa4edefa741cfe35314 (fixed)
Vendor states this is fixed in 5.10.137 (unaffected)
Vendor states this is fixed in 5.15.61 (unaffected)
Vendor states this is fixed in 5.18.18 (unaffected)
Vendor states this is fixed in 5.19.2 (unaffected)
Vendor states this is fixed in 5.7 (unaffected)
Vendor states this is fixed in 6.0 (unaffected)

References (5)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/3c0f8a59f2cc8841ee6653399a77f4f3e6e9a270
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/62ac2473553a00229e67bdf3cb023b62cf7f5a9a
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/6402116a7b5ec80fa40fd145a80c813019cd555f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/66c8e816f2f2ca4a61b406503bd10bad1b35f72f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/91443c669d280937968f0aa4edefa741cfe35314

CVSS

7.8HIGHLinux
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-787

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card