summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorLiu Chao <liuc63@xiaopeng.com>2026-11-06 15:51:29 +0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2026-11-08 23:14:46 -0800
commitb3249e446d47c65dc09611705ad4d0a7587405ac (patch)
treebd7f62f75e107602954c5863752b0782ad78f80a /tools/perf/scripts/python
parentd1eb0afa9140c740ff29985f9b89b1926b1b502d (diff)
Input: goodix - reject a bak_ref length that cannot hold the checksum
driver_num and sensor_num are taken from the touchscreen config. A config with driver_num 1 and sensor_num 0 yields a bak_ref length of 0, for which devm_kzalloc() returns ZERO_SIZE_PTR. That pointer passes the !ts->bak_ref check and the subsequent ts->bak_ref[ts->bak_ref_len - 1] = 1 writes before the allocation. Reject a length that leaves no room for the trailing checksum before allocating, and skip saving a bak_ref that was never allocated. Without the second check a rejected length leaves bak_ref NULL while bak_ref_len still holds the bogus value, and goodix_save_bak_ref() then writes through the same index on suspend. Fixes: 09182ed20c04 ("Input: goodix - add support for controllers without flash") Cc: stable@vger.kernel.org Signed-off-by: Liu Chao <liuc63@xiaopeng.com> Link: https://patch.msgid.link/20261106075129.3106093-1-liuc63@xiaopeng.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions