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:	Fri, 1 Aug 2014 10:05:36 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Andy Lutomirski <luto@...capital.net>
Cc:	kan.liang@...el.com, andi@...stfloor.org,
	alexander.shishkin@...ux.intel.com, linux-kernel@...r.kernel.org,
	jakub@...hat.com
Subject: Re: [PATCH 1/3] x86 msr: msr goto extension support

On Thu, Jul 31, 2014 at 02:05:48PM -0700, Andy Lutomirski wrote:
> On 07/31/2014 02:41 AM, kan.liang@...el.com wrote:
> > +/*
> > + * The _goto version is rdmsrl/wrmsrl with exception handling
> > + * The advantage (than _safe) is that it can directly jump in the
> > + * exception handling code, and never test in the "fast" path.
> > + *
> > + * Since _goto doesn't support output, try to protect the output
> > + * registers by clobbers, and process the registers immediately.
> > + */
> > +#define rdmsrl_goto(msr, result, fail_label)			\
> > +do {								\
> > +	DECLARE_ARGS(val, low, high);				\
> > +	asm_volatile_goto("2: rdmsr\n"				\
> > +			"1:\n\t"				\
> > +			_ASM_EXTABLE(2b, %l[fail_label])	\
> > +			: /* No outputs. */			\
> > +			: "c" (msr)				\
> > +			: "%rax", "%rdx"			\
> > +			: fail_label);				\
> > +	asm volatile (""					\
> > +			: EAX_EDX_RET(val, low, high)		\
> > +			: );					\
> 
> This is scary -- the compiler is free to optimize this incorrectly, and
> it doesn't even seem very farfetched to me.

Quite so, lets add Jakub.

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ