diff options
| author | Dmitry Torokhov <[email protected]> | 2016-06-27 21:12:34 +0000 |
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2016-07-21 00:50:23 +0000 |
| commit | 510cccb5b0c8868a2b302a0ab524da7912da648b (patch) | |
| tree | 3b56ec2823c7b2757d1dea1c97b3b02a4595f7c4 /fs/jbd2/commit.c | |
| parent | Input: synaptics-rmi4 - fix maximum size check for F12 control register 8 (diff) | |
| download | kernel-510cccb5b0c8868a2b302a0ab524da7912da648b.tar.gz kernel-510cccb5b0c8868a2b302a0ab524da7912da648b.zip | |
tty/vt/keyboard: fix OOB access in do_compute_shiftstate()
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 <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Cc: [email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
Diffstat (limited to 'fs/jbd2/commit.c')
0 files changed, 0 insertions, 0 deletions
