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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-e68266b7001a4e29af083716f0c36c0d6dbb1b39@git.kernel.org>
Date:	Wed, 13 Jan 2010 16:39:51 GMT
From:	tip-bot for Ian Campbell <ian.campbell@...rix.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	brgerst@...il.com, ian.campbell@...rix.com, gorcunov@...il.com,
	lists@...dbynature.de, Jeremy.Fitzhardinge@...rix.com,
	tglx@...utronix.de, mingo@...e.hu
Subject: [tip:x86/urgent] x86: xen: 64-bit kernel RPL should be 0

Commit-ID:  e68266b7001a4e29af083716f0c36c0d6dbb1b39
Gitweb:     http://git.kernel.org/tip/e68266b7001a4e29af083716f0c36c0d6dbb1b39
Author:     Ian Campbell <ian.campbell@...rix.com>
AuthorDate: Wed, 13 Jan 2010 10:16:08 +0000
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Wed, 13 Jan 2010 11:23:54 +0100

x86: xen: 64-bit kernel RPL should be 0

Under Xen 64 bit guests actually run their kernel in ring 3,
however the hypervisor takes care of squashing descriptor the
RPLs transparently (in order to allow them to continue to
differentiate between user and kernel space CS using the RPL).
Therefore the Xen paravirt backend should use RPL==0 instead of
1 (or 3). Using RPL==1 causes generic arch code to take
incorrect code paths because it uses "testl $3, <CS>, je foo"
type tests for a userspace CS and this considers 1==userspace.

This issue was previously masked because get_kernel_rpl() was
omitted when setting CS in kernel_thread(). This was fixed when
kernel_thread() was unified with 32 bit in
f443ff4201dd25cd4dec183f9919ecba90c8edc2.

Signed-off-by: Ian Campbell <ian.campbell@...rix.com>
Cc: Christian Kujau <lists@...dbynature.de>
Cc: Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...rix.com>
Cc: Cyrill Gorcunov <gorcunov@...il.com>
Cc: Brian Gerst <brgerst@...il.com>
LKML-Reference: <1263377768-19600-2-git-send-email-ian.campbell@...rix.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 arch/x86/xen/enlighten.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 2b26dd5..36daccb 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1151,9 +1151,13 @@ asmlinkage void __init xen_start_kernel(void)
 
 	/* keep using Xen gdt for now; no urgent need to change it */
 
+#ifdef CONFIG_X86_32
 	pv_info.kernel_rpl = 1;
 	if (xen_feature(XENFEAT_supervisor_mode_kernel))
 		pv_info.kernel_rpl = 0;
+#else
+	pv_info.kernel_rpl = 0;
+#endif
 
 	/* set the limit of our address space */
 	xen_reserve_top();
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ