summaryrefslogtreecommitdiffstats
path: root/net/netlink
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2006-10-31 00:06:12 +0100
committerDavid S. Miller <davem@sunset.davemloft.net>2006-10-31 00:24:41 +0100
commita27b58fed90cc5654e2daf1d292cc5bc61be4dd7 (patch)
tree4f01c7b0bc168b9a73cd9d5406e7fbf426ab169c /net/netlink
parent[SCTP]: Always linearise packet on input (diff)
downloadlinux-a27b58fed90cc5654e2daf1d292cc5bc61be4dd7.tar.xz
linux-a27b58fed90cc5654e2daf1d292cc5bc61be4dd7.zip
[NET]: fix uaccess handling
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink')
-rw-r--r--net/netlink/af_netlink.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index d56e0d21f919..d527c8977b1f 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1075,8 +1075,9 @@ static int netlink_getsockopt(struct socket *sock, int level, int optname,
return -EINVAL;
len = sizeof(int);
val = nlk->flags & NETLINK_RECV_PKTINFO ? 1 : 0;
- put_user(len, optlen);
- put_user(val, optval);
+ if (put_user(len, optlen) ||
+ put_user(val, optval))
+ return -EFAULT;
err = 0;
break;
default: