]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Input: ims-pcu - fix potential infinite loop in CDC union descriptor parsing
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 23 May 2026 04:42:39 +0000 (21:42 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 7 Jun 2026 04:05:17 +0000 (21:05 -0700)
commitd4579af29e67ca8722db0a1194227f8015c8981d
treef23b127e1ec0e14be4f90b837c965779d76dbdc7
parent48c9d92fd4ee3a8f5d2cb46c802a0eff8e67c79c
Input: ims-pcu - fix potential infinite loop in CDC union descriptor parsing

The driver parses CDC union descriptors in ims_pcu_get_cdc_union_desc()
by iterating through the extra descriptor data. However, it does not
verify that the bLength of each descriptor is at least 2. A malicious
device could provide a descriptor with bLength = 0, leading to an
infinite loop in the driver.

Add a check to ensure bLength is at least 2 before proceeding with
parsing.

Fixes: 628329d52474 (Input: add IMS Passenger Control Unit driver)
Cc: stable@vger.kernel.org
Assisted-by: Gemini:gemini-3.1-pro
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/ims-pcu.c