[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200124181819.4840-2-hjl.tools@gmail.com>
Date: Fri, 24 Jan 2020 10:18:18 -0800
From: "H.J. Lu" <hjl.tools@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Andy Lutomirski <luto@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Kees Cook <keescook@...omium.org>,
Thomas Lendacky <Thomas.Lendacky@....com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H . Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Yu-cheng Yu <yu-cheng.yu@...el.com>
Subject: [PATCH 1/2] x86: Discard .note.gnu.property sections in vDSO
With the command-line option, -mx86-used-note=yes, the x86 assembler
in binutils 2.32 and above generates a program property note in a note
section, .note.gnu.property, to encode used x86 ISAs and features. X86
kernel vDSO linker script only contains a signle NOTE segment:
PHDRS
{
text PT_LOAD FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
note PT_NOTE FLAGS(4); /* PF_R */
eh_frame_hdr 0x6474e550;
}
which may not be incompatible with note.gnu.property sections. Since
note.gnu.property section in vDSO is not used by dynamic linker, this
patch discards .note.gnu.property sections in vDSO by adding
/DISCARD/ : {
*(.note.gnu.property)
}
before .notes sections.
Signed-off-by: H.J. Lu <hjl.tools@...il.com>
Signed-off-by: Yu-cheng Yu <yu-cheng.yu@...el.com>
---
arch/x86/entry/vdso/vdso-layout.lds.S | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/entry/vdso/vdso-layout.lds.S b/arch/x86/entry/vdso/vdso-layout.lds.S
index 93c6dc7812d0..b604da6cc024 100644
--- a/arch/x86/entry/vdso/vdso-layout.lds.S
+++ b/arch/x86/entry/vdso/vdso-layout.lds.S
@@ -52,6 +52,10 @@ SECTIONS
*(.gnu.linkonce.b.*)
} :text
+ /* .note.gnu.property sections should be discarded */
+ /DISCARD/ : {
+ *(.note.gnu.property)
+ }
.note : { *(.note.*) } :text :note
.eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
--
2.24.1
Powered by blists - more mailing lists