Re: [PATCH 02/10] Input: adi - validate axis and button counts in adi_id_decode()

From: Dmitry Torokhov

Date: Mon Nov 30 2026 - 00:42:39 EST


On Fri, Nov 27, 2026 at 08:09:56PM +0000, Lee Jones wrote:
> Reject packets that would underflow axes10 or buttons, and verify that
> the decoded axis and button counts fit within the corresponding
> adi_abs and adi_key table sizes.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Closes: https://sashiko.dev/#/bug/linux-92046c21-e0a8-4274-a502-20ca723131b1
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>

Adding two more parallel arrays to track table lengths next to the
existing three is pretty awkward, and the "adi->buttons < 4" check is
also slightly loose since it still leaves adi->pad unreachable in
adi_decode() when buttons is 4..8 on TPD or 4 on WGP.

As mentioned on patch 1, I already have a larger adi rework that replaces
the parallel arrays with a single descriptor table (along with other
fixes and cleanups), and I do not think this needs a stable tag either
given how few systems still have gameport adapters. I will post my series
shortly and CC you on it.

Thanks.

--
Dmitry