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: <202210220052.JKcJm7nr-lkp@intel.com>
Date:   Sat, 22 Oct 2022 00:28:44 +0800
From:   kernel test robot <lkp@...el.com>
To:     Hector Martin <marcan@...can.st>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [asahilinux:bits/080-wifi 21/38]
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1087:28: sparse:
 sparse: incorrect type in assignment (different base types)

tree:   https://github.com/AsahiLinux/linux bits/080-wifi
head:   567ce17b015ace1b3643f027a5346c25bf4caa85
commit: 2c3ff3bf4abe65a5f526de263e84cf782075e032 [21/38] brcmfmac: cfg80211: Add support for scan params v2
config: arm-randconfig-s041-20221019
compiler: arm-linux-gnueabi-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://github.com/AsahiLinux/linux/commit/2c3ff3bf4abe65a5f526de263e84cf782075e032
        git remote add asahilinux https://github.com/AsahiLinux/linux
        git fetch --no-tags asahilinux bits/080-wifi
        git checkout 2c3ff3bf4abe65a5f526de263e84cf782075e032
        # 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=arm SHELL=/bin/bash drivers/net/wireless/broadcom/brcm80211/brcmfmac/

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 >>)
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1087:28: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le16 [usertype] version @@     got int @@
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1087:28: sparse:     expected restricted __le16 [usertype] version
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1087:28: sparse:     got int
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1149:38: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted __le32 [usertype] scan_type @@     got int @@
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1149:38: sparse:     expected restricted __le32 [usertype] scan_type
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1149:38: sparse:     got int
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:790:30: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned char [usertype] scan_type @@     got restricted __le32 [usertype] scan_type @@
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:790:30: sparse:     expected unsigned char [usertype] scan_type
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:790:30: sparse:     got restricted __le32 [usertype] scan_type

vim +1087 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

  1069	
  1070	static void brcmf_escan_prep(struct brcmf_cfg80211_info *cfg,
  1071				     struct brcmf_scan_params_v2_le *params_le,
  1072				     struct cfg80211_scan_request *request)
  1073	{
  1074		u32 n_ssids;
  1075		u32 n_channels;
  1076		s32 i;
  1077		s32 offset;
  1078		u16 chanspec;
  1079		char *ptr;
  1080		int length;
  1081		struct brcmf_ssid_le ssid_le;
  1082	
  1083		eth_broadcast_addr(params_le->bssid);
  1084	
  1085		length = BRCMF_SCAN_PARAMS_V2_FIXED_SIZE;
  1086	
> 1087		params_le->version = BRCMF_SCAN_PARAMS_VERSION_V2;
  1088		params_le->bss_type = DOT11_BSSTYPE_ANY;
  1089		params_le->scan_type = BRCMF_SCANTYPE_ACTIVE;
  1090		params_le->channel_num = 0;
  1091		params_le->nprobes = cpu_to_le32(-1);
  1092		params_le->active_time = cpu_to_le32(-1);
  1093		params_le->passive_time = cpu_to_le32(-1);
  1094		params_le->home_time = cpu_to_le32(-1);
  1095		memset(&params_le->ssid_le, 0, sizeof(params_le->ssid_le));
  1096	
  1097		/* Scan abort */
  1098		if (!request) {
  1099			length += sizeof(u16);
  1100			params_le->channel_num = cpu_to_le32(1);
  1101			params_le->channel_list[0] = cpu_to_le16(-1);
  1102			params_le->length = cpu_to_le16(length);
  1103			return;
  1104		}
  1105	
  1106		n_ssids = request->n_ssids;
  1107		n_channels = request->n_channels;
  1108	
  1109		/* Copy channel array if applicable */
  1110		brcmf_dbg(SCAN, "### List of channelspecs to scan ### %d\n",
  1111			  n_channels);
  1112		if (n_channels > 0) {
  1113			length += roundup(sizeof(u16) * n_channels, sizeof(u32));
  1114			for (i = 0; i < n_channels; i++) {
  1115				chanspec = channel_to_chanspec(&cfg->d11inf,
  1116							       request->channels[i]);
  1117				brcmf_dbg(SCAN, "Chan : %d, Channel spec: %x\n",
  1118					  request->channels[i]->hw_value, chanspec);
  1119				params_le->channel_list[i] = cpu_to_le16(chanspec);
  1120			}
  1121		} else {
  1122			brcmf_dbg(SCAN, "Scanning all channels\n");
  1123		}
  1124	
  1125		/* Copy ssid array if applicable */
  1126		brcmf_dbg(SCAN, "### List of SSIDs to scan ### %d\n", n_ssids);
  1127		if (n_ssids > 0) {
  1128			offset = offsetof(struct brcmf_scan_params_v2_le, channel_list) +
  1129					n_channels * sizeof(u16);
  1130			offset = roundup(offset, sizeof(u32));
  1131			length += sizeof(ssid_le) * n_ssids,
  1132			ptr = (char *)params_le + offset;
  1133			for (i = 0; i < n_ssids; i++) {
  1134				memset(&ssid_le, 0, sizeof(ssid_le));
  1135				ssid_le.SSID_len =
  1136						cpu_to_le32(request->ssids[i].ssid_len);
  1137				memcpy(ssid_le.SSID, request->ssids[i].ssid,
  1138				       request->ssids[i].ssid_len);
  1139				if (!ssid_le.SSID_len)
  1140					brcmf_dbg(SCAN, "%d: Broadcast scan\n", i);
  1141				else
  1142					brcmf_dbg(SCAN, "%d: scan for  %.32s size=%d\n",
  1143						  i, ssid_le.SSID, ssid_le.SSID_len);
  1144				memcpy(ptr, &ssid_le, sizeof(ssid_le));
  1145				ptr += sizeof(ssid_le);
  1146			}
  1147		} else {
  1148			brcmf_dbg(SCAN, "Performing passive scan\n");
> 1149			params_le->scan_type = BRCMF_SCANTYPE_PASSIVE;
  1150		}
  1151		params_le->length = cpu_to_le16(length);
  1152		/* Adding mask to channel numbers */
  1153		params_le->channel_num =
  1154			cpu_to_le32((n_ssids << BRCMF_SCAN_PARAMS_NSSID_SHIFT) |
  1155				(n_channels & BRCMF_SCAN_PARAMS_COUNT_MASK));
  1156	}
  1157	

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ