Re: [PATCH v3] gpio: cdev: fix kernel stack leak to user-space in error path
From: Bartosz Golaszewski
Date: Wed Sep 23 2026 - 03:16:56 EST
On Tue, 22 Sep 2026 10:52:28 +0200, Bartosz Golaszewski wrote:
> If we fail to acquire the GPIO chip guard in gpio_desc_to_lineinfo(), we
> return immediately before zeroing the info struct we'll end up passing
> to the user-space later in lineinfo_get_v1(). This may leak the kernel
> stack contents. Make gpio_desc_to_lineinfo() return int so that the
> -ENODEV returned on failure to acquire the guard can be propagated to
> the callers.
>
> [...]
Applied, thanks!
[1/1] gpio: cdev: fix kernel stack leak to user-space in error path
https://git.kernel.org/brgl/c/1feb5d39b05afd902ed9fc902ec5b15be03a4bdb
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>