Thread (8 messages) 8 messages, 4 authors, 2026-09-09

Re: [PATCH 6.6.y] Input: aiptek - validate raw macro indices before updating state

flat view

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2026-09-08 10:51:57
Also in: lkml, stable

On Mon, Sep 07, 2026 at 08:50:01PM +0200, Miguel Garcia wrote:
From: Pengpeng Hou <redacted>

aiptek_irq() derives macro key indices directly from tablet reports and
then uses them to index macroKeyEvents[]. Report types 4 and 5 also save
the derived value in aiptek->lastMacro and later use that state to
release the previous key.

Validate the raw macro index once before it enters that state machine, so
lastMacro only ever stores an in-range macro key. Keep direct bounds
checks for report type 6, which reads the macro number from the packet
body and uses it immediately.

Signed-off-by: Pengpeng Hou <redacted>
Link: https://patch.msgid.link/20260329001711.88076-1-pengpeng@iscas.ac.cn (local)
[dtor: fix macro fallback in report 5s to use -1]
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
(cherry picked from commit 95dffe32a66cbed07fbfa7afed39d56d5014e04f)
Signed-off-by: Miguel Garcia <redacted>
---
 drivers/input/tablet/aiptek.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
What about 6.12.y and 6.18.y?

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help