[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240112194729.GB3703896@dev-arch.thelio-3990X>
Date: Fri, 12 Jan 2024 12:47:29 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: kernel test robot <lkp@...el.com>
Cc: Vlad Buslov <vladbu@...dia.com>, 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>, masahiroy@...nel.org
Subject: Re: 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
On Wed, Jan 10, 2024 at 10:55:22PM +0800, kernel test robot wrote:
> 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.
I have not looked to see if this is a legitimate issue or not, as clang
does not understand the kernel's special %p modifiers, so it is a little
hard to tell at first glance. For this reason, I sent a patch turning
off the -non-kprintf warnings but it has not been picked up yet:
https://lore.kernel.org/20231002-disable-wformat-truncation-overflow-non-kprintf-v1-1-35179205c8d9@kernel.org/
Cheers,
Nathan
Powered by blists - more mailing lists