Skip to content

input/hid: Fix bitmap boundary validation

Marc Zyngier linux-input lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Input; Sanitize event code before modifying bitmapsdrivers/input/input.c+15 -12 replies
2/2HID: core; Sanitize event code and type before mapping inputinclude/linux/hid.h+15 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] input/hid: Fix bitmap boundary validation

It recently became apparent that some of the low-level input and hid helpers lack some form of input validation when associating an event code with their internal capability bitmap, leading to potential memory corruption.

These two patches address two occurrences of that issue, by masking out the top bits of the event code (all capability bitmaps are conveniently sized as power of twos), and spitting out a warning for further debugging.

Marc Zyngier (2):
Input; Sanitize event code before modifying bitmaps
HID: core; Sanitize event code and type before mapping input

 drivers/input/input.c | 16 +++++++++++++++-
 include/linux/hid.h   | 19 +++++++++++++++----
 2 files changed, 30 insertions(+), 5 deletions(-)
Signature · 1 line
2.27.0