diff options
author | Ori Nimron <orinimron123@gmail.com> | 2019-09-20 09:35:45 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-05 13:13:21 +0200 |
commit | 1ca53dc648e83c4bb90e2eab49e3de43ce2b2bf2 (patch) | |
tree | 208a496407c5ba5ee0c283fdb56e7c51ee9bc3a8 /drivers/isdn | |
parent | df20d3ce66c5bb1b9d753a2ceb137a93b6386e80 (diff) | |
download | linux-stable-1ca53dc648e83c4bb90e2eab49e3de43ce2b2bf2.tar.gz linux-stable-1ca53dc648e83c4bb90e2eab49e3de43ce2b2bf2.tar.bz2 linux-stable-1ca53dc648e83c4bb90e2eab49e3de43ce2b2bf2.zip |
mISDN: enforce CAP_NET_RAW for raw sockets
[ Upstream commit b91ee4aa2a2199ba4d4650706c272985a5a32d80 ]
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/mISDN/socket.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c index c6ba37df4b9d..dff4132b3702 100644 --- a/drivers/isdn/mISDN/socket.c +++ b/drivers/isdn/mISDN/socket.c @@ -754,6 +754,8 @@ base_sock_create(struct net *net, struct socket *sock, int protocol, int kern) if (sock->type != SOCK_RAW) return -ESOCKTNOSUPPORT; + if (!capable(CAP_NET_RAW)) + return -EPERM; sk = sk_alloc(net, PF_ISDN, GFP_KERNEL, &mISDN_proto, kern); if (!sk) |