From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-can@vger.kernel.org,
kernel@pengutronix.de, Tomas Bortoli <tomasbortoli@gmail.com>,
syzbot+513e4d0985298538bf9b@syzkaller.appspotmail.com,
linux-stable <stable@vger.kernel.org>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 3/4] can: peak_usb: pcan_usb_fd: uix info-leaks to USB devices
Date: Fri, 2 Aug 2019 14:00:37 +0200 [thread overview]
Message-ID: <20190802120038.18154-4-mkl@pengutronix.de> (raw)
In-Reply-To: <20190802120038.18154-1-mkl@pengutronix.de>
From: Tomas Bortoli <tomasbortoli@gmail.com>
Uninitialized Kernel memory can leak to USB devices.
Fix by using kzalloc() instead of kmalloc() on the affected buffers.
Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
Reported-by: syzbot+513e4d0985298538bf9b@syzkaller.appspotmail.com
Fixes: 0a25e1f4f185 ("can: peak_usb: add support for PEAK new CANFD USB adapters")
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
index 34761c3a6286..47cc1ff5b88e 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
@@ -841,7 +841,7 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev)
goto err_out;
/* allocate command buffer once for all for the interface */
- pdev->cmd_buffer_addr = kmalloc(PCAN_UFD_CMD_BUFFER_SIZE,
+ pdev->cmd_buffer_addr = kzalloc(PCAN_UFD_CMD_BUFFER_SIZE,
GFP_KERNEL);
if (!pdev->cmd_buffer_addr)
goto err_out_1;
--
2.20.1
next prev parent reply other threads:[~2019-08-02 12:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-02 12:00 pull-request: can 2019-08-02 Marc Kleine-Budde
2019-08-02 12:00 ` [PATCH 1/4] can: sja1000: force the string buffer NULL-terminated Marc Kleine-Budde
2019-08-02 12:00 ` [PATCH 2/4] can: peak_usb: " Marc Kleine-Budde
2019-08-02 12:00 ` Marc Kleine-Budde [this message]
2019-08-02 12:00 ` [PATCH 4/4] can: peak_usb: pcan_usb_pro: Fix info-leaks to USB devices Marc Kleine-Budde
2019-08-05 21:45 ` pull-request: can 2019-08-02 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190802120038.18154-4-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+513e4d0985298538bf9b@syzkaller.appspotmail.com \
--cc=tomasbortoli@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).