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]
Date:   Tue, 15 Dec 2020 08:55:42 -0800
From:   Andy Lutomirski <luto@...nel.org>
To:     Randy Dunlap <rdunlap@...radead.org>
Cc:     Andy Lutomirski <luto@...nel.org>,
        "Enrico Weigelt, metux IT consult" <info@...ux.net>,
        LKML <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        X86 ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] arch: x86: entry: vdso: fix type conversion on printf() call

On Tue, Dec 15, 2020 at 8:42 AM Randy Dunlap <rdunlap@...radead.org> wrote:
>
> On 12/15/20 8:39 AM, Andy Lutomirski wrote:
> > On Tue, Dec 15, 2020 at 8:32 AM Randy Dunlap <rdunlap@...radead.org> wrote:
> >>
> >> On 12/15/20 8:03 AM, Enrico Weigelt, metux IT consult wrote:
> >>> Fixing the following compiler warning by explicit conversion to long:
> >>>
> >>> In file included from /home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:162:0:
> >>> /home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract64':
> >>> /home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
> >>>   fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);
> >>>                                                     ^
> >>>   CC      mm/filemap.o
> >>> In file included from /home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:166:0:
> >>> /home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract32':
> >>> /home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
> >>>   fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);
> >>>
> >>> Signed-off-by: Enrico Weigelt, metux IT consult <info@...ux.net>
> >>> ---
> >>>  arch/x86/entry/vdso/vdso2c.h | 3 ++-
> >>>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> Hi,
> >>
> >> size_t is normally printed with %zu.
> >> Is there some reason that isn't being used here?
> >
> > No.  Want to send a patch?
> >
>
> I was hoping that Enrico would fix this and maybe address your other comment,
> although I'm not so sure that I agree with it.

Using %zu would get rid of the line break entirely.  Enrico?

>
> --
> ~Randy
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ