summaryrefslogtreecommitdiff
path: root/net/bluetooth
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-11-05 20:45:52 -0800
committerDavid S. Miller <davem@davemloft.net>2009-11-05 22:18:18 -0800
commitc84b3268da3b85c9d8a9e504e1001a14ed829e94 (patch)
tree795b4997f5610cf2e56a57ee5b1e4c2d4ca10188 /net/bluetooth
parent3f378b684453f2a028eda463ce383370545d9cc9 (diff)
downloadlinux-3.10-c84b3268da3b85c9d8a9e504e1001a14ed829e94.tar.gz
linux-3.10-c84b3268da3b85c9d8a9e504e1001a14ed829e94.tar.bz2
linux-3.10-c84b3268da3b85c9d8a9e504e1001a14ed829e94.zip
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/bluetooth')
-rw-r--r--net/bluetooth/l2cap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 365ae161d70..ff0233df624 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -832,7 +832,7 @@ static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol,
sock->type != SOCK_DGRAM && sock->type != SOCK_RAW)
return -ESOCKTNOSUPPORT;
- if (sock->type == SOCK_RAW && !capable(CAP_NET_RAW))
+ if (sock->type == SOCK_RAW && !kern && !capable(CAP_NET_RAW))
return -EPERM;
sock->ops = &l2cap_sock_ops;