mbox series

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

Message ID 20200817112700.468743-1-maz@kernel.org (mailing list archive)
Headers show
Series input/hid: Fix bitmap boundary validation | expand

Message

Marc Zyngier Aug. 17, 2020, 11:26 a.m. UTC
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(-)