]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv6/af_inet6.c
net: check kern before calling security subsystem
[net-next-2.6.git] / net / ipv6 / af_inet6.c
index 45ed5e05ab329017d10aefbf26ba326886e5ccc1..12e69d364dd56a1d7542ce73cf04268a52f667d7 100644 (file)
@@ -159,7 +159,7 @@ lookup_protocol:
        }
 
        err = -EPERM;
-       if (sock->type == SOCK_RAW && !capable(CAP_NET_RAW))
+       if (sock->type == SOCK_RAW && !kern && !capable(CAP_NET_RAW))
                goto out_rcu_unlock;
 
        sock->ops = answer->ops;