CVE-2022-48978: HID: core: fix shift-out-of-bounds in hid_report_raw_event

Published Oct 21, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

HID: core: fix shift-out-of-bounds in hidreportrawevent

Syzbot reported shift-out-of-bounds in hidreportrawevent.

microsoft 0003:045E:07DA.0001: hidfieldextract() called with n (128) > 32! (swapper/0) ====================================================================== UBSAN: shift-out-of-bounds in drivers/hid/hid-core.c:1323:20 shift exponent 127 is too large for 32-bit type 'int' CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.1.0-rc4-syzkaller-00159-g4bbf3422df78 #0 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: <IRQ> dumpstack lib/dumpstack.c:88 [inline] dumpstacklvl+0x1e3/0x2cb lib/dumpstack.c:106 ubsanepilogue lib/ubsan.c:151 [inline] ubsanhandleshiftoutofbounds+0x3a6/0x420 lib/ubsan.c:322 snto32 drivers/hid/hid-core.c:1323 [inline] hidinputfetchfield drivers/hid/hid-core.c:1572 [inline] hidprocessreport drivers/hid/hid-core.c:1665 [inline] hidreportrawevent+0xd56/0x18b0 drivers/hid/hid-core.c:1998 hidinputreport+0x408/0x4f0 drivers/hid/hid-core.c:2066 hidirqin+0x459/0x690 drivers/hid/usbhid/hid-core.c:284 usbhcdgivebackurb+0x369/0x530 drivers/usb/core/hcd.c:1671 dummytimer+0x86b/0x3110 drivers/usb/gadget/udc/dummyhcd.c:1988 calltimerfn+0xf5/0x210 kernel/time/timer.c:1474 expiretimers kernel/time/timer.c:1519 [inline] runtimers+0x76a/0x980 kernel/time/timer.c:1790 runtimersoftirq+0x63/0xf0 kernel/time/timer.c:1803 dosoftirq+0x277/0x75b kernel/softirq.c:571 irqexitrcu+0xec/0x170 kernel/softirq.c:650 irqexitrcu+0x5/0x20 kernel/softirq.c:662 sysvecapictimerinterrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1107 ======================================================================

If the size of the integer (unsigned n) is bigger than 32 in snto32(), shift exponent will be too large for 32-bit type 'int', resulting in a shift-out-of-bounds bug. Fix this by adding a check on the size of the integer (unsigned n) in snto32(). To add support for n greater than 32 bits, set n to 32, if n is greater than 32.

Affected Software

15 affected components
Linux Linux kernel>=2.6.20<4.9.336
Linux Linux kernel>=4.10<4.14.302
Linux Linux kernel>=4.15<4.19.269
Linux Linux kernel>=4.20<5.4.227
Linux Linux kernel>=5.5<5.10.159
Linux Linux kernel>=5.11<5.15.83
Linux Linux kernel>=5.16<6.0.13
Linux Linux kernel=6.1-rc1
Linux Linux kernel=6.1-rc2
Linux Linux kernel=6.1-rc3
Linux Linux kernel=6.1-rc4
Linux Linux kernel=6.1-rc5
Linux Linux kernel=6.1-rc6
Linux Linux kernel=6.1-rc7
Linux Linux kernel=6.1-rc8

Event History

Oct 21, 2024
CVE Published
via MITRE·08:05 PM
Data Sourced
via MITRE·08:05 PM
Description
Data Sourced
via Red Hat·09:01 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-48978?

CVE-2022-48978 has been classified with a high severity due to the potential for out-of-bounds memory access.

2

How do I fix CVE-2022-48978?

To fix CVE-2022-48978, users should update their Linux kernel to a patched version as specified by the maintainers.

3

What versions of the Linux kernel are affected by CVE-2022-48978?

CVE-2022-48978 affects various versions of the Linux kernel ranging from 2.6.20 to 6.1-rc8.

4

What does CVE-2022-48978 exploit?

CVE-2022-48978 exploits a shift-out-of-bounds vulnerability in the hid_report_raw_event function within the Linux kernel.

5

Is CVE-2022-48978 remotely exploitable?

CVE-2022-48978 does not appear to be easily exploitable remotely but can lead to local privilege escalation if successfully executed.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203