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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1446787595-20309-1-git-send-email-ksenija.stanojevic@gmail.com>
Date:	Thu,  5 Nov 2015 21:26:35 -0800
From:	Ksenija Stanojevic <ksenija.stanojevic@...il.com>
To:	gregkh@...uxfoundation.org
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Ksenija Stanojevic <ksenija.stanojevic@...il.com>
Subject: [PATCH] Staging: gdm72xx: Fix sparse warning

Fix following sparse warnings by adding new structure for user-space
data (struct data_us) in wm_ioctl.h:

drivers/staging/gdm72xx/gdm_wimax.c:381:37: warning: incorrect type in
argument 1 (different address spaces)
drivers/staging/gdm72xx/gdm_wimax.c:381:37:    expected void [noderef]
<asn:1>*to
drivers/staging/gdm72xx/gdm_wimax.c:381:37:    got void *buf
drivers/staging/gdm72xx/gdm_wimax.c:404:41: warning: incorrect type in
argument 2 (different address spaces)
drivers/staging/gdm72xx/gdm_wimax.c:404:41:    expected void const
[noderef] <asn:1>*from
drivers/staging/gdm72xx/gdm_wimax.c:404:41:    got void *buf

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@...il.com>
---
 drivers/staging/gdm72xx/gdm_wimax.c | 8 ++++----
 drivers/staging/gdm72xx/wm_ioctl.h  | 6 ++++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c
index b8eea21..362a980 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.c
+++ b/drivers/staging/gdm72xx/gdm_wimax.c
@@ -363,7 +363,7 @@ static void kdelete(void **buf)
 	}
 }
 
-static int gdm_wimax_ioctl_get_data(struct data_s *dst, struct data_s *src)
+static int gdm_wimax_ioctl_get_data(struct data_us *dst, struct data_s *src)
 {
 	int size;
 
@@ -379,7 +379,7 @@ static int gdm_wimax_ioctl_get_data(struct data_s *dst, struct data_s *src)
 	return 0;
 }
 
-static int gdm_wimax_ioctl_set_data(struct data_s *dst, struct data_s *src)
+static int gdm_wimax_ioctl_set_data(struct data_s *dst, struct data_us *src)
 {
 	if (!src->size) {
 		dst->size = 0;
@@ -469,7 +469,7 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 		}
 		if (req->cmd == SIOCG_DATA) {
 			ret = gdm_wimax_ioctl_get_data(
-				&req->data, &nic->sdk_data[req->data_id]);
+				&req->udata, &nic->sdk_data[req->data_id]);
 			if (ret < 0)
 				return ret;
 		} else if (req->cmd == SIOCS_DATA) {
@@ -481,7 +481,7 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 					       req->data.buf);
 			}
 			ret = gdm_wimax_ioctl_set_data(
-				&nic->sdk_data[req->data_id], &req->data);
+				&nic->sdk_data[req->data_id], &req->udata);
 			if (ret < 0)
 				return ret;
 		}
diff --git a/drivers/staging/gdm72xx/wm_ioctl.h b/drivers/staging/gdm72xx/wm_ioctl.h
index ed8f649..066765d 100644
--- a/drivers/staging/gdm72xx/wm_ioctl.h
+++ b/drivers/staging/gdm72xx/wm_ioctl.h
@@ -78,6 +78,11 @@ struct data_s {
 	void	*buf;
 };
 
+struct data_us {
+	int	size;
+	void __user *buf;
+};
+
 struct wm_req_s {
 	union {
 		char ifrn_name[IFNAMSIZ];
@@ -85,6 +90,7 @@ struct wm_req_s {
 	unsigned short	cmd;
 	unsigned short	data_id;
 	struct data_s	data;
+	struct data_us  udata;
 
 /* NOTE: sizeof(struct wm_req_s) must be less than sizeof(struct ifreq). */
 };
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ