aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/af_inet6.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-11-05 23:45:52 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-06 01:18:18 -0500
commitc84b3268da3b85c9d8a9e504e1001a14ed829e94 (patch)
tree795b4997f5610cf2e56a57ee5b1e4c2d4ca10188 /net/ipv6/af_inet6.c
parent3f378b684453f2a028eda463ce383370545d9cc9 (diff)
net: check kern before calling security subsystem
Before calling capable(CAP_NET_RAW) check if this operations is on behalf of the kernel or on behalf of userspace. Do not do the security check if it is on behalf of the kernel. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r--net/ipv6/af_inet6.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 45ed5e05ab32..12e69d364dd5 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -159,7 +159,7 @@ lookup_protocol:
159 } 159 }
160 160
161 err = -EPERM; 161 err = -EPERM;
162 if (sock->type == SOCK_RAW && !capable(CAP_NET_RAW)) 162 if (sock->type == SOCK_RAW && !kern && !capable(CAP_NET_RAW))
163 goto out_rcu_unlock; 163 goto out_rcu_unlock;
164 164
165 sock->ops = answer->ops; 165 sock->ops = answer->ops;