linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1]  gpiolib: Zero structure which will be returned to usermode to avoid kernel info leak.
@ 2021-06-16 21:51 Gabriel Knezek
       [not found] ` <CAHp75VeXQeVRorGNFT0jZ=GYAqii8oDqXDkvegCUOxz4jk-fSA@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Gabriel Knezek @ 2021-06-16 21:51 UTC (permalink / raw)
  To: Kent Gibson; +Cc: Bartosz Golaszewski, linux-gpio@vger.kernel.org

Apologies if I got this slightly wrong; this is actually my first time submitting a patch to the kernel. (:

Thanks.
-Gabe

Fixes: aad95584 ("gpiolib: cdev: support GPIO_V2_GET_LINEINFO_IOCTL and GPIO_V2_GET_LINEINFO_WATCH_IOCTL")
Signed-off-by: Gabriel Knezek <gabeknez@microsoft.com>
---
 drivers/gpio/gpiolib-cdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
index ee5903aac497..af68532835fe 100644
--- a/drivers/gpio/gpiolib-cdev.c
+++ b/drivers/gpio/gpiolib-cdev.c
@@ -1865,6 +1865,7 @@ static void gpio_v2_line_info_changed_to_v1(
                struct gpio_v2_line_info_changed *lic_v2,
                struct gpioline_info_changed *lic_v1)
 {
+       memset(lic_v1, 0, sizeof(*lic_v1));
        gpio_v2_line_info_to_v1(&lic_v2->info, &lic_v1->info);
        lic_v1->timestamp = lic_v2->timestamp_ns;
        lic_v1->event_type = lic_v2->event_type;
--
2.25.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-18  1:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-16 21:51 [PATCH 1/1] gpiolib: Zero structure which will be returned to usermode to avoid kernel info leak Gabriel Knezek
     [not found] ` <CAHp75VeXQeVRorGNFT0jZ=GYAqii8oDqXDkvegCUOxz4jk-fSA@mail.gmail.com>
2021-06-18  1:33   ` Kent Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).