public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta•com>
To: davem@davemloft•net
Cc: netdev@vger•kernel.org
Subject: [PATCH 1/5] socket: suppress sparse warnings
Date: Wed, 23 Feb 2011 11:06:48 -0800	[thread overview]
Message-ID: <20110223190700.877761282@vyatta.com> (raw)
In-Reply-To: 20110223190647.482444598@vyatta.com

[-- Attachment #1: socket-sparse --]
[-- Type: text/plain, Size: 1122 bytes --]

Use __force to quiet sparse warnings for cases where the code
is simulating user space pointers.

Signed-off-by: Stephen Hemminger <shemminger@vyatta•com>

--- a/net/socket.c	2011-02-23 08:26:51.905069267 -0800
+++ b/net/socket.c	2011-02-23 08:26:59.005160474 -0800
@@ -2648,7 +2648,8 @@ static int bond_ioctl(struct net *net, u
 
 		old_fs = get_fs();
 		set_fs(KERNEL_DS);
-		err = dev_ioctl(net, cmd, &kifr);
+		err = dev_ioctl(net, cmd,
+				(struct ifreq __user __force *) &kifr);
 		set_fs(old_fs);
 
 		return err;
@@ -2757,7 +2758,7 @@ static int compat_sioc_ifmap(struct net
 
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
-	err = dev_ioctl(net, cmd, (void __user *)&ifr);
+	err = dev_ioctl(net, cmd, (void  __user __force *)&ifr);
 	set_fs(old_fs);
 
 	if (cmd == SIOCGIFMAP && !err) {
@@ -2862,7 +2863,8 @@ static int routing_ioctl(struct net *net
 		ret |= __get_user(rtdev, &(ur4->rt_dev));
 		if (rtdev) {
 			ret |= copy_from_user(devname, compat_ptr(rtdev), 15);
-			r4.rt_dev = devname; devname[15] = 0;
+			r4.rt_dev = (char __user __force *)devname;
+			devname[15] = 0;
 		} else
 			r4.rt_dev = NULL;
 



  reply	other threads:[~2011-02-23 19:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 19:06 [PATCH 0/5] sparse related patches Stephen Hemminger
2011-02-23 19:06 ` Stephen Hemminger [this message]
2011-02-23 19:06 ` [PATCH 2/5] atl1[ce]: fix sparse warnings Stephen Hemminger
2011-02-23 19:06 ` [PATCH 3/5] afkey: add sparse annotation about rcu Stephen Hemminger
2011-02-23 19:06 ` [PATCH 4/5] mqprio: cleanups Stephen Hemminger
2011-02-23 19:06 ` [PATCH 5/5] em_meta: fix sparse warning Stephen Hemminger
2011-02-23 22:11 ` [PATCH 0/5] sparse related patches David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110223190700.877761282@vyatta.com \
    --to=shemminger@vyatta$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox