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: <477931C8.4060208@zytor.com>
Date:	Mon, 31 Dec 2007 10:15:36 -0800
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Mike Frysinger <vapier@...too.org>
CC:	Andi Kleen <andi@...stfloor.org>, tglx@...utronix.de,
	mingo@...hat.com, LKML <linux-kernel@...r.kernel.org>
Subject: Re: asm-x86/msr.h for sanitized headers: clean it or punt it

Mike Frysinger wrote:
>> ---
> Use __asm__ and __volatile__ in code that is exported to userspace.  Wrap
> kernel functions with __KERNEL__ so they get scrubbed.
> 
> Signed-off-by: Mike Frysinger <vapier@...too.org>
> ---
> diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h
> index ba4b314..ffb9319 100644
> --- a/include/asm-x86/msr.h
> +++ b/include/asm-x86/msr.h
> @@ -193,7 +193,7 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
>  
>  /* wrmsr with exception handling */
>  #define wrmsr_safe(msr,a,b) ({ int ret__;			\
> -	asm volatile("2: wrmsr ; xorl %0,%0\n"			\
> +	__asm__ __volatile__("2: wrmsr ; xorl %0,%0\n"			\
>  		     "1:\n\t"					\
>  		     ".section .fixup,\"ax\"\n\t"		\
>  		     "3:  movl %4,%0 ; jmp 1b\n\t"		\

rdmsr_safe/wrmsr_safe are definitely kernel-only.

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