Re: [PATCH] gpio: virtuser: fix one-byte overflow in lookup entry key show

From: Bartosz Golaszewski

Date: Wed Dec 02 2026 - 03:44:21 EST



On Tue, 01 Dec 2026 10:41:51 +0800, Lin Tzu Yang wrote:
> The key attribute of a lookup entry is a configfs simple attribute, so
> its store callback accepts up to 4095 bytes and keeps them in
> entry->key. The show callback then prints it with
>
> sprintf(page, "%s\n", entry->key ?: "");
>
> With a 4095-byte key this writes 4095 characters, the newline and the
> terminating NUL, 4097 bytes in total, into the 4096-byte page buffer.
> KASAN reports it as a slab-out-of-bounds write in vsnprintf() when the
> attribute is read back.
>
> [...]

Applied, thanks!

[1/1] gpio: virtuser: fix one-byte overflow in lookup entry key show
https://git.kernel.org/brgl/c/b300b1532925ead6b1faed7f952c738dec2b9f68

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