[PATCH v5 0/2] gpiolib: acpi: Add bounds-checking and address validation
From: Marco Scardovi
Date: Tue Jun 02 2026 - 07:46:26 EST
Hi all,
after some thinking and following Mika and Andy's reviews I've come up with
a new version of the series.
This series adds defensive hardening in the ACPI GPIO path, focusing on
bounds checking and safe handling of GPIO resources and ACPI addresses.
Drop the previously proposed GPIO connection handling changes in the ACPI
OperationRegion path, following review feedback.
This also closes the old threads completely and drop my @gmail account
as it is not related to my linux stuffs.
Changes in v5:
* Add bounds checking for GPIO pin resource accesses in ACPI GPIO helpers
to prevent out-of-bounds access on malformed or empty pin tables.
* Validate ACPI address in acpi_gpio_adr_space_handler() before converting
it to a GPIO index, preventing truncation-induced wraparound.
* Improve type safety and overflow handling in length calculation and loop
bounds in the OperationRegion handler.
Changes in v4:
* Dropped connection resource leak fix to keep focus on validation.
* See v4 series at:
https://lore.kernel.org/linux-gpio/20260531120816.17255-1-scardracs@xxxxxxxxxxx/
Changes in v3:
* Fixed global over-cleanup bug in OpRegion error path.
* See v3 series at:
https://lore.kernel.org/linux-gpio/20260520074955.55443-1-mscardovi95@xxxxxxxxx/
Changes in v2:
* Dropped gpiolib-acpi-core.c modularization (out of scope).
* Split series into bounds checking and address truncation fixes.
* See v2 series at:
https://lore.kernel.org/linux-gpio/20260519070039.9280-1-mscardovi95@xxxxxxxxx/
Changes in v1:
* Initial ACPI GPIO hardening series.
Marco Scardovi (2):
gpiolib: acpi: Add robust bounds-checking for GPIO pin resources
gpiolib: acpi: prevent address truncation in OperationRegion handler
drivers/gpio/gpiolib-acpi-core.c | 40 +++++++++++++++++++++++++-------
1 file changed, 32 insertions(+), 8 deletions(-)
--
2.54.0