[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <8b8deba846a0b163cd92a693092623f277acb89a.1306851090.git.luto@mit.edu>
Date: Tue, 31 May 2011 10:14:05 -0400
From: Andy Lutomirski <luto@....EDU>
To: Ingo Molnar <mingo@...e.hu>, x86@...nel.org
Cc: Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
Jesper Juhl <jj@...osbits.net>, Borislav Petkov <bp@...en8.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Arjan van de Ven <arjan@...radead.org>,
Jan Beulich <JBeulich@...ell.com>,
richard -rw- weinberger <richard.weinberger@...il.com>,
Mikael Pettersson <mikpe@...uu.se>,
Andi Kleen <andi@...stfloor.org>,
Andy Lutomirski <luto@....edu>
Subject: [PATCH v4 07/10] x86-64: Fill unused parts of the vsyscall page with 0xcc
Jumping to 0x00 might do something depending on the following bytes.
Jumping to 0xcc is a trap. So fill the unused parts of the vsyscall
page with 0xcc to make it useless for exploits to jump there.
Signed-off-by: Andy Lutomirski <luto@....edu>
---
arch/x86/kernel/vmlinux.lds.S | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index dc8ac70..c3b37d6 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -166,22 +166,20 @@ SECTIONS
__vsyscall_0 = .;
. = VSYSCALL_ADDR;
- .vsyscall_0 : AT(VLOAD(.vsyscall_0)) {
+ .vsyscall : AT(VLOAD(.vsyscall)) {
*(.vsyscall_0)
- } :user
- . = ALIGN(L1_CACHE_BYTES);
- .vsyscall_fn : AT(VLOAD(.vsyscall_fn)) {
+ . = ALIGN(L1_CACHE_BYTES);
*(.vsyscall_fn)
- }
- .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT(VLOAD(.vsyscall_1)) {
+ . = 1024;
*(.vsyscall_1)
- }
- .vsyscall_2 ADDR(.vsyscall_0) + 2048: AT(VLOAD(.vsyscall_2)) {
+
+ . = 2048;
*(.vsyscall_2)
- }
+ . = 4096; /* Pad the whole page. */
+ } :user =0xcc
. = ALIGN(__vsyscall_0 + PAGE_SIZE, PAGE_SIZE);
#undef VSYSCALL_ADDR
--
1.7.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists