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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 29 Dec 2020 22:49:31 -0800
From:   Joe Perches <joe@...ches.com>
To:     YANG LI <abaci-bugfix@...ux.alibaba.com>, davem@...emloft.net
Cc:     kuba@...nel.org, dchickles@...vell.com, sburla@...vell.com,
        fmanlunas@...vell.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] liquidio: fix: warning: %u in format string (no. 3)
 requires 'unsigned int' but the argument type is 'signed int'.

On Wed, 2020-12-30 at 14:41 +0800, YANG LI wrote:
> For safety, modify '%u' to '%d' to keep the type consistent.

There is no additional safety here.

The for loop ensures that i is positive as num_ioq_vector is also
int and so i can not be negative as it's incremented from 0.

> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c
[]
> @@ -1109,12 +1109,12 @@ int octeon_setup_interrupt(struct octeon_device *oct, u32 num_ioqs)
>  		for (i = 0 ; i < num_ioq_vectors ; i++) {
>  			if (OCTEON_CN23XX_PF(oct))
>  				snprintf(&queue_irq_names[IRQ_NAME_OFF(i)],
> -					 INTRNAMSIZ, "LiquidIO%u-pf%u-rxtx-%u",
> +					 INTRNAMSIZ, "LiquidIO%u-pf%u-rxtx-%d",
>  					 oct->octeon_id, oct->pf_num, i);
>  
> 
>  			if (OCTEON_CN23XX_VF(oct))
>  				snprintf(&queue_irq_names[IRQ_NAME_OFF(i)],
> -					 INTRNAMSIZ, "LiquidIO%u-vf%u-rxtx-%u",
> +					 INTRNAMSIZ, "LiquidIO%u-vf%u-rxtx-%d",
>  					 oct->octeon_id, oct->vf_num, i);
>  
> 
>  			irqret = request_irq(msix_entries[i].vector,


Powered by blists - more mailing lists