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-next>] [day] [month] [year] [list]
Message-ID: <202401102205.XmxWrS5y-lkp@intel.com>
Date: Wed, 10 Jan 2024 22:55:22 +0800
From: kernel test robot <lkp@...el.com>
To: Vlad Buslov <vladbu@...dia.com>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	linux-kernel@...r.kernel.org, Saeed Mahameed <saeedm@...dia.com>,
	Maor Dickman <maord@...dia.com>, Roi Dayan <roid@...dia.com>
Subject: drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c:1833:4:
 warning: 'snprintf' will always be truncated; specified size is 80, but
 format string expands to at least 94

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ab27740f76654ed58dd32ac0ba0031c18a6dea3b
commit: 70f0302b3f2053b64a6a653a76a20cb95438dc85 net/mlx5: Bridge, implement mdb offload
date:   9 months ago
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20240110/202401102205.XmxWrS5y-lkp@intel.com/config)
compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 7e186d366d6c7def0543acc255931f617e76dff0)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240110/202401102205.XmxWrS5y-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/202401102205.XmxWrS5y-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c:1833:4: warning: 'snprintf' will always be truncated; specified size is 80, but format string expands to at least 94 [-Wformat-truncation-non-kprintf]
    1833 |                         NL_SET_ERR_MSG_FMT_MOD(extack,
         |                         ^
   include/linux/netlink.h:130:2: note: expanded from macro 'NL_SET_ERR_MSG_FMT_MOD'
     130 |         NL_SET_ERR_MSG_FMT((extack), KBUILD_MODNAME ": " fmt, ##args)
         |         ^
   include/linux/netlink.h:115:6: note: expanded from macro 'NL_SET_ERR_MSG_FMT'
     115 |         if (snprintf(__extack->_msg_buf, NETLINK_MAX_FMTMSG_LEN,               \
         |             ^
   1 warning generated.


vim +/snprintf +1833 drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c

  1805	
  1806	int mlx5_esw_bridge_port_mdb_add(u16 vport_num, u16 esw_owner_vhca_id, const unsigned char *addr,
  1807					 u16 vid, struct mlx5_esw_bridge_offloads *br_offloads,
  1808					 struct netlink_ext_ack *extack)
  1809	{
  1810		struct mlx5_esw_bridge_vlan *vlan;
  1811		struct mlx5_esw_bridge_port *port;
  1812		struct mlx5_esw_bridge *bridge;
  1813		int err;
  1814	
  1815		port = mlx5_esw_bridge_port_lookup(vport_num, esw_owner_vhca_id, br_offloads);
  1816		if (!port) {
  1817			esw_warn(br_offloads->esw->dev,
  1818				 "Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)\n",
  1819				 addr, vport_num);
  1820			NL_SET_ERR_MSG_FMT_MOD(extack,
  1821					       "Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)\n",
  1822					       addr, vport_num);
  1823			return -EINVAL;
  1824		}
  1825	
  1826		bridge = port->bridge;
  1827		if (bridge->flags & MLX5_ESW_BRIDGE_VLAN_FILTERING_FLAG && vid) {
  1828			vlan = mlx5_esw_bridge_vlan_lookup(vid, port);
  1829			if (!vlan) {
  1830				esw_warn(br_offloads->esw->dev,
  1831					 "Failed to lookup bridge port vlan metadata to create MDB (MAC=%pM,vid=%u,vport=%u)\n",
  1832					 addr, vid, vport_num);
> 1833				NL_SET_ERR_MSG_FMT_MOD(extack,
  1834						       "Failed to lookup bridge port vlan metadata to create MDB (MAC=%pM,vid=%u,vport=%u)\n",
  1835						       addr, vid, vport_num);
  1836				return -EINVAL;
  1837			}
  1838		}
  1839	
  1840		err = mlx5_esw_bridge_port_mdb_attach(port, addr, vid);
  1841		if (err) {
  1842			NL_SET_ERR_MSG_FMT_MOD(extack, "Failed to add MDB (MAC=%pM,vid=%u,vport=%u)\n",
  1843					       addr, vid, vport_num);
  1844			return err;
  1845		}
  1846	
  1847		return 0;
  1848	}
  1849	

-- 
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