[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202007281247.3Pfw7f7K%lkp@intel.com>
Date: Tue, 28 Jul 2020 12:47:03 +0800
From: kernel test robot <lkp@...el.com>
To: Christoph Hellwig <hch@....de>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Tony Luck <tony.luck@...el.com>
Subject: drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1388:5:
warning: 'strncpy' output may be truncated copying 32 bytes from a string of
length 32
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 92ed301919932f777713b9172e525674157e983d
commit: df41017eafd267c08acbfff99d34e4f96bbfbc92 ia64: remove support for machvecs
date: 12 months ago
config: ia64-randconfig-r003-20200728 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.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
git checkout df41017eafd267c08acbfff99d34e4f96bbfbc92
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c: In function 'ieee80211_softmac_init':
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2598:8: warning: cast between incompatible function types from 'void (*)(struct ieee80211_device *)' to 'void (*)(long unsigned int)' [-Wcast-function-type]
2598 | (void(*)(unsigned long)) ieee80211_sta_ps,
| ^
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c: In function 'ieee80211_softmac_new_net':
>> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1388:5: warning: 'strncpy' output may be truncated copying 32 bytes from a string of length 32 [-Wstringop-truncation]
1388 | strncpy(tmp_ssid, ieee->current_network.ssid, IW_ESSID_MAX_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1393:4: warning: 'strncpy' output may be truncated copying 32 bytes from a string of length 32 [-Wstringop-truncation]
1393 | strncpy(ieee->current_network.ssid, tmp_ssid, IW_ESSID_MAX_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'ieee80211_softmac_new_net',
inlined from 'ieee80211_softmac_check_all_nets' at drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1455:4:
>> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1388:5: warning: 'strncpy' output may be truncated copying 32 bytes from a string of length 32 [-Wstringop-truncation]
1388 | strncpy(tmp_ssid, ieee->current_network.ssid, IW_ESSID_MAX_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1393:4: warning: 'strncpy' output may be truncated copying 32 bytes from a string of length 32 [-Wstringop-truncation]
1393 | strncpy(ieee->current_network.ssid, tmp_ssid, IW_ESSID_MAX_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/strncpy +1388 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1341
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1342 inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee80211_network *net)
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1343 {
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1344 u8 tmp_ssid[IW_ESSID_MAX_SIZE + 1];
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1345 int tmp_ssid_len = 0;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1346
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1347 short apset, ssidset, ssidbroad, apmatch, ssidmatch;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1348
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1349 /* we are interested in new new only if we are not associated
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1350 * and we are not associating / authenticating
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1351 */
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1352 if (ieee->state != IEEE80211_NOLINK)
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1353 return;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1354
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1355 if ((ieee->iw_mode == IW_MODE_INFRA) && !(net->capability & WLAN_CAPABILITY_BSS))
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1356 return;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1357
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1358 if ((ieee->iw_mode == IW_MODE_ADHOC) && !(net->capability & WLAN_CAPABILITY_IBSS))
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1359 return;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1360
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1361 if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC) {
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1362 /* if the user specified the AP MAC, we need also the essid
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1363 * This could be obtained by beacons or, if the network does not
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1364 * broadcast it, it can be put manually.
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1365 */
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1366 apset = ieee->wap_set;//(memcmp(ieee->current_network.bssid, zero,ETH_ALEN)!=0 );
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1367 ssidset = ieee->ssid_set;//ieee->current_network.ssid[0] != '\0';
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1368 ssidbroad = !(net->ssid_len == 0 || net->ssid[0] == '\0');
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1369 apmatch = (memcmp(ieee->current_network.bssid, net->bssid, ETH_ALEN) == 0);
de6610e27dd2e4 John Whitmore 2018-07-07 1370 ssidmatch = (ieee->current_network.ssid_len == net->ssid_len) &&
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1371 (!strncmp(ieee->current_network.ssid, net->ssid, net->ssid_len));
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1372
591968b2f40491 John Whitmore 2018-07-10 1373 /* if the user set the AP check if match.
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1374 * if the network does not broadcast essid we check the user supplyed ANY essid
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1375 * if the network does broadcast and the user does not set essid it is OK
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1376 * if the network does broadcast and the user did set essid chech if essid match
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1377 */
591968b2f40491 John Whitmore 2018-07-10 1378 if ((apset && apmatch &&
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1379 ((ssidset && ssidbroad && ssidmatch) || (ssidbroad && !ssidset) || (!ssidbroad && ssidset))) ||
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1380 /* if the ap is not set, check that the user set the bssid
935d59ff255896 Masanari Iida 2012-08-10 1381 * and the network does broadcast and that those two bssid matches
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1382 */
deb379066d376d John Whitmore 2018-07-10 1383 (!apset && ssidset && ssidbroad && ssidmatch)) {
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1384 /* if the essid is hidden replace it with the
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1385 * essid provided by the user.
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1386 */
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1387 if (!ssidbroad) {
8fc8598e61f6f3 Jerry Chuang 2009-11-03 @1388 strncpy(tmp_ssid, ieee->current_network.ssid, IW_ESSID_MAX_SIZE);
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1389 tmp_ssid_len = ieee->current_network.ssid_len;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1390 }
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1391 memcpy(&ieee->current_network, net, sizeof(struct ieee80211_network));
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1392
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1393 strncpy(ieee->current_network.ssid, tmp_ssid, IW_ESSID_MAX_SIZE);
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1394 ieee->current_network.ssid_len = tmp_ssid_len;
4031e6ca35993f John Whitmore 2018-07-04 1395 printk(KERN_INFO"Linking with %s,channel:%d, qos:%d, myHT:%d, networkHT:%d\n",
4031e6ca35993f John Whitmore 2018-07-04 1396 ieee->current_network.ssid,
4031e6ca35993f John Whitmore 2018-07-04 1397 ieee->current_network.channel,
4031e6ca35993f John Whitmore 2018-07-04 1398 ieee->current_network.qos_data.supported,
4031e6ca35993f John Whitmore 2018-07-04 1399 ieee->pHTInfo->bEnableHT,
4031e6ca35993f John Whitmore 2018-07-04 1400 ieee->current_network.bssht.bdSupportHT);
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1401
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1402 //ieee->pHTInfo->IOTAction = 0;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1403 HTResetIOTSetting(ieee->pHTInfo);
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1404 if (ieee->iw_mode == IW_MODE_INFRA) {
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1405 /* Join the network for the first time */
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1406 ieee->AsocRetryCount = 0;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1407 //for HT by amy 080514
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1408 if ((ieee->current_network.qos_data.supported == 1) &&
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1409 // (ieee->pHTInfo->bEnableHT && ieee->current_network.bssht.bdSupportHT))
eb2cbcc37763b6 John Whitmore 2018-07-10 1410 ieee->current_network.bssht.bdSupportHT) {
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1411 /*WB, 2008.09.09:bCurrentHTSupport and bEnableHT two flags are going to put together to check whether we are in HT now, so needn't to check bEnableHT flags here. That's is to say we will set to HT support whenever joined AP has the ability to support HT. And whether we are in HT or not, please check bCurrentHTSupport&&bEnableHT now please.*/
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1412 // ieee->pHTInfo->bCurrentHTSupport = true;
e4c8f0638ae9ea John Whitmore 2018-07-10 1413 HTResetSelfAndSavePeerSetting(ieee, &ieee->current_network);
eb2cbcc37763b6 John Whitmore 2018-07-10 1414 } else {
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1415 ieee->pHTInfo->bCurrentHTSupport = false;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1416 }
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1417
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1418 ieee->state = IEEE80211_ASSOCIATING;
1761a85c3bed33 Bhaktipriya Shridhar 2016-02-20 1419 schedule_work(&ieee->associate_procedure_wq);
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1420 } else {
58af58007e7bf6 Jesper Juhl 2011-08-13 1421 if (ieee80211_is_54g(&ieee->current_network) &&
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1422 (ieee->modulation & IEEE80211_OFDM_MODULATION)) {
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1423 ieee->rate = 108;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1424 ieee->SetWirelessMode(ieee->dev, IEEE_G);
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1425 printk(KERN_INFO"Using G rates\n");
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1426 } else {
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1427 ieee->rate = 22;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1428 ieee->SetWirelessMode(ieee->dev, IEEE_B);
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1429 printk(KERN_INFO"Using B rates\n");
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1430 }
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1431 memset(ieee->dot11HTOperationalRateSet, 0, 16);
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1432 //HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1433 ieee->state = IEEE80211_LINKED;
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1434 }
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1435 }
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1436 }
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1437 }
8fc8598e61f6f3 Jerry Chuang 2009-11-03 1438
:::::: The code at line 1388 was first introduced by commit
:::::: 8fc8598e61f6f384f3eaf1d9b09500c12af47b37 Staging: Added Realtek rtl8192u driver to staging
:::::: TO: Jerry Chuang <jerry-chuang@...ltek.com>
:::::: CC: Greg Kroah-Hartman <gregkh@...e.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (32676 bytes)
Powered by blists - more mailing lists