Re: [PATCH] gpio: ljca: Validate the pin index of interrupt events

From: Bartosz Golaszewski

Date: Tue Nov 17 2026 - 05:21:00 EST



On Fri, 13 Nov 2026 14:44:58 +0000, Alexandre Becholey wrote:
> ljca_gpio_event_cb() takes the pin index of every item in a GPIO
> interrupt event from the device and passes it to set_bit() on the
> reenable_irqs bitmap, which is only LJCA_MAX_GPIO_NUM (64) bits long.
> The index is a u8, so a malfunctioning or malicious device can set
> bits past the end of the bitmap, in the members that follow it in
> struct ljca_gpio_dev: the output_enabled bitmap, the connect_mode
> pointer and the irq_lock mutex. connect_mode is later dereferenced and
> written to by ljca_gpio_set_config() and ljca_irq_set_type(), so the
> device can flip bits of a kernel pointer that is then used for a write.
>
> [...]

If you have an LLM write the commit messages, please ask it to be more concise,
half the stuff in this commit message is just slop.

Applied, thanks!

[1/1] gpio: ljca: Validate the pin index of interrupt events
https://git.kernel.org/brgl/c/e6e2181c6920ff59ded349a100f80cf85d074601

Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>