Patch "asm-prototypes: Clear any CPP defines before declaring the functions" has been added to the 4.9-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
asm-prototypes: Clear any CPP defines before declaring the functions
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
asm-prototypes-clear-any-cpp-defines-before-declaring-the-functions.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
c7858bf16c0b2cc62f475f31e6df28c3a68da1d6Mon Sep 17 00:00:00 2001
From: Michal Marek <[email protected]>
Date: Tue, 3 Jan 2017 13:49:42 +0100
Subject: asm-prototypes: Clear any CPP defines before declaring the functions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Michal Marek <[email protected]>
commit c7858bf16c0b2cc62f475f31e6df28c3a68da1d6 upstream.
The asm-prototypes.h file is used to provide dummy function declarations for genksyms, when processing asm files with EXPORT_SYMBOL. Make sure that any architecture defines get out of our way. x86 currently has an issue with memcpy on 64bit with CONFIG_KMEMCHECK=y and with memset/__memset on 32bit:
$ cat init/test.c #include <asm/asm-prototypes.h> $ make -s init/test.o In file included from ./arch/x86/include/asm/string.h:4:0, from ./include/linux/string.h:18, from ./include/linux/bitmap.h:8, from ./include/linux/cpumask.h:11, from ./arch/x86/include/asm/cpumask.h:4, from ./arch/x86/include/asm/msr.h:10, from ./arch/x86/include/asm/processor.h:20, from ./arch/x86/include/asm/cpufeature.h:4, from ./arch/x86/include/asm/thread_info.h:52, from ./include/linux/thread_info.h:25, from ./arch/x86/include/asm/preempt.h:6, from ./include/linux/preempt.h:59, from ./include/linux/spinlock.h:50, from ./include/linux/seqlock.h:35, from ./include/linux/time.h:5, from ./include/uapi/linux/timex.h:56, from ./include/linux/timex.h:56, from ./include/linux/sched.h:19, from ./include/linux/uaccess.h:4, from ./arch/x86/include/asm/asm-prototypes.h:2, from init/test.c:1: ./arch/x86/include/asm/string_64.h:52:47: error: expected declaration specifiers or ‘...’ before ‘(’ token #define memcpy(dst, src, len) __inline_memcpy((dst), (src), (len)) ./include/asm-generic/asm-prototypes.h:6:14: note: in expansion of macro ‘memcpy’ extern void *memcpy(void *, const void *, __kernel_size_t);
^ ...
During real build, this manifests itself by genksyms segfaulting.
--- include/asm-generic/asm-prototypes.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/asm-generic/asm-prototypes.h +6 -0
@@ -1,7 +1,13 @@#include <linux/bitops.h> +#undef __memsetextern void *__memset (void *,int ,__kernel_size_t ); +#undef __memcpyextern void *__memcpy (void *,const void *,__kernel_size_t ); +#undef __memmoveextern void *__memmove (void *,const void *,__kernel_size_t ); +#undef memsetextern void *memset (void *,int ,__kernel_size_t ); +#undef memcpyextern void *memcpy (void *,const void *,__kernel_size_t ); +#undef memmoveextern void *memmove (void *,const void *,__kernel_size_t );
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/asm-prototypes-clear-any-cpp-defines-before-declaring-the-functions.patch