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:	Mon, 24 Jul 2006 19:36:29 +0200
From:	Andi Kleen <ak@....de>
To:	Rusty Russell <rusty@...tcorp.com.au>
Cc:	Chuck Ebbert <76306.1226@...puserve.com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...l.org>
Subject: Re: [PATCH 5/6] Begin abstraction of sensitive instructions: asm files

On Sat, Jul 22, 2006 at 11:34:48PM +1000, Rusty Russell wrote:
> On Fri, 2006-07-21 at 23:23 -0400, Chuck Ebbert wrote:
> > In-Reply-To:<1153527274.13699.36.camel@...alhost.localdomain>
> > 
> > On Sat, 22 Jul 2006 10:14:34 +1000, Rusty Russell wrote:
> > > +#define GET_CR0                      movl %cr0, %eax
> >  
> > Could you change GET_CR0 to MOV_CR0_EAX?  GET_CR0 seems like it's
> > taking a reference or something.
> 
> Hi Chuck,
> 
> 	Agreed: certainly eax should be mentioned.  GET_CR0_INTO_EAX?  MOV is a
> bit close to describing how it's happening (which, on paravirt it might
> not be) so it might lead the reader to unwarranted assumptions.
> 
> ===
> Abstract sensitive instructions in assembler code, replacing them with
> macros (which currently are #defined to the native versions).  We use
> long names: assembler is case-insensitive, so if something goes wrong
> and macros do not expand, it would assemble anyway.
> 
> Resulting object files are exactly the same as before.
> 
> Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
> Index: working-2.6.18-rc2-hg-paravirt/arch/i386/kernel/entry.S
> ===================================================================
> --- working-2.6.18-rc2-hg-paravirt.orig/arch/i386/kernel/entry.S	2006-07-21 21:09:22.000000000 +1000
> +++ working-2.6.18-rc2-hg-paravirt/arch/i386/kernel/entry.S	2006-07-22 04:32:25.000000000 +1000
> @@ -76,8 +76,15 @@
>  NT_MASK		= 0x00004000
>  VM_MASK		= 0x00020000
>  
> +/* These are replaces for paravirtualization */
> +#define DISABLE_INTERRUPTS		cli
> +#define ENABLE_INTERRUPTS		sti
> +#define ENABLE_INTERRUPTS_SYSEXIT	sti; sysexit
> +#define INTERRUPT_RETURN		iret
> +#define GET_CR0_INTO_EAX		movl %cr0, %eax

I would rather pass the register to the macro? If you start to
clobber registers you would need to pass in the tmp registers
too I guess.

-Andi

-
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