netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pcan_usb_fd: zero out the common command buffer
@ 2019-08-08  9:28 Oliver Neukum
  2019-08-08 18:03 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Neukum @ 2019-08-08  9:28 UTC (permalink / raw)
  To: davem, netdev; +Cc: Oliver Neukum

Lest we leak kernel memory to a device we better zero out buffers.

Reported-by: syzbot+513e4d0985298538bf9b@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 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.16.4


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

* Re: [PATCH] pcan_usb_fd: zero out the common command buffer
  2019-08-08  9:28 [PATCH] pcan_usb_fd: zero out the common command buffer Oliver Neukum
@ 2019-08-08 18:03 ` David Miller
  2019-08-08 19:52   ` Marc Kleine-Budde
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2019-08-08 18:03 UTC (permalink / raw)
  To: oneukum; +Cc: netdev, wg, mkl, linux-can

From: Oliver Neukum <oneukum@suse.com>
Date: Thu,  8 Aug 2019 11:28:25 +0200

> Lest we leak kernel memory to a device we better zero out buffers.
> 
> Reported-by: syzbot+513e4d0985298538bf9b@syzkaller.appspotmail.com
> Signed-off-by: Oliver Neukum <oneukum@suse.com>

Please CC: the CAN subsystem maintainers, as this is clearly listed in the
MAINTAINERS file.

Thank you.

> ---
>  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.16.4
> 

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

* Re: [PATCH] pcan_usb_fd: zero out the common command buffer
  2019-08-08 18:03 ` David Miller
@ 2019-08-08 19:52   ` Marc Kleine-Budde
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2019-08-08 19:52 UTC (permalink / raw)
  To: David Miller, oneukum; +Cc: netdev, wg, linux-can


[-- Attachment #1.1: Type: text/plain, Size: 863 bytes --]

On 8/8/19 8:03 PM, David Miller wrote:
> From: Oliver Neukum <oneukum@suse.com>
> Date: Thu,  8 Aug 2019 11:28:25 +0200
> 
>> Lest we leak kernel memory to a device we better zero out buffers.
>>
>> Reported-by: syzbot+513e4d0985298538bf9b@syzkaller.appspotmail.com
>> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> 
> Please CC: the CAN subsystem maintainers, as this is clearly listed in the
> MAINTAINERS file.

The issue is already fixed and already mainline (stable@v.k.o is on Cc):

30a8beeb3042 can: peak_usb: pcan_usb_fd: Fix info-leaks to USB devices

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2019-08-08 19:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-08  9:28 [PATCH] pcan_usb_fd: zero out the common command buffer Oliver Neukum
2019-08-08 18:03 ` David Miller
2019-08-08 19:52   ` Marc Kleine-Budde

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).