]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gpiolib: acpi: Add robust bounds-checking for GPIO pin resources
authorMarco Scardovi <scardracs@disroot.org>
Wed, 10 Jun 2026 15:42:03 +0000 (17:42 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Wed, 17 Jun 2026 06:14:30 +0000 (08:14 +0200)
commitdece79032f529d2c9fdbf63a9f2fc32244722775
treec7eafe453558f926d9f234cfd5e4e80dea032f53
parent86c04b2960af2aa7ad573fe11db1be0a2156ea2c
gpiolib: acpi: Add robust bounds-checking for GPIO pin resources

Ensure that GPIO pin resource arrays are safely bounded before accessing
indices. Add explicit bounds checking in acpi_request_own_gpiod(),
acpi_gpio_irq_is_wake(), and acpi_gpiochip_alloc_event() to prevent
out-of-bounds array reads if the ACPI namespace provides malformed or empty
pin tables.

This change addresses potential safety issues arising from
inconsistent or invalid ACPI pin tables. It does not alter functional
behavior in well-formed tables.

Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Marco Scardovi <scardracs@disroot.org>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://patch.msgid.link/20260610154204.110379-2-scardracs@disroot.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpiolib-acpi-core.c