• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: Commit

2.4.36-stable kernel tree


Commit MetaInfo

Revisiona0fd3c2997c6de7a260e8ace81568a35fbf5f771 (tree)
Zeit2008-09-06 20:35:24
AutorEugene Teo <eugeneteo@kern...>
CommiterWilly Tarreau

Log Message

wan: Missing capability checks in sbni_ioctl() (CVE-2008-3525)

[backport of 2.6 commit f2455eb176ac87081bbfc9a44b21c7cd2bc1967e]

There are missing capability checks in the following code:

1300 static int
1301 sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd)
1302 {
[...]
1319 case SIOCDEVRESINSTATS :
1320 if( current->euid != 0 ) /* root only */
1321 return -EPERM;
[...]
1336 case SIOCDEVSHWSTATE :
1337 if( current->euid != 0 ) /* root only */
1338 return -EPERM;
[...]
1357 case SIOCDEVENSLAVE :
1358 if( current->euid != 0 ) /* root only */
1359 return -EPERM;
[...]
1372 case SIOCDEVEMANSIPATE :
1373 if( current->euid != 0 ) /* root only */
1374 return -EPERM;

Here's my proposed fix:

Missing capability checks.

Signed-off-by: Eugene Teo <eugeneteo@kernel.sg>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>

Ändern Zusammenfassung

Diff

--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -1297,7 +1297,7 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
12971297 break;
12981298
12991299 case SIOCDEVRESINSTATS :
1300- if( current->euid != 0 ) /* root only */
1300+ if (!capable(CAP_NET_ADMIN)) /* root only */
13011301 return -EPERM;
13021302 memset( &nl->in_stats, 0, sizeof(struct sbni_in_stats) );
13031303 break;
@@ -1316,7 +1316,7 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
13161316 break;
13171317
13181318 case SIOCDEVSHWSTATE :
1319- if( current->euid != 0 ) /* root only */
1319+ if (!capable(CAP_NET_ADMIN)) /* root only */
13201320 return -EPERM;
13211321
13221322 spin_lock( &nl->lock );
@@ -1337,7 +1337,7 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
13371337 #ifdef CONFIG_SBNI_MULTILINE
13381338
13391339 case SIOCDEVENSLAVE :
1340- if( current->euid != 0 ) /* root only */
1340+ if (!capable(CAP_NET_ADMIN)) /* root only */
13411341 return -EPERM;
13421342
13431343 if( (error = verify_area( VERIFY_READ, ifr->ifr_data,
@@ -1355,7 +1355,7 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
13551355 return enslave( dev, slave_dev );
13561356
13571357 case SIOCDEVEMANSIPATE :
1358- if( current->euid != 0 ) /* root only */
1358+ if (!capable(CAP_NET_ADMIN)) /* root only */
13591359 return -EPERM;
13601360
13611361 return emancipate( dev );
Show on old repository browser