diff mbox series

wireless: Change Kconfig to select WEXT_PRIV

Message ID 20220403181431.21811-1-Larry.Finger@lwfinger.net (mailing list archive)
State Rejected
Delegated to: Johannes Berg
Headers show
Series wireless: Change Kconfig to select WEXT_PRIV | expand

Commit Message

Larry Finger April 3, 2022, 6:14 p.m. UTC
File net/wireless/Kconfig contains two blind configuration variables,
namely WEXT_PRIV and WEXT_SPY. If those variables are already in the
configuration file, they will be retained, but there is no way to
set them if they are missing other than to manually edit .config.
They should be enabled if either WIRELESS_EXT or CFG80211_WEXT are set
in the same manner as WEXT_CORE and WEXT_PROC.

Personally, the setting of WEXT_SPY is not important; however, openSUSE
and Ubuntu both enable it in their default kernels. Other distros have
not been checked, but it is likely that they also enable that setting.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 net/wireless/Kconfig | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Johannes Berg April 3, 2022, 7:20 p.m. UTC | #1
On Sun, 2022-04-03 at 13:14 -0500, Larry Finger wrote:
> File net/wireless/Kconfig contains two blind configuration variables,
> namely WEXT_PRIV and WEXT_SPY. If those variables are already in the
> configuration file, they will be retained, but there is no way to
> set them if they are missing other than to manually edit .config.
> They should be enabled if either WIRELESS_EXT or CFG80211_WEXT are set
> in the same manner as WEXT_CORE and WEXT_PROC.
> 
> Personally, the setting of WEXT_SPY is not important; however, openSUSE
> and Ubuntu both enable it in their default kernels. Other distros have
> not been checked, but it is likely that they also enable that setting.
> 

They're intentionally this way though - they're only selected by the
(few) drivers that need them.

Yeah, out of tree drivers lose out, but we don't really care?

johannes
kernel test robot April 3, 2022, 9:06 p.m. UTC | #2
Hi Larry,

I love your patch! Yet something to improve:

[auto build test ERROR on wireless-next/main]
[also build test ERROR on wireless/main v5.17 next-20220401]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Larry-Finger/wireless-Change-Kconfig-to-select-WEXT_PRIV/20220404-021519
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
config: arm-randconfig-c002-20220403 (https://download.01.org/0day-ci/archive/20220404/202204040407.SOfx1u0m-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/b240672cd1f8018bc9aa17c50d9e2500db397d23
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Larry-Finger/wireless-Change-Kconfig-to-select-WEXT_PRIV/20220404-021519
        git checkout b240672cd1f8018bc9aa17c50d9e2500db397d23
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash net/wireless/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   net/wireless/wext-core.c: In function 'wireless_process_ioctl':
>> net/wireless/wext-core.c:941:38: error: 'struct net_device' has no member named 'wireless_handlers'
     941 |         if (cmd == SIOCGIWPRIV && dev->wireless_handlers)
         |                                      ^~
--
   net/wireless/wext-spy.c: In function 'get_spydata':
>> net/wireless/wext-spy.c:21:16: error: 'struct net_device' has no member named 'wireless_data'
      21 |         if (dev->wireless_data)
         |                ^~
   net/wireless/wext-spy.c:22:27: error: 'struct net_device' has no member named 'wireless_data'
      22 |                 return dev->wireless_data->spy_data;
         |                           ^~
--
   net/wireless/wext-priv.c: In function 'iw_handler_get_private':
>> net/wireless/wext-priv.c:22:17: error: 'struct net_device' has no member named 'wireless_handlers'
      22 |         if ((dev->wireless_handlers->num_private_args == 0) ||
         |                 ^~
   net/wireless/wext-priv.c:23:16: error: 'struct net_device' has no member named 'wireless_handlers'
      23 |            (dev->wireless_handlers->private_args == NULL))
         |                ^~
   net/wireless/wext-priv.c:27:36: error: 'struct net_device' has no member named 'wireless_handlers'
      27 |         if (wrqu->data.length < dev->wireless_handlers->num_private_args) {
         |                                    ^~
   net/wireless/wext-priv.c:31:40: error: 'struct net_device' has no member named 'wireless_handlers'
      31 |                 wrqu->data.length = dev->wireless_handlers->num_private_args;
         |                                        ^~
   net/wireless/wext-priv.c:36:32: error: 'struct net_device' has no member named 'wireless_handlers'
      36 |         wrqu->data.length = dev->wireless_handlers->num_private_args;
         |                                ^~
   net/wireless/wext-priv.c:39:26: error: 'struct net_device' has no member named 'wireless_handlers'
      39 |         memcpy(extra, dev->wireless_handlers->private_args,
         |                          ^~
   net/wireless/wext-priv.c: In function 'get_priv_descr_and_size':
   net/wireless/wext-priv.c:100:28: error: 'struct net_device' has no member named 'wireless_handlers'
     100 |         for (i = 0; i < dev->wireless_handlers->num_private_args; i++) {
         |                            ^~
   net/wireless/wext-priv.c:101:31: error: 'struct net_device' has no member named 'wireless_handlers'
     101 |                 if (cmd == dev->wireless_handlers->private_args[i].cmd) {
         |                               ^~
   net/wireless/wext-priv.c:102:37: error: 'struct net_device' has no member named 'wireless_handlers'
     102 |                         descr = &dev->wireless_handlers->private_args[i];
         |                                     ^~


vim +941 net/wireless/wext-core.c

^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  912  
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  913  /*
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  914   * Main IOCTl dispatcher.
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  915   * Check the type of IOCTL and call the appropriate wrapper...
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  916   */
4f39a1f5870104 net/wireless/wext-core.c Johannes Berg   2017-06-14  917  static int wireless_process_ioctl(struct net *net, struct iwreq *iwr,
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  918  				  unsigned int cmd,
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  919  				  struct iw_request_info *info,
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  920  				  wext_ioctl_func standard,
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  921  				  wext_ioctl_func private)
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  922  {
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  923  	struct net_device *dev;
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  924  	iw_handler	handler;
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  925  
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  926  	/* Permissions are already checked in dev_ioctl() before calling us.
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  927  	 * The copy_to/from_user() of ifr is also dealt with in there */
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  928  
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  929  	/* Make sure the device exist */
4f39a1f5870104 net/wireless/wext-core.c Johannes Berg   2017-06-14  930  	if ((dev = __dev_get_by_name(net, iwr->ifr_name)) == NULL)
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  931  		return -ENODEV;
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  932  
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  933  	/* A bunch of special cases, then the generic case...
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  934  	 * Note that 'cmd' is already filtered in dev_ioctl() with
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  935  	 * (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) */
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  936  	if (cmd == SIOCGIWSTATS)
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  937  		return standard(dev, iwr, cmd, info,
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  938  				&iw_handler_get_iwstats);
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  939  
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  940  #ifdef CONFIG_WEXT_PRIV
dd8ceabcd10d47 net/wireless/wext.c      Johannes Berg   2007-04-26 @941  	if (cmd == SIOCGIWPRIV && dev->wireless_handlers)
0f5cabba49021d net/wireless/wext.c      David S. Miller 2008-06-03  942  		return standard(dev, iwr, cmd, info,
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  943  				iw_handler_get_private);
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  944  #endif
dd8ceabcd10d47 net/wireless/wext.c      Johannes Berg   2007-04-26  945  
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  946  	/* Basic check */
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  947  	if (!netif_device_present(dev))
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  948  		return -ENODEV;
dd8ceabcd10d47 net/wireless/wext.c      Johannes Berg   2007-04-26  949  
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  950  	/* New driver API : try to find the handler */
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  951  	handler = get_handler(dev, cmd);
dd8ceabcd10d47 net/wireless/wext.c      Johannes Berg   2007-04-26  952  	if (handler) {
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  953  		/* Standard and private are not the same */
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  954  		if (cmd < SIOCIWFIRSTPRIV)
0f5cabba49021d net/wireless/wext.c      David S. Miller 2008-06-03  955  			return standard(dev, iwr, cmd, info, handler);
3d23e349d80717 net/wireless/wext-core.c Johannes Berg   2009-09-29  956  		else if (private)
0f5cabba49021d net/wireless/wext.c      David S. Miller 2008-06-03  957  			return private(dev, iwr, cmd, info, handler);
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  958  	}
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  959  	return -EOPNOTSUPP;
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  960  }
^1da177e4c3f41 net/core/wireless.c      Linus Torvalds  2005-04-16  961
Larry Finger April 4, 2022, 12:28 a.m. UTC | #3
On 4/3/22 14:20, Johannes Berg wrote:
> On Sun, 2022-04-03 at 13:14 -0500, Larry Finger wrote:
>> File net/wireless/Kconfig contains two blind configuration variables,
>> namely WEXT_PRIV and WEXT_SPY. If those variables are already in the
>> configuration file, they will be retained, but there is no way to
>> set them if they are missing other than to manually edit .config.
>> They should be enabled if either WIRELESS_EXT or CFG80211_WEXT are set
>> in the same manner as WEXT_CORE and WEXT_PROC.
>>
>> Personally, the setting of WEXT_SPY is not important; however, openSUSE
>> and Ubuntu both enable it in their default kernels. Other distros have
>> not been checked, but it is likely that they also enable that setting.
>>
> 
> They're intentionally this way though - they're only selected by the
> (few) drivers that need them.
> 
> Yeah, out of tree drivers lose out, but we don't really care?

Unfortunately, I do. At least I now know enough to turn those two on before they 
cause me any problems. Until yesterday, my configuration files were OK. I'm not 
sure what happened.

@Kalle - please drop this patch.

Larry
diff mbox series

Patch

diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig
index f620acd2a0f5..9c216af3ca55 100644
--- a/net/wireless/Kconfig
+++ b/net/wireless/Kconfig
@@ -12,10 +12,12 @@  config WEXT_PROC
 	depends on WEXT_CORE
 
 config WEXT_SPY
-	bool
+	def_bool y
+	depends on CFG80211_WEXT || WIRELESS_EXT
 
 config WEXT_PRIV
-	bool
+	def_bool y
+	depends on CFG80211_WEXT || WIRELESS_EXT
 
 config CFG80211
 	tristate "cfg80211 - wireless configuration API"