mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
ieee802154: enforce CAP_NET_RAW for raw sockets
When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be checked first. Signed-off-by: Ori Nimron <orinimron123@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
0614e2b737
commit
e69dbd4619
@@ -1008,6 +1008,9 @@ static int ieee802154_create(struct net *net, struct socket *sock,
|
||||
|
||||
switch (sock->type) {
|
||||
case SOCK_RAW:
|
||||
rc = -EPERM;
|
||||
if (!capable(CAP_NET_RAW))
|
||||
goto out;
|
||||
proto = &ieee802154_raw_prot;
|
||||
ops = &ieee802154_raw_ops;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user