mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Acked-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
3f378b6844
commit
c84b3268da
3 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue