[PATCH] x86: Zero-pad the VVAR page with zeros

From: Andy Lutomirski
Date: Fri Jan 31 2014 - 18:04:29 EST


This has probably been broken since the VVAR page was introduced.
The symptom is that BIOS crud can be left behind where userspace can
see it. (I saw this with QEMU.)

Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
---
arch/x86/kernel/vmlinux.lds.S | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index da6b35a..331a66f 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -165,6 +165,11 @@ SECTIONS
#undef __VVAR_KERNEL_LDS
#undef EMIT_VVAR

+ /*
+ * Pad the rest of the page with zeros. Otherwise the loader
+ * can leave garbage here.
+ */
+ . = __vvar_beginning_hack + PAGE_SIZE;
} :data

. = ALIGN(__vvar_page + PAGE_SIZE, PAGE_SIZE);
--
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/