Skip to content

Commit

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

When creating a raw AF_ISDN 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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information
Ori Nimron authored and Ben Hutchings committed Nov 15, 2019
1 parent 2d40204 commit f49bd65
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/isdn/mISDN/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,8 @@ base_sock_create(struct net *net, struct socket *sock, int protocol)

if (sock->type != SOCK_RAW)
return -ESOCKTNOSUPPORT;
if (!capable(CAP_NET_RAW))
return -EPERM;

sk = sk_alloc(net, PF_ISDN, GFP_KERNEL, &mISDN_proto);
if (!sk)
Expand Down

0 comments on commit f49bd65

Please sign in to comment.