Re: [PATCH v2] gpiolib: fix stack out-of-bounds access in gpiochip_add_hog()

From: Bartosz Golaszewski

Date: Thu Nov 12 2026 - 03:52:29 EST



On Tue, 10 Nov 2026 11:01:10 +0100, Bartosz Golaszewski wrote:
> In gpiochip_add_hog(), parsing a device tree with an excessively large
> "#gpio-cells" property causes a stack out-of-bounds write when populating
> the GPIO specification.
>
> The value read from #gpio-cells is used to copy the values into right
> places in struct fwnode_reference_args but that struct's args field is
> an array of size NR_FWNODE_REFERENCE_ARGS so a value larger than it will
> make the loop write past the end of that array.
>
> [...]

Applied, thanks!

[1/1] gpiolib: fix stack out-of-bounds access in gpiochip_add_hog()
https://git.kernel.org/brgl/c/f8a4fdf57cedb9cb3f47d94269ff27fea8e819e8

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