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: <524B34B9.4020504@zytor.com>
Date:	Tue, 01 Oct 2013 13:46:49 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Kees Cook <keescook@...omium.org>
CC:	linux-kernel@...r.kernel.org, x86@...nel.org,
	kernel-hardening@...ts.openwall.com, adurbin@...gle.com,
	Eric Northup <digitaleric@...gle.com>, jln@...gle.com,
	wad@...gle.com, Mathias Krause <minipli@...glemail.com>,
	Zhang Yanfei <zhangyanfei@...fujitsu.com>
Subject: Re: [PATCH 4/7] x86, kaslr: select random base offset

On 10/01/2013 12:37 PM, Kees Cook wrote:
> +
> +#include <asm/archrandom.h>
> +static inline int rdrand(unsigned long *v)
> +{
> +	int ok;
> +	asm volatile("1: " RDRAND_LONG "\n\t"
> +		     "jc 2f\n\t"
> +		     "decl %0\n\t"
> +		     "jnz 1b\n\t"
> +		     "2:"
> +		     : "=r" (ok), "=a" (*v)
> +		     : "0" (RDRAND_RETRY_LOOPS));
> +	return ok;
> +}
> +

This looks just like rdrand_long() in arch/x86/kernel/cpu/rdrand.c and
could move into the header file, no?

	-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