From: Greg Kroah-Hartman Date: Thu, 11 Jun 2020 11:22:39 +0000 (+0200) Subject: 5.7-stable patches X-Git-Tag: v5.4.47~133 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dc8b65e20a9dac9b74fa7e57f80f682a73f9de2d;p=thirdparty%2Fkernel%2Fstable-queue.git 5.7-stable patches added patches: elfnote-mark-all-.note-sections-shf_alloc.patch --- diff --git a/queue-5.7/elfnote-mark-all-.note-sections-shf_alloc.patch b/queue-5.7/elfnote-mark-all-.note-sections-shf_alloc.patch new file mode 100644 index 00000000000..9ef04b4071f --- /dev/null +++ b/queue-5.7/elfnote-mark-all-.note-sections-shf_alloc.patch @@ -0,0 +1,58 @@ +From 51da9dfb7f20911ae4e79e9b412a9c2d4c373d4b Mon Sep 17 00:00:00 2001 +From: Nick Desaulniers +Date: Thu, 4 Jun 2020 16:50:49 -0700 +Subject: elfnote: mark all .note sections SHF_ALLOC + +From: Nick Desaulniers + +commit 51da9dfb7f20911ae4e79e9b412a9c2d4c373d4b upstream. + +ELFNOTE_START allows callers to specify flags for .pushsection assembler +directives. All callsites but ELF_NOTE use "a" for SHF_ALLOC. For vdso's +that explicitly use ELF_NOTE_START and BUILD_SALT, the same section is +specified twice after preprocessing, once with "a" flag, once without. +Example: + +.pushsection .note.Linux, "a", @note ; +.pushsection .note.Linux, "", @note ; + +While GNU as allows this ordering, it warns for the opposite ordering, +making these directives position dependent. We'd prefer not to precisely +match this behavior in Clang's integrated assembler. Instead, the non +__ASSEMBLY__ definition of ELF_NOTE uses +__attribute__((section(".note.Linux"))) which is created with SHF_ALLOC, +so let's make the __ASSEMBLY__ definition of ELF_NOTE consistent with C +and just always use "a" flag. + +This allows Clang to assemble a working mainline (5.6) kernel via: +$ make CC=clang AS=clang + +Signed-off-by: Nick Desaulniers +Signed-off-by: Andrew Morton +Reviewed-by: Nathan Chancellor +Reviewed-by: Fangrui Song +Cc: Jeremy Fitzhardinge +Cc: Thomas Gleixner +Cc: Vincenzo Frascino +Link: https://github.com/ClangBuiltLinux/linux/issues/913 +Link: http://lkml.kernel.org/r/20200325231250.99205-1-ndesaulniers@google.com +Debugged-by: Ilie Halip +Signed-off-by: Linus Torvalds +Cc: Jian Cai +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/elfnote.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/elfnote.h ++++ b/include/linux/elfnote.h +@@ -54,7 +54,7 @@ + .popsection ; + + #define ELFNOTE(name, type, desc) \ +- ELFNOTE_START(name, type, "") \ ++ ELFNOTE_START(name, type, "a") \ + desc ; \ + ELFNOTE_END + diff --git a/queue-5.7/series b/queue-5.7/series index bcbdd4aade6..413df6fbe91 100644 --- a/queue-5.7/series +++ b/queue-5.7/series @@ -10,3 +10,4 @@ mptcp-bugfix-for-rm_addr-option-parsing.patch genetlink-fix-memory-leaks-in-genl_family_rcv_msg_dumpit.patch net-dsa-qca8k-fix-unexpected-gfp-kernel-exception.patch tipc-fix-null-pointer-dereference-in-streaming.patch +elfnote-mark-all-.note-sections-shf_alloc.patch