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

From: Greg KH

Date: Tue Sep 08 2026 - 07:02:02 EST


On Mon, Sep 07, 2026 at 08:50:01PM +0200, Miguel Garcia wrote:
> From: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
>
> 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 <pengpeng@xxxxxxxxxxx>
> Link: https://patch.msgid.link/20260329001711.88076-1-pengpeng@xxxxxxxxxxx
> [dtor: fix macro fallback in report 5s to use -1]
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
> (cherry picked from commit 95dffe32a66cbed07fbfa7afed39d56d5014e04f)
> Signed-off-by: Miguel Garcia <miguelgarciaroman8@xxxxxxxxx>
> ---
> 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