Commit f7813d5c authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'linux-can-fixes-for-5.3-20190802' of...

Merge tag 'linux-can-fixes-for-5.3-20190802' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can



Marc Kleine-Budde says:

====================
pull-request: can 2019-08-02

this is a pull request of 4 patches for net/master.

The first two patches are by Wang Xiayang, they force that the string buffer
during a dev_info() is properly NULL terminated.

The last two patches are by Tomas Bortoli and fix both a potential info leak of
kernel memory to USB devices.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 091adf9b ead16e53
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -479,7 +479,7 @@ static void pcan_free_channels(struct pcan_pccard *card)
		if (!netdev)
		if (!netdev)
			continue;
			continue;


		strncpy(name, netdev->name, IFNAMSIZ);
		strlcpy(name, netdev->name, IFNAMSIZ);


		unregister_sja1000dev(netdev);
		unregister_sja1000dev(netdev);


+1 −1
Original line number Original line Diff line number Diff line
@@ -855,7 +855,7 @@ static void peak_usb_disconnect(struct usb_interface *intf)


		dev_prev_siblings = dev->prev_siblings;
		dev_prev_siblings = dev->prev_siblings;
		dev->state &= ~PCAN_USB_STATE_CONNECTED;
		dev->state &= ~PCAN_USB_STATE_CONNECTED;
		strncpy(name, netdev->name, IFNAMSIZ);
		strlcpy(name, netdev->name, IFNAMSIZ);


		unregister_netdev(netdev);
		unregister_netdev(netdev);


+1 −1
Original line number Original line Diff line number Diff line
@@ -841,7 +841,7 @@ static int pcan_usb_fd_init(struct peak_usb_device *dev)
			goto err_out;
			goto err_out;


		/* allocate command buffer once for all for the interface */
		/* 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);
						GFP_KERNEL);
		if (!pdev->cmd_buffer_addr)
		if (!pdev->cmd_buffer_addr)
			goto err_out_1;
			goto err_out_1;
+1 −1
Original line number Original line Diff line number Diff line
@@ -494,7 +494,7 @@ static int pcan_usb_pro_drv_loaded(struct peak_usb_device *dev, int loaded)
	u8 *buffer;
	u8 *buffer;
	int err;
	int err;


	buffer = kmalloc(PCAN_USBPRO_FCT_DRVLD_REQ_LEN, GFP_KERNEL);
	buffer = kzalloc(PCAN_USBPRO_FCT_DRVLD_REQ_LEN, GFP_KERNEL);
	if (!buffer)
	if (!buffer)
		return -ENOMEM;
		return -ENOMEM;