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] [day] [month] [year] [list]
Date:	Mon, 1 Jun 2015 09:29:16 +0100
From:	Ian Campbell <ian.campbell@...rix.com>
To:	David Miller <davem@...emloft.net>
CC:	<xen-devel@...ts.xen.org>, <netdev@...r.kernel.org>,
	<wei.liu2@...rix.com>
Subject: Re: [PATCH] xen: netback: fix error printf format string.

On Sun, 2015-05-31 at 21:26 -0700, David Miller wrote:
> From: Ian Campbell <ian.campbell@...rix.com>
> Date: Fri, 29 May 2015 17:22:04 +0100
> 
> > drivers/net/xen-netback/netback.c: In function ‘xenvif_tx_build_gops’:
> > drivers/net/xen-netback/netback.c:1253:8: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘int’ [-Wformat=]
> >         (txreq.offset&~PAGE_MASK) + txreq.size);
> >         ^
> > 
> > txreq.offset and .size are uint16_t fields.
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@...rix.com>
> 
> This may get rid of the compiler warning on your machine, but it creates
> one on mine:
> 
> drivers/net/xen-netback/netback.c: In function ‘xenvif_tx_build_gops’:
> drivers/net/xen-netback/netback.c:1253:8: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ [-Wformat=]
>         (txreq.offset&~PAGE_MASK) + txreq.size);
>         ^
> 
> There is a type involved in this calculation which is arch
> dependent, so you'll need to add a cast or something to
> make this warning go away in all cases.

Ah, I only considered the types txreq.{offset,size} and missed thinking
about PAGE_MASK.

I'll resend with a cast.

Ian.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ