Skip to content

Commit

Permalink
ieee802154: enforce CAP_NET_RAW for raw sockets
Browse files Browse the repository at this point in the history
commit e69dbd4 upstream.

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>
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information
Ori Nimron authored and Ben Hutchings committed Nov 15, 2019
1 parent 2c675da commit b8a15d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ieee802154/af_ieee802154.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,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;
Expand Down

0 comments on commit b8a15d5

Please sign in to comment.