Re: [PATCH 1/2] gpio: virtio: bound the line names block by its configured size

From: Bartosz Golaszewski

Date: Tue Nov 17 2026 - 03:28:59 EST



On Thu, 05 Nov 2026 04:56:31 +0900, Lianjie Wang wrote:
> virtio_gpio_get_names() walks the line names that the device returns in
> a block of gpio_names_size bytes, which the driver ends with a NUL, and
> checks each name only after stepping past it. If the block holds fewer
> than ngpio names, the walk reaches the end of the block after the last
> name, and the next iteration starts strlen() at the byte after the
> allocation. With a block that holds one name for four lines, KASAN
> reports:
>
> [...]

Applied, thanks!

[1/2] gpio: virtio: bound the line names block by its configured size
https://git.kernel.org/brgl/c/74aee8e06277df39ec10ed043bae0ed5b7a83864
[2/2] gpio: virtio: compute the line names size in a size_t
https://git.kernel.org/brgl/c/9e3032dc4d92e6214ae687b4c474de9270ce74a2

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