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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202501121148.0ofCuD5J-lkp@intel.com>
Date: Sun, 12 Jan 2025 12:09:12 +0800
From: kernel test robot <lkp@...el.com>
To: Potin Lai <potin.lai.pt@...il.com>,
	Samuel Mendoza-Jonas <sam@...dozajonas.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Simon Horman <horms@...nel.org>,
	Ivan Mikhaylov <fr0st61te@...il.com>,
	Paul Fertser <fercerpav@...il.com>,
	Patrick Williams <patrick@...cx.xyz>
Cc: oe-kbuild-all@...ts.linux.dev, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, Cosmo Chou <cosmo.chou@...ntatw.com>,
	Potin Lai <potin.lai@...ntatw.com>
Subject: Re: [PATCH v2 2/2] net/ncsi: fix state race during channel probe
 completion

Hi Potin,

kernel test robot noticed the following build errors:

[auto build test ERROR on fc033cf25e612e840e545f8d5ad2edd6ba613ed5]

url:    https://github.com/intel-lab-lkp/linux/commits/Potin-Lai/net-ncsi-fix-locking-in-Get-MAC-Address-handling/20250111-190440
base:   fc033cf25e612e840e545f8d5ad2edd6ba613ed5
patch link:    https://lore.kernel.org/r/20250111-fix-ncsi-mac-v2-2-838e0a1a233a%40gmail.com
patch subject: [PATCH v2 2/2] net/ncsi: fix state race during channel probe completion
config: arc-randconfig-001-20250112 (https://download.01.org/0day-ci/archive/20250112/202501121148.0ofCuD5J-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250112/202501121148.0ofCuD5J-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501121148.0ofCuD5J-lkp@intel.com/

All errors (new ones prefixed by >>):

   net/ncsi/ncsi-manage.c: In function 'ncsi_probe_channel':
>> net/ncsi/ncsi-manage.c:1494:54: error: 'struct ncsi_dev_priv' has no member named 'max_package'; did you mean 'multi_package'?
    1494 |                 if (ndp->package_probe_id + 1 < ndp->max_package)
         |                                                      ^~~~~~~~~~~
         |                                                      multi_package


vim +1494 net/ncsi/ncsi-manage.c

  1357	
  1358	static void ncsi_probe_channel(struct ncsi_dev_priv *ndp)
  1359	{
  1360		struct ncsi_dev *nd = &ndp->ndev;
  1361		struct ncsi_package *np;
  1362		struct ncsi_cmd_arg nca;
  1363		unsigned char index;
  1364		int ret;
  1365	
  1366		nca.ndp = ndp;
  1367		nca.req_flags = NCSI_REQ_FLAG_EVENT_DRIVEN;
  1368		switch (nd->state) {
  1369		case ncsi_dev_state_probe:
  1370			nd->state = ncsi_dev_state_probe_deselect;
  1371			fallthrough;
  1372		case ncsi_dev_state_probe_deselect:
  1373			ndp->pending_req_num = 8;
  1374	
  1375			/* Deselect all possible packages */
  1376			nca.type = NCSI_PKT_CMD_DP;
  1377			nca.channel = NCSI_RESERVED_CHANNEL;
  1378			for (index = 0; index < 8; index++) {
  1379				nca.package = index;
  1380				ret = ncsi_xmit_cmd(&nca);
  1381				if (ret)
  1382					goto error;
  1383			}
  1384	
  1385			nd->state = ncsi_dev_state_probe_package;
  1386			break;
  1387		case ncsi_dev_state_probe_package:
  1388			ndp->pending_req_num = 1;
  1389	
  1390			nca.type = NCSI_PKT_CMD_SP;
  1391			nca.bytes[0] = 1;
  1392			nca.package = ndp->package_probe_id;
  1393			nca.channel = NCSI_RESERVED_CHANNEL;
  1394			ret = ncsi_xmit_cmd(&nca);
  1395			if (ret)
  1396				goto error;
  1397			nd->state = ncsi_dev_state_probe_channel;
  1398			break;
  1399		case ncsi_dev_state_probe_channel:
  1400			ndp->active_package = ncsi_find_package(ndp,
  1401								ndp->package_probe_id);
  1402			if (!ndp->active_package) {
  1403				/* No response */
  1404				nd->state = ncsi_dev_state_probe_dp;
  1405				schedule_work(&ndp->work);
  1406				break;
  1407			}
  1408			nd->state = ncsi_dev_state_probe_cis;
  1409			if (IS_ENABLED(CONFIG_NCSI_OEM_CMD_GET_MAC) &&
  1410			    ndp->mlx_multi_host)
  1411				nd->state = ncsi_dev_state_probe_mlx_gma;
  1412	
  1413			schedule_work(&ndp->work);
  1414			break;
  1415		case ncsi_dev_state_probe_mlx_gma:
  1416			ndp->pending_req_num = 1;
  1417	
  1418			nca.type = NCSI_PKT_CMD_OEM;
  1419			nca.package = ndp->active_package->id;
  1420			nca.channel = 0;
  1421			ret = ncsi_oem_gma_handler_mlx(&nca);
  1422			if (ret)
  1423				goto error;
  1424	
  1425			nd->state = ncsi_dev_state_probe_mlx_smaf;
  1426			break;
  1427		case ncsi_dev_state_probe_mlx_smaf:
  1428			ndp->pending_req_num = 1;
  1429	
  1430			nca.type = NCSI_PKT_CMD_OEM;
  1431			nca.package = ndp->active_package->id;
  1432			nca.channel = 0;
  1433			ret = ncsi_oem_smaf_mlx(&nca);
  1434			if (ret)
  1435				goto error;
  1436	
  1437			nd->state = ncsi_dev_state_probe_cis;
  1438			break;
  1439		case ncsi_dev_state_probe_keep_phy:
  1440			ndp->pending_req_num = 1;
  1441	
  1442			nca.type = NCSI_PKT_CMD_OEM;
  1443			nca.package = ndp->active_package->id;
  1444			nca.channel = 0;
  1445			ret = ncsi_oem_keep_phy_intel(&nca);
  1446			if (ret)
  1447				goto error;
  1448	
  1449			nd->state = ncsi_dev_state_probe_gvi;
  1450			break;
  1451		case ncsi_dev_state_probe_cis:
  1452		case ncsi_dev_state_probe_gvi:
  1453		case ncsi_dev_state_probe_gc:
  1454		case ncsi_dev_state_probe_gls:
  1455			np = ndp->active_package;
  1456			ndp->pending_req_num = 1;
  1457	
  1458			/* Clear initial state Retrieve version, capability or link status */
  1459			if (nd->state == ncsi_dev_state_probe_cis)
  1460				nca.type = NCSI_PKT_CMD_CIS;
  1461			else if (nd->state == ncsi_dev_state_probe_gvi)
  1462				nca.type = NCSI_PKT_CMD_GVI;
  1463			else if (nd->state == ncsi_dev_state_probe_gc)
  1464				nca.type = NCSI_PKT_CMD_GC;
  1465			else
  1466				nca.type = NCSI_PKT_CMD_GLS;
  1467	
  1468			nca.package = np->id;
  1469			nca.channel = ndp->channel_probe_id;
  1470	
  1471			ret = ncsi_xmit_cmd(&nca);
  1472			if (ret)
  1473				goto error;
  1474	
  1475			if (nd->state == ncsi_dev_state_probe_cis) {
  1476				nd->state = ncsi_dev_state_probe_gvi;
  1477				if (IS_ENABLED(CONFIG_NCSI_OEM_CMD_KEEP_PHY) && ndp->channel_probe_id == 0)
  1478					nd->state = ncsi_dev_state_probe_keep_phy;
  1479			} else if (nd->state == ncsi_dev_state_probe_gvi) {
  1480				nd->state = ncsi_dev_state_probe_gc;
  1481			} else if (nd->state == ncsi_dev_state_probe_gc) {
  1482				nd->state = ncsi_dev_state_probe_gls;
  1483			} else {
  1484				nd->state = ncsi_dev_state_probe_cis;
  1485				ndp->channel_probe_id++;
  1486			}
  1487	
  1488			if (ndp->channel_probe_id == ndp->channel_count) {
  1489				ndp->channel_probe_id = 0;
  1490				nd->state = ncsi_dev_state_probe_dp;
  1491			}
  1492			break;
  1493		case ncsi_dev_state_probe_dp:
> 1494			if (ndp->package_probe_id + 1 < ndp->max_package)
  1495				ndp->pending_req_num = 1;
  1496			else
  1497				nca.req_flags = 0;
  1498	
  1499			/* Deselect the current package */
  1500			nca.type = NCSI_PKT_CMD_DP;
  1501			nca.package = ndp->package_probe_id;
  1502			nca.channel = NCSI_RESERVED_CHANNEL;
  1503			ret = ncsi_xmit_cmd(&nca);
  1504			if (ret)
  1505				goto error;
  1506	
  1507			/* Probe next package */
  1508			ndp->package_probe_id++;
  1509			if (ndp->package_probe_id >= 8) {
  1510				/* Probe finished */
  1511				ndp->flags |= NCSI_DEV_PROBED;
  1512				break;
  1513			}
  1514			nd->state = ncsi_dev_state_probe_package;
  1515			ndp->active_package = NULL;
  1516			break;
  1517		default:
  1518			netdev_warn(nd->dev, "Wrong NCSI state 0x%0x in enumeration\n",
  1519				    nd->state);
  1520		}
  1521	
  1522		if (ndp->flags & NCSI_DEV_PROBED) {
  1523			/* Check if all packages have HWA support */
  1524			ncsi_check_hwa(ndp);
  1525			ncsi_choose_active_channel(ndp);
  1526		}
  1527	
  1528		return;
  1529	error:
  1530		netdev_err(ndp->ndev.dev,
  1531			   "NCSI: Failed to transmit cmd 0x%x during probe\n",
  1532			   nca.type);
  1533		ncsi_report_link(ndp, true);
  1534	}
  1535	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ