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: <51ADC0F702000078000DAF5A@nat28.tlf.novell.com>
Date:	Tue, 04 Jun 2013 09:27:03 +0100
From:	"Jan Beulich" <JBeulich@...e.com>
To:	"Mukesh Rathor" <mukesh.rathor@...cle.com>
Cc:	"xen-devel" <xen-devel@...ts.xen.org>, <konrad.wilk@...cle.com>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH] PVH: vcpu info placement, load
 selectors, and remove debug printk.

>>> On 04.06.13 at 02:43, Mukesh Rathor <mukesh.rathor@...cle.com> wrote:
> @@ -1327,6 +1329,18 @@ static void __init xen_setup_stackprotector(void)
>  	/* PVH TBD/FIXME: investigate setup_stack_canary_segment */
>  	if (xen_feature(XENFEAT_auto_translated_physmap)) {
>  		switch_to_new_gdt(0);
> +
> +		/* xen started us with null selectors. load them now */
> +		__asm__ __volatile__ (
> +			"movl %0,%%ds\n"
> +			"movl %0,%%ss\n"
> +			"pushq %%rax\n"
> +			"leaq 1f(%%rip),%%rax\n"
> +			"pushq %%rax\n"
> +			"retfq\n"
> +			"1:\n"
> +			: : "r" (__KERNEL_DS), "a" (__KERNEL_CS) : "memory");
> +

I can see why you want CS to be reloaded (and CS, other than the
comment says, clearly hasn't been holding a null selector up to here.

I can't immediately see why you'd need SS to be other than null, and
it completely escapes me why you'd need to DS (but not ES) to be
non-null.

Furthermore, is there any reason why you use "retfq" (Intel syntax)
when all assembly code otherwise uses AT&T syntax (the proper
equivalent here would be "lretq")?

And finally, please consistently use %<number> (which, once
fixed, will make clear that the second constraint really can be "r"),
and avoid using suffixes on moves to/from selector registers
(which, once fixed, will make clear that at least the first constraint
really can be relaxed to "rm").

Jan

--
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