Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1393F23C8AE for ; Fri, 24 Apr 2026 14:45:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777041923; cv=none; b=GOCQTCHLXvWiqNphZyaf7XC7vm5ihhF6qY1oA/zk73IeLOR+/hkCrz3smpD+2PvR18r/sTqu8GDyi4jTUs4dUeg45y2j78rmBXKbAuANPIYG3JUW0pZVX5PhFEnUmt39/RtrJSunS2A1DoO2EaN4OYrz7Oig/wNK+ccVKoncP3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777041923; c=relaxed/simple; bh=2dwYHYJzgzevxqIzKsuEtG7dcjdb3fRLOwt0C1d9Atg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=aafxAE91hdih1E/IhPedUWS/mXhrnxs99WTBF1UP0E5i0F54TnP2eyaLhm8PYiH1xOG6QpLHFVzIXaiKczJvEAI5UB7mKT4BEDT9ot7zzJ94W4rW7JOPOhem0AalbY9s53quLm84Zww1ZPzQm7/99BOCqU4SpbELTX7bADHXhUo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QN/UW5De; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QN/UW5De" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C3EDC19425; Fri, 24 Apr 2026 14:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777041922; bh=2dwYHYJzgzevxqIzKsuEtG7dcjdb3fRLOwt0C1d9Atg=; h=From:To:Cc:Subject:Date:Reply-To:From; b=QN/UW5DehfNVgtrwHCuM4etBMUzmtthYnEPt0Vt2D4WaOVK6a0dbW/Sw4G3/O5yvV O2ItFDIysMlCd8GVOW+s+CF44284rW0P2IiEATX4aVM5yXtmgh5gI/VnzxDISopkF8 tdP4YyqzknTu3eYIzJN4rpgeFp2OyOxD+/vRCgyk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-31624: HID: core: clamp report_size in s32ton() to avoid undefined shift Date: Fri, 24 Apr 2026 16:44:00 +0200 Message-ID: <2026042426-CVE-2026-31624-e19a@gregkh> X-Mailer: git-send-email 2.53.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2678; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=0cLxuA5oioPzX9aXICQfTKLen1KjQ4hSZD391nvkxpg=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmvG/uS3sgFNqmbd/ivOaY7P/w1y4Td153yDt36/OdM3 MOC8Pl1HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCR67cY5lksLXHZa7fmsbqp 1MvJ0j/nzWpO2sewYOH58rlpl9h8WtrmHjXduOFj4s3k/wA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: HID: core: clamp report_size in s32ton() to avoid undefined shift s32ton() shifts by n-1 where n is the field's report_size, a value that comes directly from a HID device. The HID parser bounds report_size only to <= 256, so a broken HID device can supply a report descriptor with a wide field that triggers shift exponents up to 256 on a 32-bit type when an output report is built via hid_output_field() or hid_set_field(). Commit ec61b41918587 ("HID: core: fix shift-out-of-bounds in hid_report_raw_event") added the same n > 32 clamp to the function snto32(), but s32ton() was never given the same fix as I guess syzbot hadn't figured out how to fuzz a device the same way. Fix this up by just clamping the max value of n, just like snto32() does. The Linux kernel CVE team has assigned CVE-2026-31624 to this issue. Affected and fixed versions =========================== Fixed in 6.12.83 with commit 58386f00af710922cafb0fb69211497beddfaa95 Fixed in 6.18.24 with commit 8a8333237f1f5caab8d4c3d2c2e7578c4263a97f Fixed in 6.19.14 with commit ea363a34086ddb4231adc581a7f36c39ec154bfc Fixed in 7.0.1 with commit 97014719bb8fccb1ffcbbc299e84b1f11b114195 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2026-31624 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/hid/hid-core.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/58386f00af710922cafb0fb69211497beddfaa95 https://git.kernel.org/stable/c/8a8333237f1f5caab8d4c3d2c2e7578c4263a97f https://git.kernel.org/stable/c/ea363a34086ddb4231adc581a7f36c39ec154bfc https://git.kernel.org/stable/c/97014719bb8fccb1ffcbbc299e84b1f11b114195 https://git.kernel.org/stable/c/69c02ffde6ed4d535fa4e693a9e572729cad3d0d