]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 26 Nov 2019 12:16:21 +0000 (13:16 +0100)
commite1e4383acffcbbf7e0255422106fbd4ad8dac933
tree243d329f0a147565d4c40169ddb66e1e27e3726d
parent8dc7a939c00c19e841ea783efb819d0329ecbcbc
Input: synaptics-rmi4 - do not consume more data than we have (F11, F12)

BugLink: https://bugs.launchpad.net/bugs/1853915
commit 5d40d95e7e64756cc30606c2ba169271704d47cb upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/input/rmi4/rmi_f11.c
drivers/input/rmi4/rmi_f12.c