[PATCH v6 0/2] gpiolib: acpi: Add robust bounds-checking and safe address handling
From: Marco Scardovi
Date: Wed Jun 10 2026 - 12:05:09 EST
Hi all,
The series adds explicit bounds checking for GPIO pin accesses and
ensures safe handling of ACPI addresses in OperationRegion handlers,
without referring to truncation or wrap-around behavior, which does
not apply.
Changes in v6:
- Rebased onto next-20260609.
- Corrected commit messages to describe bounds checking and
safe ACPI GPIO address handling.
- Removed references to truncation or wrap-around behavior.
- No code changes compared to v5.
Changes in v5:
- Changed the types of length and loop counter 'i' to unsigned int in
acpi_gpio_adr_space_handler() to prevent signedness mismatches.
- Replaced the min() macro in the length calculation with an
overflow-safe check (bits > agpio->pin_table_length - pin_index)
to prevent integer overflow.
- See v5 series at:
https://lore.kernel.org/linux-gpio/20260602113529.52570-1-scardracs@xxxxxxxxxxx/
Changes in v4:
- Dropped the connection resource leak fix to keep the series focused
strictly on bounds-checking and address validation.
- See v4 series at:
https://lore.kernel.org/linux-gpio/20260531120816.17255-1-scardracs@xxxxxxxxxxx/
Changes in v3:
- Fixed a global over-cleanup bug in the error path of the OpRegion
handler.
- See v3 series at:
https://lore.kernel.org/linux-gpio/20260520074955.55443-1-mscardovi95@xxxxxxxxx/
Changes in v2:
- Split the original single patch into two distinct patches: one for
bounds checking in the event/wakeup path, and one for safe
handling of ACPI addresses.
- See v2 series at:
https://lore.kernel.org/linux-gpio/20260519070039.9280-1-mscardovi95@xxxxxxxxx/
Changes in v1:
- Initial submission of the refactored, hardened, and modularized
ACPI GPIO core.
- See v1 series at:
https://lore.kernel.org/linux-gpio/20260518075357.112584-1-mscardovi95@xxxxxxxxx/
Marco Scardovi (2):
gpiolib: acpi: Add robust bounds-checking for GPIO pin resources
gpiolib: acpi: Prevent out-of-bounds pin access in OperationRegion
handler
drivers/gpio/gpiolib-acpi-core.c | 38 +++++++++++++++++++++++++-------
1 file changed, 30 insertions(+), 8 deletions(-)
--
2.54.0