]> git.baikalelectronics.ru Git - kernel.git/commit
Input: synaptics-rmi4 - do not consume more data than we have (F11, F12)
authorAndrew Duggan <aduggan@synaptics.com>
Tue, 5 Nov 2019 00:07:30 +0000 (16:07 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 5 Nov 2019 00:11:50 +0000 (16:11 -0800)
commit5868b0d5070803c41a0f93cf54e1b59687dc7e0f
treeddfe6d746b3120557fec0b75ec9508940a6a7acf
parent68c99d17789b9d8191e13439d2408bebc5ca229b
Input: synaptics-rmi4 - do not consume more data than we have (F11, F12)

Currently, rmi_f11_attention() and rmi_f12_attention() functions update
the attn_data data pointer and size based on the size of the expected
size of the attention data. However, if the actual valid data in the
attn buffer is less then the expected value then the updated data
pointer will point to memory beyond the end of the attn buffer. Using
the calculated valid_bytes instead will prevent this from happening.

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191025002527.3189-3-aduggan@synaptics.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/rmi4/rmi_f11.c
drivers/input/rmi4/rmi_f12.c