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] [day] [month] [year] [list]
Date:	Wed, 2 Jan 2008 03:20:26 +0200
From:	Adrian Bunk <bunk@...nel.org>
To:	Mike Frysinger <vapier@...too.org>
Cc:	"H. Peter Anvin" <hpa@...or.com>, 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

On Mon, Dec 31, 2007 at 01:49:27PM -0500, 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..664a2fa 100644
> --- a/include/asm-x86/msr.h
> +++ b/include/asm-x86/msr.h
>...
>  #define rdtscp(low,high,aux) \
> -     asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux))
> +     __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux))
>  
>  #define rdtscll(val) do { \
>       unsigned int __a,__d; \
> -     asm volatile("rdtsc" : "=a" (__a), "=d" (__d)); \
> +     __asm__ __volatile__("rdtsc" : "=a" (__a), "=d" (__d)); \
>       (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \
>  } while(0)
>  
>  #define rdtscpll(val, aux) do { \
>       unsigned long __a, __d; \
> -     asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); \
> +     __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); \
>       (val) = (__d << 32) | __a; \
>  } while (0)
>...

How is this part of the kernel<->userspace interface?

Unless I miss anything this sounds more like userspace abusing kernel 
headers as a utility library?

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

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