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>
This commit is contained in:
committed by
David S. Miller
parent
3f378b6844
commit
c84b3268da
@ -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;
|
||||
|
Reference in New Issue
Block a user