diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-06-27 14:12:34 -0700 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2016-08-07 21:58:58 -0400 |
commit | a9d39310cf41fe1306c18730c98ca2c3355fcb0c (patch) | |
tree | a04fc3c1141255dfcc714884c37700698aa31c1b /include/crypto/aes.h | |
parent | e18fa5ad02a5920c8582c6e0401ba4f570ede8a0 (diff) |
tty/vt/keyboard: fix OOB access in do_compute_shiftstate()
[ Upstream commit 510cccb5b0c8868a2b302a0ab524da7912da648b ]
The size of individual keymap in drivers/tty/vt/keyboard.c is NR_KEYS,
which is currently 256, whereas number of keys/buttons in input device (and
therefor in key_down) is much larger - KEY_CNT - 768, and that can cause
out-of-bound access when we do
sym = U(key_maps[0][k]);
with large 'k'.
To fix it we should not attempt iterating beyond smaller of NR_KEYS and
KEY_CNT.
Also while at it let's switch to for_each_set_bit() instead of open-coding
it.
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'include/crypto/aes.h')
0 files changed, 0 insertions, 0 deletions