summaryrefslogtreecommitdiff
path: root/lib/flex_array.c
diff options
context:
space:
mode:
authorWill McVicker <willmcvicker@google.com>2020-12-05 00:48:48 +0000
committerGerrit - the friendly Code Review server <code-review@localhost>2021-06-10 01:39:43 -0700
commitf363c474b5f0006e760ef277369fbbb52c34f781 (patch)
treef2e4dbea08622321c99a94062feba5b0b655daef /lib/flex_array.c
parent44a1037e726f9089905743fce40f10a2c9f7413d (diff)
HID: make arrays usage and value to be the same
The HID subsystem allows an "HID report field" to have a different number of "values" and "usages" when it is allocated. When a field struct is created, the size of the usage array is guaranteed to be at least as large as the values array, but it may be larger. This leads to a potential out-of-bounds write in __hidinput_change_resolution_multipliers() and an out-of-bounds read in hidinput_count_leds(). To fix this, let's make sure that both the usage and value arrays are the same size. Cc: stable@vger.kernel.org Signed-off-by: Will McVicker <willmcvicker@google.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Change-Id: I8e1a5c776e76b592ce53612c2022829b123779d6 Git-commit: ed9be64eefe26d7d8b0b5b9fa3ffdf425d87a01f Git-repo: https://android.googlesource.com/kernel/common Signed-off-by: Uppala Revanth Kumar <urevanth@codeaurora.org>
Diffstat (limited to 'lib/flex_array.c')
0 files changed, 0 insertions, 0 deletions