Skip to content

Commit

Permalink
[PATCH] wext: Fix RtNetlink ENCODE security permissions
Browse files Browse the repository at this point in the history
	I've just realised that the RtNetlink code does not check the
permission for SIOCGIWENCODE and SIOCGIWENCODEEXT, which means that
any user can read the encryption keys. The fix is trivial and should
go in 2.6.17 alonside the two other patch I sent you last week.

Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Jean Tourrilhes authored and John W. Linville committed Apr 19, 2006
1 parent a392149 commit 848ef85
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/core/wireless.c
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,14 @@ int wireless_rtnetlink_get(struct net_device * dev,
if(!IW_IS_GET(request->cmd))
return -EOPNOTSUPP;

/* If command is `get the encoding parameters', check if
* the user has the right to do it */
if (request->cmd == SIOCGIWENCODE ||
request->cmd == SIOCGIWENCODEEXT) {
if (!capable(CAP_NET_ADMIN))
return -EPERM;
}

/* Special cases */
if(request->cmd == SIOCGIWSTATS)
/* Get Wireless Stats */
Expand Down

0 comments on commit 848ef85

Please sign in to comment.