lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210191216.R9JPEG7C-lkp@intel.com>
Date:   Wed, 19 Oct 2022 12:34:25 +0800
From:   kernel test robot <lkp@...el.com>
To:     Johannes Berg <johannes.berg@...el.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: net/wireless/scan.c:1677:61: sparse: sparse: incorrect type in
 argument 2 (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   aae703b02f92bde9264366c545e87cec451de471
commit: c90b93b5b782891ebfda49d4e5da36632fefd5d1 wifi: cfg80211: update hidden BSSes to avoid WARN_ON
date:   9 days ago
config: nios2-randconfig-s042-20221017
compiler: nios2-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c90b93b5b782891ebfda49d4e5da36632fefd5d1
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout c90b93b5b782891ebfda49d4e5da36632fefd5d1
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 SHELL=/bin/bash net/wireless/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

sparse warnings: (new ones prefixed by >>)
>> net/wireless/scan.c:1677:61: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected struct cfg80211_bss_ies const *new_ies @@     got struct cfg80211_bss_ies const [noderef] __rcu *beacon_ies @@
   net/wireless/scan.c:1677:61: sparse:     expected struct cfg80211_bss_ies const *new_ies
   net/wireless/scan.c:1677:61: sparse:     got struct cfg80211_bss_ies const [noderef] __rcu *beacon_ies

vim +1677 net/wireless/scan.c

  1626	
  1627	static bool
  1628	cfg80211_update_known_bss(struct cfg80211_registered_device *rdev,
  1629				  struct cfg80211_internal_bss *known,
  1630				  struct cfg80211_internal_bss *new,
  1631				  bool signal_valid)
  1632	{
  1633		lockdep_assert_held(&rdev->bss_lock);
  1634	
  1635		/* Update IEs */
  1636		if (rcu_access_pointer(new->pub.proberesp_ies)) {
  1637			const struct cfg80211_bss_ies *old;
  1638	
  1639			old = rcu_access_pointer(known->pub.proberesp_ies);
  1640	
  1641			rcu_assign_pointer(known->pub.proberesp_ies,
  1642					   new->pub.proberesp_ies);
  1643			/* Override possible earlier Beacon frame IEs */
  1644			rcu_assign_pointer(known->pub.ies,
  1645					   new->pub.proberesp_ies);
  1646			if (old)
  1647				kfree_rcu((struct cfg80211_bss_ies *)old, rcu_head);
  1648		} else if (rcu_access_pointer(new->pub.beacon_ies)) {
  1649			const struct cfg80211_bss_ies *old;
  1650	
  1651			if (known->pub.hidden_beacon_bss &&
  1652			    !list_empty(&known->hidden_list)) {
  1653				const struct cfg80211_bss_ies *f;
  1654	
  1655				/* The known BSS struct is one of the probe
  1656				 * response members of a group, but we're
  1657				 * receiving a beacon (beacon_ies in the new
  1658				 * bss is used). This can only mean that the
  1659				 * AP changed its beacon from not having an
  1660				 * SSID to showing it, which is confusing so
  1661				 * drop this information.
  1662				 */
  1663	
  1664				f = rcu_access_pointer(new->pub.beacon_ies);
  1665				kfree_rcu((struct cfg80211_bss_ies *)f, rcu_head);
  1666				return false;
  1667			}
  1668	
  1669			old = rcu_access_pointer(known->pub.beacon_ies);
  1670	
  1671			rcu_assign_pointer(known->pub.beacon_ies, new->pub.beacon_ies);
  1672	
  1673			/* Override IEs if they were from a beacon before */
  1674			if (old == rcu_access_pointer(known->pub.ies))
  1675				rcu_assign_pointer(known->pub.ies, new->pub.beacon_ies);
  1676	
> 1677			cfg80211_update_hidden_bsses(known, new->pub.beacon_ies, old);
  1678	
  1679			if (old)
  1680				kfree_rcu((struct cfg80211_bss_ies *)old, rcu_head);
  1681		}
  1682	
  1683		known->pub.beacon_interval = new->pub.beacon_interval;
  1684	
  1685		/* don't update the signal if beacon was heard on
  1686		 * adjacent channel.
  1687		 */
  1688		if (signal_valid)
  1689			known->pub.signal = new->pub.signal;
  1690		known->pub.capability = new->pub.capability;
  1691		known->ts = new->ts;
  1692		known->ts_boottime = new->ts_boottime;
  1693		known->parent_tsf = new->parent_tsf;
  1694		known->pub.chains = new->pub.chains;
  1695		memcpy(known->pub.chain_signal, new->pub.chain_signal,
  1696		       IEEE80211_MAX_CHAINS);
  1697		ether_addr_copy(known->parent_bssid, new->parent_bssid);
  1698		known->pub.max_bssid_indicator = new->pub.max_bssid_indicator;
  1699		known->pub.bssid_index = new->pub.bssid_index;
  1700	
  1701		return true;
  1702	}
  1703	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (160308 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ