Skip to content

Commit

Permalink
ax25: enforce CAP_NET_RAW for raw sockets
Browse files Browse the repository at this point in the history
When creating a raw AF_AX25 socket, CAP_NET_RAW needs to be checked
first.

Signed-off-by: Ori Nimron <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Armondile authored and davem330 committed Sep 24, 2019
1 parent 6cc03e8 commit 0614e2b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/ax25/af_ax25.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0614e2b

Please sign in to comment.