lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1456413395-7679-2-git-send-email-boris.ostrovsky@oracle.com>
Date:	Thu, 25 Feb 2016 10:16:34 -0500
From:	Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:	konrad.wilk@...cle.com, david.vrabel@...rix.com
Cc:	xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org,
	mcgrof@...nel.org, brgerst@...il.com, andrew.cooper3@...rix.com,
	Boris Ostrovsky <boris.ostrovsky@...cle.com>,
	stable@...r.kernel.org
Subject: [PATCH v3 1/2] xen/x86: Zero out .bss for PV guests

Baremetal kernels clear .bss early in the boot but Xen PV guests don't
execute that code. They have been able to run without problems because
Xen domain builder happens to give out zeroed pages. However, since this
is not really guaranteed, .bss should be explicitly cleared.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@...cle.com>
Cc: stable@...r.kernel.org
---
 arch/x86/xen/xen-head.S | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index b65f59a..11dbe49 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -38,6 +38,20 @@
 	__INIT
 ENTRY(startup_xen)
 	cld
+
+#ifdef CONFIG_X86_32
+#define WSIZE_SHIFT	2
+#else
+#define WSIZE_SHIFT	3
+#endif
+	/* Clear .bss */
+	xor %eax,%eax
+	mov $__bss_start, %__ASM_REG(di)
+	mov $__bss_stop, %__ASM_REG(cx)
+	sub %__ASM_REG(di), %__ASM_REG(cx)
+	shr $WSIZE_SHIFT, %__ASM_REG(cx)
+	rep __ASM_SIZE(stos)
+
 #ifdef CONFIG_X86_32
 	mov %esi,xen_start_info
 	mov $init_thread_union+THREAD_SIZE,%esp
-- 
2.1.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ