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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160222193221.GC23565@mwanda>
Date:	Mon, 22 Feb 2016 22:32:21 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	Shraddha Barke <shraddha.6596@...il.com>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: [patch 3/6] Staging: gdm72xx: make "len" unsigned

We had an underflow bug here and I think I fixed it but we may as
well be proactive and make "len" unsigned to be double sure.

Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

diff --git a/drivers/staging/gdm72xx/gdm_wimax.h b/drivers/staging/gdm72xx/gdm_wimax.h
index 3330cd79..ed12813 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.h
+++ b/drivers/staging/gdm72xx/gdm_wimax.h
@@ -26,10 +26,10 @@
 struct phy_dev {
 	void			*priv_dev;
 	struct net_device	*netdev;
-	int (*send_func)(void *priv_dev, void *data, int len,
+	int (*send_func)(void *priv_dev, void *data, size_t len,
 			 void (*cb)(void *cb_data), void *cb_data);
 	int (*rcv_func)(void *priv_dev,
-			void (*cb)(void *cb_data, void *data, int len),
+			void (*cb)(void *cb_data, void *data, size_t len),
 			void *cb_data);
 };
 
diff --git a/drivers/staging/gdm72xx/gdm_usb.h b/drivers/staging/gdm72xx/gdm_usb.h
index d864928..1456da0 100644
--- a/drivers/staging/gdm72xx/gdm_usb.h
+++ b/drivers/staging/gdm72xx/gdm_usb.h
@@ -49,7 +49,7 @@ struct usb_rx {
 	struct rx_cxt		*rx_cxt;
 	struct urb		*urb;
 	u8			*buf;
-	void (*callback)(void *cb_data, void *data, int len);
+	void (*callback)(void *cb_data, void *data, size_t len);
 	void *cb_data;
 };
 
diff --git a/drivers/staging/gdm72xx/gdm_usb.c b/drivers/staging/gdm72xx/gdm_usb.c
index 7f035b1..bbf3e70 100644
--- a/drivers/staging/gdm72xx/gdm_usb.c
+++ b/drivers/staging/gdm72xx/gdm_usb.c
@@ -284,7 +284,7 @@ static void gdm_usb_send_complete(struct urb *urb)
 	spin_unlock_irqrestore(&tx->lock, flags);
 }
 
-static int gdm_usb_send(void *priv_dev, void *data, int len,
+static int gdm_usb_send(void *priv_dev, void *data, size_t len,
 			void (*cb)(void *data), void *cb_data)
 {
 	struct usbwm_dev *udev = priv_dev;
@@ -341,7 +341,7 @@ static int gdm_usb_send(void *priv_dev, void *data, int len,
 	usb_fill_bulk_urb(t->urb, usbdev, usb_sndbulkpipe(usbdev, 1), t->buf,
 			  len + padding, gdm_usb_send_complete, t);
 
-	dev_dbg(&usbdev->dev, "usb_send: %*ph\n", len + padding, t->buf);
+	dev_dbg(&usbdev->dev, "usb_send: %*ph\n", (int)len + padding, t->buf);
 
 #ifdef CONFIG_WIMAX_GDM72XX_USB_PM
 	if (usbdev->state & USB_STATE_SUSPENDED) {
@@ -460,7 +460,7 @@ static void gdm_usb_rcv_complete(struct urb *urb)
 }
 
 static int gdm_usb_receive(void *priv_dev,
-			   void (*cb)(void *cb_data, void *data, int len),
+			   void (*cb)(void *cb_data, void *data, size_t len),
 			   void *cb_data)
 {
 	struct usbwm_dev *udev = priv_dev;
diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c
index 1b3da2b..6d647d6 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.c
+++ b/drivers/staging/gdm72xx/gdm_wimax.c
@@ -701,7 +701,7 @@ static void gdm_wimax_transmit_pkt(struct net_device *dev, char *buf, int len)
 	}
 }
 
-static void rx_complete(void *arg, void *data, int len)
+static void rx_complete(void *arg, void *data, size_t len)
 {
 	struct nic *nic = arg;
 
@@ -709,7 +709,7 @@ static void rx_complete(void *arg, void *data, int len)
 	gdm_wimax_rcv_with_cb(nic, rx_complete, nic);
 }
 
-static void prepare_rx_complete(void *arg, void *data, int len)
+static void prepare_rx_complete(void *arg, void *data, size_t len)
 {
 	struct nic *nic = arg;
 	int ret;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ