summaryrefslogtreecommitdiff
path: root/drivers/input/mouse/vsxxxaa.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2020-12-15 00:37:46 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2020-12-15 02:02:04 +0300
commitf051ae4f6c732c231046945b36234e977f8467c6 (patch)
treef46c26cb5fcd375d80940adaba6f0402db2eb622 /drivers/input/mouse/vsxxxaa.c
parent3993a1a951feba40c0fbc87c0d3a888dbb0f768f (diff)
downloadlinux-f051ae4f6c732c231046945b36234e977f8467c6.tar.xz
Input: cyapa_gen6 - fix out-of-bounds stack access
gcc -Warray-bounds warns about a serious bug in cyapa_pip_retrieve_data_structure: drivers/input/mouse/cyapa_gen6.c: In function 'cyapa_pip_retrieve_data_structure.constprop': include/linux/unaligned/access_ok.h:40:17: warning: array subscript -1 is outside array bounds of 'struct retrieve_data_struct_cmd[1]' [-Warray-bounds] 40 | *((__le16 *)p) = cpu_to_le16(val); drivers/input/mouse/cyapa_gen6.c:569:13: note: while referencing 'cmd' 569 | } __packed cmd; | ^~~ Apparently the '-2' was added to the pointer instead of the value, writing garbage into the stack next to this variable. Fixes: c2c06c41f700 ("Input: cyapa - add gen6 device module support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20201026161332.3708389-1-arnd@kernel.org Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse/vsxxxaa.c')
0 files changed, 0 insertions, 0 deletions