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: <1480007330.19726.11.camel@perches.com>
Date:   Thu, 24 Nov 2016 09:08:50 -0800
From:   Joe Perches <joe@...ches.com>
To:     Arnd Bergmann <arnd@...db.de>,
        Andrew Morton <akpm@...ux-foundation.org>
Cc:     Vitaly Wool <vitalywool@...il.com>,
        Dan Streetman <ddstreet@...e.org>,
        zhong jiang <zhongjiang@...wei.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] z3fold: use %z modifier for format string

On Thu, 2016-11-24 at 17:31 +0100, Arnd Bergmann wrote:
> Printing a size_t requires the %zd format rather than %d:
> 
> mm/z3fold.c: In function ‘init_z3fold’:
> include/linux/kern_levels.h:4:18: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=]
> 
> Fixes: 50a50d2676c4 ("z3fold: don't fail kernel build if z3fold_header is too big")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  mm/z3fold.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/z3fold.c b/mm/z3fold.c
> index e282ba073e77..66ac7a7dc934 100644
> --- a/mm/z3fold.c
> +++ b/mm/z3fold.c
> @@ -884,7 +884,7 @@ static int __init init_z3fold(void)
>  {
>  	/* Fail the initialization if z3fold header won't fit in one chunk */
>  	if (sizeof(struct z3fold_header) > ZHDR_SIZE_ALIGNED) {
> -		pr_err("z3fold: z3fold_header size (%d) is bigger than "
> +		pr_err("z3fold: z3fold_header size (%zd) is bigger than "
>  			"the chunk size (%d), can't proceed\n",
>  			sizeof(struct z3fold_header) , ZHDR_SIZE_ALIGNED);
>  		return -E2BIG;

The embedded "z3fold: " prefix here should be removed
as there's a pr_fmt that also adds it.

The test looks like it should be a BUILD_BUG_ON rather
than any runtime test too.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ