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: <ecc05528-ba59-922b-7384-4bedd46cf89b@intel.com>
Date:   Tue, 3 Oct 2023 16:01:18 -0700
From:   Jesse Brandeburg <jesse.brandeburg@...el.com>
To:     Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        Tony Nguyen <anthony.l.nguyen@...el.com>,
        "David S. Miller" <davem@...emloft.net>,
        "Eric Dumazet" <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
CC:     <linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>,
        <intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] iavf: Avoid a memory allocation in
 iavf_print_link_message()

On 10/3/2023 1:33 PM, Christophe JAILLET wrote:
> kasprintf() is much better.

cool! I just sent the patches and cc'd you earlier today.

>>
>> your patch still shows these errors
> 
> I built-tested the patch before sending, so this is strange.
> 
> However, I got a similar feedback from Greg KH and the "kernel test 
> robot" for another similar patch.
> 
> What version of gcc do you use?
> I use 12.3.0, and I suspect that the value range algorithm or how the 
> diagnostic is done has been improved in recent gcc.

Fedora gcc 12.3.1, with W=1 flag

gcc version 12.3.1 20230508 (Red Hat 12.3.1-1) (GCC)

[linux]$ make W=1 M=drivers/net/ethernet/intel/iavf
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_main.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_ethtool.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_virtchnl.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_fdir.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_adv_rss.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_txrx.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_common.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_adminq.o
   CC [M]  drivers/net/ethernet/intel/iavf/iavf_client.o
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c: In function 
‘iavf_virtchnl_completion’:
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1446:60: warning: ‘%s’ 
directive output may be truncated writing 4 bytes into a region of size 
between 1 and 11 [-Wformat-truncation=]
  1446 |                 snprintf(speed, IAVF_MAX_SPEED_STRLEN, "%d %s",
       |                                                            ^~
  1447 |                          link_speed_mbps, "Mbps");
       |                                           ~~~~~~
In function ‘iavf_print_link_message’,
     inlined from ‘iavf_virtchnl_completion’ at 
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1965:4:
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1446:17: note: 
‘snprintf’ output between 7 and 17 bytes into a destination of size 13
  1446 |                 snprintf(speed, IAVF_MAX_SPEED_STRLEN, "%d %s",
       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1447 |                          link_speed_mbps, "Mbps");
       |                          ~~~~~~~~~~~~~~~~~~~~~~~~



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ