Re: [PATCH v2 1/1] gpiolib: acpi: Fix potential out-of-boundary left shift
From: Bartosz Golaszewski
Date: Wed Jan 28 2026 - 04:03:43 EST
On Tue, 27 Jan 2026 12:06:30 +0100, Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> said:
> GPIO Address Space handler gets a pointer to the in or out value.
> This value is supposed to be at least 64-bit, but it's not limited
> to be exactly 64-bit. When ACPI tables are being parsed, for
> the bigger Connection():s ACPICA creates a Buffer instead of regular
> Integer object. The Buffer exists as long as Namespace holds
> the certain Connection(). Hence we can access the necessary bits
> without worrying. On the other hand, the left shift, used in
> the code, is limited by 31 (on 32-bit platforms) and otherwise
> considered to be Undefined Behaviour. Also the code uses only
> the first 64-bit word for the value, and anything bigger than 63
> will be also subject to UB. Fix all this by modifying the code
> to correctly set or clear the respective bit in the bitmap constructed
> of 64-bit words.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
> v2: added a comment, named variables differently (Mika), rebased on top of accepted patch
Should I take it for v6.19? Fixes:? Cc: stable?
Bart