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-next>] [day] [month] [year] [list]
Message-Id: <20210209012305.31062-1-rdunlap@infradead.org>
Date:   Mon,  8 Feb 2021 17:23:05 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     linux-kernel@...r.kernel.org
Cc:     Randy Dunlap <rdunlap@...radead.org>,
        Sean Christopherson <seanjc@...gle.com>,
        Jarkko Sakkinen <jarkko@...nel.org>,
        Borislav Petkov <bp@...e.de>, x86@...nel.org
Subject: [PATCH] x86: vdso: fix printf() format warnings in vdso2c.h

Use %zu instead of %lu for size_t to prevent w printf()
format warnings in vdso2c.h

  HOSTCC  arch/x86/entry/vdso/vdso2c
In file included from ../arch/x86/entry/vdso/vdso2c.c:162:
../arch/x86/entry/vdso/vdso2c.h: In function 'extract64':
../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=]
   38 |  fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);
      |                                                  ~~^              ~~~
In file included from ../arch/x86/entry/vdso/vdso2c.c:166:
../arch/x86/entry/vdso/vdso2c.h: In function 'extract32':
../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=]
   38 |  fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);
      |                                                  ~~^              ~~~

Fixes: 8382c668ce4f ("x86/vdso: Add support for exception fixup in vDSO functions")
Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
Cc: Sean Christopherson <seanjc@...gle.com>
Cc: Jarkko Sakkinen <jarkko@...nel.org>
Cc: Borislav Petkov <bp@...e.de>
Cc: x86@...nel.org
---
 arch/x86/entry/vdso/vdso2c.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- lnx-511-rc7.orig/arch/x86/entry/vdso/vdso2c.h
+++ lnx-511-rc7/arch/x86/entry/vdso/vdso2c.h
@@ -35,7 +35,7 @@ static void BITSFUNC(extract)(const unsi
 	if (offset + len > data_len)
 		fail("section to extract overruns input data");
 
-	fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);
+	fprintf(outfile, "static const unsigned char %s[%zu] = {", name, len);
 	BITSFUNC(copy)(outfile, data + offset, len);
 	fprintf(outfile, "\n};\n\n");
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ