lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20130806114208.20561.43444.stgit@localhost6.localdomain6>
Date:	Tue, 06 Aug 2013 14:42:08 +0300
From:	Jussi Kivilinna <jussi.kivilinna@....fi>
To:	netdev@...r.kernel.org
Cc:	linux-usb@...r.kernel.org
Subject: [PATCH] rndis_host: do not use stack as URB transfer_buffer

Patch fixes rndis_host not to use stack as URB transfer_buffer. URB buffers need
to be DMA-able, which stack is not.

Patch is only compile tested.

Cc: stable@...r.kernel.org
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@....fi>
---
 drivers/net/usb/rndis_host.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index cc49aac..2f232c3 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -105,7 +105,6 @@ static void rndis_msg_indicate(struct usbnet *dev, struct rndis_indicate *msg,
 int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
 {
 	struct cdc_state	*info = (void *) &dev->data;
-	struct usb_cdc_notification notification;
 	int			master_ifnum;
 	int			retval;
 	int			partial;
@@ -140,12 +139,17 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
 	/* Some devices don't respond on the control channel until
 	 * polled on the status channel, so do that first. */
 	if (dev->driver_info->data & RNDIS_DRIVER_DATA_POLL_STATUS) {
+		struct usb_cdc_notification *notification;
+		notification = kmalloc(sizeof(*notification), GFP_KERNEL);
+		if (!notification)
+			return -ENOMEM;
 		retval = usb_interrupt_msg(
 			dev->udev,
 			usb_rcvintpipe(dev->udev,
 				       dev->status->desc.bEndpointAddress),
-			&notification, sizeof(notification), &partial,
+			notification, sizeof(*notification), &partial,
 			RNDIS_CONTROL_TIMEOUT_MS);
+		kfree(notification);
 		if (unlikely(retval < 0))
 			return retval;
 	}

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ