projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0614e2b
)
ieee802154: enforce CAP_NET_RAW for raw sockets
author
Ori Nimron
<
[email protected]
>
Fri, 20 Sep 2019 07:35:48 +0000
(09:35 +0200)
committer
David S. Miller
<
[email protected]
>
Tue, 24 Sep 2019 14:37:18 +0000
(16:37 +0200)
When creating a raw AF_IEEE802154 socket, CAP_NET_RAW needs to be
checked first.
Signed-off-by: Ori Nimron <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
Acked-by: Stefan Schmidt <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/ieee802154/socket.c
patch
|
blob
|
history
diff --git
a/net/ieee802154/socket.c
b/net/ieee802154/socket.c
index badc5cfe4dc63e1660696443e7f01e5707e81206..d93d4531aa9bc5997df13ab6bf606d7f69e512b2 100644
(file)
--- a/
net/ieee802154/socket.c
+++ b/
net/ieee802154/socket.c
@@
-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;