netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.17-rc1] Fix RtNetlink ENCODE security permissions
@ 2006-04-14 17:47 Jean Tourrilhes
  2006-04-14 17:59 ` Randy.Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Jean Tourrilhes @ 2006-04-14 17:47 UTC (permalink / raw)
  To: John W. Linville, netdev

	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

Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>

-----------------------------------------------------------

diff -u -p linux/net/core/wireless.j1.c linux/net/core/wireless.c
--- linux/net/core/wireless.j1.c	2006-04-13 18:29:49.000000000 -0700
+++ linux/net/core/wireless.c	2006-04-13 18:35:59.000000000 -0700
@@ -1726,6 +1726,14 @@ int wireless_rtnetlink_get(struct net_de
 	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 */


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.17-rc1] Fix RtNetlink ENCODE security permissions
  2006-04-14 17:47 [PATCH 2.6.17-rc1] Fix RtNetlink ENCODE security permissions Jean Tourrilhes
@ 2006-04-14 17:59 ` Randy.Dunlap
  2006-04-14 18:06   ` [stable] " Greg KH
  2006-04-14 18:06   ` Jean Tourrilhes
  0 siblings, 2 replies; 4+ messages in thread
From: Randy.Dunlap @ 2006-04-14 17:59 UTC (permalink / raw)
  To: jt; +Cc: linville, netdev, stable

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 ??

> 	Have fun...
> 
> 	Jean
> 
> Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
> 
> -----------------------------------------------------------
> 
> diff -u -p linux/net/core/wireless.j1.c linux/net/core/wireless.c
> --- linux/net/core/wireless.j1.c	2006-04-13 18:29:49.000000000 -0700
> +++ linux/net/core/wireless.c	2006-04-13 18:35:59.000000000 -0700
> @@ -1726,6 +1726,14 @@ int wireless_rtnetlink_get(struct net_de
>  	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 */
> 
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


---
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [stable] Re: [PATCH 2.6.17-rc1] Fix RtNetlink ENCODE security permissions
  2006-04-14 17:59 ` Randy.Dunlap
@ 2006-04-14 18:06   ` Greg KH
  2006-04-14 18:06   ` Jean Tourrilhes
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2006-04-14 18:06 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: jt, netdev, linville, stable

On Fri, Apr 14, 2006 at 10:59:13AM -0700, Randy.Dunlap wrote:
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.17-rc1] Fix RtNetlink ENCODE security permissions
  2006-04-14 17:59 ` Randy.Dunlap
  2006-04-14 18:06   ` [stable] " Greg KH
@ 2006-04-14 18:06   ` Jean Tourrilhes
  1 sibling, 0 replies; 4+ messages in thread
From: Jean Tourrilhes @ 2006-04-14 18:06 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: linville, netdev, stable

On Fri, Apr 14, 2006 at 10:59:13AM -0700, Randy.Dunlap wrote:
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-04-14 18:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-14 17:47 [PATCH 2.6.17-rc1] Fix RtNetlink ENCODE security permissions Jean Tourrilhes
2006-04-14 17:59 ` Randy.Dunlap
2006-04-14 18:06   ` [stable] " Greg KH
2006-04-14 18:06   ` Jean Tourrilhes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).