From: Tomas Bortoli Date: Wed, 31 Jul 2019 14:54:47 +0000 (-0400) Subject: [RAMEN9610-21541]can: peak_usb: pcan_usb_pro: Fix info-leaks to USB devices X-Git-Tag: MMI-QSAS30.62-33-3~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=91674133e86fd28e7f83852dc2f0c7487c32ac5c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [RAMEN9610-21541]can: peak_usb: pcan_usb_pro: Fix info-leaks to USB devices commit ead16e53c2f0ed946d82d4037c630e2f60f4ab69 upstream. Uninitialized Kernel memory can leak to USB devices. Fix by using kzalloc() instead of kmalloc() on the affected buffers. Change-Id: I28bc8d26ee60c7a1cee72e0961d58e528f44759f Signed-off-by: Tomas Bortoli Reported-by: syzbot+d6a5a1a3657b596ef132@syzkaller.appspotmail.com Fixes: f14e22435a27 ("net: can: peak_usb: Do not do dma on the stack") Cc: linux-stable Signed-off-by: Marc Kleine-Budde Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c index bbdd6058cd2f..d85fdc6949c6 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c @@ -500,7 +500,7 @@ static int pcan_usb_pro_drv_loaded(struct peak_usb_device *dev, int loaded) u8 *buffer; int err; - buffer = kmalloc(PCAN_USBPRO_FCT_DRVLD_REQ_LEN, GFP_KERNEL); + buffer = kzalloc(PCAN_USBPRO_FCT_DRVLD_REQ_LEN, GFP_KERNEL); if (!buffer) return -ENOMEM;