[PATCH] wext: Fix IWENCODEEXT security permissions

Check the permissions when user-space try to read the
encryption parameters via SIOCGIWENCODEEXT. This is trivial and
probably should go in 2.6.17...
	Bug was found by Brian Eaton <eaton.lists@gmail.com>, thanks !

Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Jean Tourrilhes 2006-04-04 15:53:43 -07:00 committed by John W. Linville
parent 3a1af6ffe4
commit a417016d1a
1 changed files with 2 additions and 1 deletions

View File

@ -2698,7 +2698,8 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
/* If command is `set a parameter', or
* `get the encoding parameters', check if
* the user has the right to do it */
if (IW_IS_SET(cmd) || cmd == SIOCGIWENCODE) {
if (IW_IS_SET(cmd) || cmd == SIOCGIWENCODE
|| cmd == SIOCGIWENCODEEXT) {
if (!capable(CAP_NET_ADMIN))
return -EPERM;
}