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]
Message-ID: <tip-fba407e1710ae4c558e1e2b55b5a55b2c07a596d@git.kernel.org>
Date:   Fri, 23 Feb 2018 00:27:26 -0800
From:   tip-bot for Arnd Bergmann <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     tglx@...utronix.de, msebor@...il.com, arnd@...db.de,
        mingo@...nel.org, kirill.shutemov@...ux.intel.com, hpa@...or.com,
        linux-kernel@...r.kernel.org, peterz@...radead.org,
        torvalds@...ux-foundation.org
Subject: [tip:x86/mm] x86/boot/compressed/64: Fix warning for 32-bit
 trampoline memcpy()

Commit-ID:  fba407e1710ae4c558e1e2b55b5a55b2c07a596d
Gitweb:     https://git.kernel.org/tip/fba407e1710ae4c558e1e2b55b5a55b2c07a596d
Author:     Arnd Bergmann <arnd@...db.de>
AuthorDate: Thu, 22 Feb 2018 12:28:05 +0100
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Fri, 23 Feb 2018 08:29:54 +0100

x86/boot/compressed/64: Fix warning for 32-bit trampoline memcpy()

GCC-8 warns that we copy TRAMPOLINE_32BIT_CODE_SIZE bytes from the pointer
to the function into actual trampoline, when that pointer is only 8 bytes:

  In file included from arch/x86/boot/compressed/pgtable_64.c:3:
  arch/x86/boot/compressed/pgtable_64.c: In function 'paging_prepare':
  arch/x86/boot/compressed/../string.h:18:23: error: '__builtin_memcpy' reading 96 bytes from a region of size 8 [-Werror=stringop-overflow=]
   #define memcpy(d,s,l) __builtin_memcpy(d,s,l)
                       ^~~~~~~~~~~~~~~~~~~~~~~
  arch/x86/boot/compressed/pgtable_64.c:62:2: note: in expansion of macro 'memcpy'
    memcpy(trampoline + TRAMPOLINE_32BIT_CODE_OFFSET / sizeof(unsigned long),
    ^~~~~~

It turns out that the declaration is incorrect here: trampoline_32bit_src
is defined as a function in arch/x86/boot/compressed/head_64.S, not a
pointer to a function. Fixing the prototype to match addresses the warning.

Suggested-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
Signed-off-by: Arnd Bergmann <arnd@...db.de>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Martin Sebor <msebor@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Fixes: b91993a87aff ("x86/boot/compressed/64: Prepare trampoline memory")
Link: http://lkml.kernel.org/r/20180222112817.456380-1-arnd@arndb.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/boot/compressed/pgtable.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/pgtable.h b/arch/x86/boot/compressed/pgtable.h
index 6e0db2260147..5e0b1c4abef4 100644
--- a/arch/x86/boot/compressed/pgtable.h
+++ b/arch/x86/boot/compressed/pgtable.h
@@ -12,7 +12,7 @@
 
 #ifndef __ASSEMBLER__
 
-extern void (*trampoline_32bit_src)(void *return_ptr);
+extern void trampoline_32bit_src(void *return_ptr);
 
 #endif /* __ASSEMBLER__ */
 #endif /* BOOT_COMPRESSED_PAGETABLE_H */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ