# CVE-2026-31624: HID: core: clamp report\_size in s32ton() to avoid undefined shift

- Priority: **Routine**
- Reason: Not severe (CVSS 5.5, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-04-24 · Modified: 2026-11-06
- Aliases: UBUNTU-CVE-2026-31624, DEBIAN-CVE-2026-31624, CGA-55mc-6m24-g5cq, CGA-689j-c5q6-25mx, CGA-6pc8-mj6q-6pr7, CGA-7qpx-wf4r-wgg3, CGA-9hfp-h4h8-jpvm, CGA-9x2w-v5g9-435h, CGA-fhm4-j673-cxx5, CGA-fw4f-v5mj-3gqp, CGA-j4v3-g446-g2j4, CGA-w2mg-vjjv-p4cq
- Record: https://cvemate.com/vulnerability/CVE-2026-31624 · JSON: https://cvemate.com/vulnerability/CVE-2026-31624/json

## Description

```text
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.
```

## Signals

- CVSS: 5.5 medium (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.134%, percentile 3.091%, as of 2026-12-05
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 172)

- chainguard linux-aws-6.12 (Chainguard): \< 6.12.85-r0
- chainguard linux-aws-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-azure-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-gcp-6.12 (Chainguard): \< 6.12.85-r0
- chainguard linux-gcp-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-qemu-6.12 (Chainguard): \< 6.12.85-r0
- chainguard linux-qemu-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-qemu-6.18-bootc-boot-installed (Chainguard): \< 6.18.31-r0
- chainguard linux-vmware-6.12 (Chainguard): \< 6.12.85-r0
- chainguard linux-vmware-6.18 (Chainguard): \< 6.18.31-r0
- debian linux (Debian): \< 6.1.176-1 \| \< 6.12.85-1 \| \< 6.19.14-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-186.196 \| \< 6.8.0-136.136 \| \< 7.0.0-27.27
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1112.119 \| \< 6.8.0-1061.64 \| \< 7.0.0-1008.8
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1112.119~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 47)

- <https://git.kernel.org/stable/c/76ad02854a30c394e0c076e6e6bed0a388573a94>
- <https://git.kernel.org/stable/c/eb415ddaf25e09ddb8fe5736a70c9de2e6462534>
- <https://git.kernel.org/stable/c/0ab048dbdb1daacf17d52e9252297eb6e1298e49>
- <https://git.kernel.org/stable/c/932ae5309e53561197aa7d1606c7cf63af10e24f>
- <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>
- <https://ubuntu.com/security/CVE-2026-31624>
- <https://www.cve.org/CVERecord?id=CVE-2026-31624>
- <https://git.kernel.org/linus/69c02ffde6ed4d535fa4e693a9e572729cad3d0d>
- <https://ubuntu.com/security/notices/USN-8488-1>
- <https://ubuntu.com/security/notices/USN-8488-2>
- <https://ubuntu.com/security/notices/USN-8507-1>
- <https://ubuntu.com/security/notices/USN-8569-1>
- <https://ubuntu.com/security/notices/USN-8567-1>
- <https://ubuntu.com/security/notices/USN-8574-1>
- <https://ubuntu.com/security/notices/USN-8575-1>
- <https://ubuntu.com/security/notices/USN-8576-1>

---

Data as of 2026-12-05T14:09:56.025Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
