Select a random location when CONFIG_RANDOMIZE_BASE is used, bounded
by CONFIG_RANDOMIZE_BASE_MAX_OFFSET. Sources of randomness currently
include RDRAND, RDTSC, or the i8254.
This moves the pre-alternatives inline rdrand function into the header so
both pieces of code can use it. Availability of R
On Tue, Oct 1, 2013 at 1:46 PM, H. Peter Anvin wrote:
> On 10/01/2013 12:37 PM, Kees Cook wrote:
>> +
>> +#include
>> +static inline int rdrand(unsigned long *v)
>> +{
>> + int ok;
>> + asm volatile("1: " RDRAND_LONG "\n\t"
>> + "jc 2f\n\t"
>> + "decl %0\
On 10/01/2013 12:37 PM, Kees Cook wrote:
> +
> +#include
> +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:"
Select a random location when CONFIG_RANDOMIZE_BASE is used, bounded
by CONFIG_RANDOMIZE_BASE_MAX_OFFSET. Sources of randomness currently
include RDRAND, RDTSC, or the i8254.
Signed-off-by: Kees Cook
---
arch/x86/boot/compressed/aslr.c | 83 ++-
arch/x86/boo
4 matches
Mail list logo