CVE-2022-50156

HID: cp2112: prevent a buffer overflow in cp2112_xfer()

HIGH
7.8
CVSS Score
Published: June 18, 2025 at 11:03 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: cp2112: prevent a buffer overflow in cp2112_xfer() Smatch warnings: drivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy() 'data->block[1]' too small (33 vs 255) drivers/hid/hid-cp2112.c:793 cp2112_xfer() error: __memcpy() 'buf' too small (64 vs 255) The 'read_length' variable is provided by 'data->block[0]' which comes from user and it(read_length) can take a value between 0-255. Add an upper bound to 'read_length' variable to prevent a buffer overflow in memcpy().

Affected

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

4.15 ≤ v < 4.19.2564.15 ≤ v < 5.10.1374.15 ≤ v < 5.15.614.15 ≤ v < 5.18.184.15 ≤ v < 5.19.24.15 ≤ v < 5.4.2114.15 ≤ v < 6.04.15.1 ≤ v < 4.19.2564.20 ≤ v < 5.4.2115.11 ≤ v < 5.15.615.16 ≤ v < 5.18.185.19 ≤ v < 5.19.25.5 ≤ v < 5.10.1374.154.15 rc64.15 rc74.15 rc84.15 rc9542134c0375b5ca2b1d18490c02b8a20bfdd8d74
Vendor states this is fixed in 26e427ac85c2b8d0d108cc80b6de34d33e2780c4 (fixed)
Vendor states this is fixed in 381583845d19cb4bd21c8193449385f3fefa9caf (fixed)
Vendor states this is fixed in 3af7d60e9a6c17d6d41c4341f8020511887d372d (fixed)
Vendor states this is fixed in 519ff31a6ddd87aa4905bd9bf3b92e8b88801614 (fixed)
Vendor states this is fixed in 8489a20ac481b08c0391608d81ed3796d373cfdf (fixed)
Vendor states this is fixed in e7028944e61014ae915e7fb74963d3835f2f761a (fixed)
Vendor states this is fixed in ebda3d6b004bb6127a66a616524a2de152302ca7 (fixed)
Vendor states this is fixed in 4.15 (unaffected)
Vendor states this is fixed in 4.19.256 (unaffected)
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.4.211 (unaffected)
Vendor states this is fixed in 6.0 (unaffected)

References (7)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/26e427ac85c2b8d0d108cc80b6de34d33e2780c4
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/381583845d19cb4bd21c8193449385f3fefa9caf
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/3af7d60e9a6c17d6d41c4341f8020511887d372d
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/519ff31a6ddd87aa4905bd9bf3b92e8b88801614
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/8489a20ac481b08c0391608d81ed3796d373cfdf
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e7028944e61014ae915e7fb74963d3835f2f761a
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/ebda3d6b004bb6127a66a616524a2de152302ca7

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