summaryrefslogtreecommitdiff
path: root/net/ax25
diff options
context:
space:
mode:
authorOri Nimron <orinimron123@gmail.com>2019-09-20 09:35:47 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-05 12:27:43 +0200
commitc15d89b5cb86dfcdee536d093ece512091ed6e5c (patch)
treeb0199a2f867f0da1c9256d996f322dcc736988a1 /net/ax25
parentec1e04b8979464990e000850d14d3e562999a82d (diff)
ax25: enforce CAP_NET_RAW for raw sockets
[ Upstream commit 0614e2b73768b502fc32a75349823356d98aae2c ] When creating a raw AF_AX25 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 'net/ax25')
-rw-r--r--net/ax25/af_ax25.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 2772f6a13fcb..de55a3f001dc 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -859,6 +859,8 @@ static int ax25_create(struct net *net, struct socket *sock, int protocol,
break;
case SOCK_RAW:
+ if (!capable(CAP_NET_RAW))
+ return -EPERM;
break;
default:
return -ESOCKTNOSUPPORT;