Fix RtNetlink ENCODE security permissions
Subsystems (2)
PATCH 1/1 Fix RtNetlink ENCODE security permissions
Hi John,
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.
Fully tested on 2.6.17-rc1. Have fun... Jean
-----------------------------------------------------------
net/core/wireless.c renamed from net/core/wireless.j1.c +8 -0
@@ -1726,6 +1726,14 @@ int wireless_rtnetlink_get(struct net_deif (!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 */
Quoted 7 lines · On Fri, 14 Apr 2006 10:47:26 -0700 Jean Tourrilhes wrote:
Hi John,
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.Fully tested on 2.6.17-rc1.
and for -stable ??
Quoted 28 lines
Have fun... JeanSigned-off-by Jean Tourrilhes <[email protected]>-----------------------------------------------------------
diff -u -p
linux/net/core/wireless.j1.clinux/net/core/wireless.cnet/core/wireless.c renamed from net/core/wireless.j1.c +8
-1@@ -1726,6 +1726,14 @@ int wireless_rtnetlink_get(struct net_deif (!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 */ -
Quoted 4 lines
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
---
~Randy
Quoted 11 lines · Randy.Dunlap
Quoted 7 lines · On Fri, 14 Apr 2006 10:47:26 -0700 Jean Tourrilhes wrote:
Hi John,
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.Fully tested on 2.6.17-rc1.and for -stable ??
The RtNetlink code (WE-20) was only included in 2.6.17-rc1 and
therefore is not available in 2.6.16.
Jean
Quoted 11 lines · Randy.Dunlap
Quoted 7 lines · On Fri, 14 Apr 2006 10:47:26 -0700 Jean Tourrilhes wrote:
Hi John,
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.Fully tested on 2.6.17-rc1.and for -stable ??
At first glance, I'd agree with this. Jean?
thanks,
greg k-h