[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200727151537.315023-1-yepeilin.cs@gmail.com>
Date: Mon, 27 Jul 2020 11:15:37 -0400
From: Peilin Ye <yepeilin.cs@...il.com>
To: Stefan Richter <stefanr@...6.in-berlin.de>
Cc: Peilin Ye <yepeilin.cs@...il.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux1394-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: [Linux-kernel-mentees] [PATCH] firewire: Prevent kernel-infoleak in ioctl_get_info()
ioctl_get_info() is copying uninitialized stack memory to userspace due to
the compiler not initializing holes in statically allocated structures.
Fix it by initializing `event` using memset() in fill_bus_reset_event().
Cc: stable@...r.kernel.org
Suggested-by: Dan Carpenter <dan.carpenter@...cle.com>
Suggested-by: Arnd Bergmann <arnd@...db.de>
Signed-off-by: Peilin Ye <yepeilin.cs@...il.com>
---
drivers/firewire/core-cdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index fb6c651214f3..2341d762df5b 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -340,6 +340,8 @@ static void fill_bus_reset_event(struct fw_cdev_event_bus_reset *event,
{
struct fw_card *card = client->device->card;
+ memset(event, 0, sizeof(*event));
+
spin_lock_irq(&card->lock);
event->closure = client->bus_reset_closure;
--
2.25.1
Powered by blists - more mailing lists