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]
Date:	Wed, 19 Jul 2006 06:00:50 +1000
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Chris Wright <chrisw@...s-sol.org>
Cc:	Andrew Morton <akpm@...l.org>, Zachary Amsden <zach@...are.com>,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	xen-devel@...ts.xensource.com, Ian Pratt <ian.pratt@...source.com>,
	linux-kernel@...r.kernel.org, Andi Kleen <ak@...e.de>,
	virtualization@...ts.osdl.org,
	Christian Limpach <Christian.Limpach@...cam.ac.uk>
Subject: Re: [Xen-devel] Re: [RFC PATCH 15/33] move segment checks to
	subarch

On Tue, 2006-07-18 at 12:25 -0700, Chris Wright wrote:
> * Rusty Russell (rusty@...tcorp.com.au) wrote:
> > On Tue, 2006-07-18 at 00:00 -0700, Chris Wright wrote:
> > > plain text document attachment (i386-segments)
> > > We allow for the fact that the guest kernel may not run in ring 0.
> > > This requires some abstraction in a few places when setting %cs or
> > > checking privilege level (user vs kernel).
> > 
> > Zach had an alternate patch for this, which didn't assume the kernel ran
> > in a compile-time known ring, but is otherwise very similar.  I've put
> > it below for discussion (but Zach now tells me the asm parts are not
> > required: Zach, can you mod this patch and comment?).
> 
> This patch also doesn't have a compile time known ring, it's using
> get_kernel_cs() because the Xen method for booting native is dynamic and
> would resolve to ring 0 in that case (XENFEAT_supervisor_mode_kernel).

I was referring to the different ways the two patches figure out whether
we're in user mode:

Yours:
 static inline int user_mode(struct pt_regs *regs)
 {
       return (regs->xcs & USER_MODE_MASK) != 0;
 }

Where you have for native:
	#define USER_MODE_MASK 3
vs Xen:
	#define USER_MODE_MASK 2

Zach's patch does this:

 static inline int user_mode(struct pt_regs *regs)
 {
	return (regs->xcs & SEGMENT_RPL_MASK) == 3;
 }

I'm no x86pert, but the latter seems more generic to me (user mode is
ring 3, vs. usermode is anything >= 2).  Perhaps they are in fact
equivalent?

Thanks!
Rusty.
-- 
Help! Save Australia from the worst of the DMCA: http://linux.org.au/law

-
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