[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190920073549.517481-4-gregkh@linuxfoundation.org>
Date: Fri, 20 Sep 2019 09:35:47 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: netdev@...r.kernel.org
Cc: isdn@...ux-pingi.de, jreuter@...na.de, ralf@...ux-mips.org,
alex.aring@...il.com, stefan@...enfreihafen.org,
orinimron123@...il.com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: [PATCH 3/5] ax25: enforce CAP_NET_RAW for raw sockets
From: Ori Nimron <orinimron123@...il.com>
When creating a raw AF_AX25 socket, CAP_NET_RAW needs to be checked
first.
Signed-off-by: Ori Nimron <orinimron123@...il.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
net/ax25/af_ax25.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index ca5207767dc2..bb222b882b67 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -855,6 +855,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;
--
2.23.0
Powered by blists - more mailing lists