From: Philip Li <philip.li@intel.com>
To: Waiman Long <llong@redhat.com>
Cc: kernel test robot <lkp@intel.com>,
<oe-kbuild-all@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
"Paul E. McKenney" <paulmck@kernel.org>
Subject: Re: net/8021q/vlan.c:241:46: warning: '%.4i' directive output may be truncated writing between 4 and 5 bytes into a region of size between 0 and 15
Date: Mon, 10 Feb 2025 22:47:05 +0800 [thread overview]
Message-ID: <Z6oRaZBeKpIg+4nv@rli9-mobl> (raw)
In-Reply-To: <3008ca8d-e599-437b-8f1e-0dbe86202f38@redhat.com>
On Mon, Feb 10, 2025 at 09:24:58AM -0500, Waiman Long wrote:
> On 2/9/25 11:44 PM, kernel test robot wrote:
> > Hi Waiman,
> >
> > FYI, the error/warning still remains.
> >
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head: a64dcfb451e254085a7daee5fe51bf22959d52d3
> > commit: 925da92ba5cb0c82d07cdd5049a07e40f54e9c44 rcu: Avoid unneeded function call in rcu_read_unlock()
> > date: 3 years, 5 months ago
> > config: sparc-randconfig-r122-20240116 (https://download.01.org/0day-ci/archive/20250210/202502101253.TDZbCYh6-lkp@intel.com/config)
> > compiler: sparc-linux-gcc (GCC) 12.4.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250210/202502101253.TDZbCYh6-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@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202502101253.TDZbCYh6-lkp@intel.com/
> >
> > All warnings (new ones prefixed by >>):
> >
> > net/8021q/vlan.c: In function 'vlan_ioctl_handler':
> > net/8021q/vlan.c:253:46: warning: '%i' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 15 [-Wformat-truncation=]
> > 253 | snprintf(name, IFNAMSIZ, "%s.%i", real_dev->name, vlan_id);
> > | ^~
> > In function 'register_vlan_device',
> > inlined from 'vlan_ioctl_handler' at net/8021q/vlan.c:628:9:
> > net/8021q/vlan.c:253:42: note: directive argument in the range [0, 65535]
> > 253 | snprintf(name, IFNAMSIZ, "%s.%i", real_dev->name, vlan_id);
> > | ^~~~~~~
> > net/8021q/vlan.c:253:17: note: 'snprintf' output between 3 and 22 bytes into a destination of size 16
> > 253 | snprintf(name, IFNAMSIZ, "%s.%i", real_dev->name, vlan_id);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > net/8021q/vlan.c: In function 'vlan_ioctl_handler':
> > > > net/8021q/vlan.c:241:46: warning: '%.4i' directive output may be truncated writing between 4 and 5 bytes into a region of size between 0 and 15 [-Wformat-truncation=]
> > 241 | snprintf(name, IFNAMSIZ, "%s.%.4i", real_dev->name, vlan_id);
> > | ^~~~
> > In function 'register_vlan_device',
> > inlined from 'vlan_ioctl_handler' at net/8021q/vlan.c:628:9:
> > net/8021q/vlan.c:241:42: note: directive argument in the range [0, 65535]
> > 241 | snprintf(name, IFNAMSIZ, "%s.%.4i", real_dev->name, vlan_id);
> > | ^~~~~~~~~
> > net/8021q/vlan.c:241:17: note: 'snprintf' output between 6 and 22 bytes into a destination of size 16
> > 241 | snprintf(name, IFNAMSIZ, "%s.%.4i", real_dev->name, vlan_id);
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >
> > vim +241 net/8021q/vlan.c
>
> Why me? I have never touched net/8021q/vlan.c and I don't believe commit
> 925da92ba5cb ("rcu: Avoid unneeded function call in rcu_read_unlock()") has
> anything to do with the snprintf format warnings.
Sorry about this, this is a wrong report and we will fix the
bug in the bot side asap. Sorry for any inconvenience.
>
> Regards,
> Longman
>
>
next prev parent reply other threads:[~2025-02-10 14:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 4:44 kernel test robot
2025-02-10 14:24 ` Waiman Long
2025-02-10 14:47 ` Philip Li [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-01-20 9:39 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z6oRaZBeKpIg+4nv@rli9-mobl \
--to=philip.li@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llong@redhat.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=paulmck@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®