From 394ee169ea6eb4dd5c8fa778d1c2769e26e52f01 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 3 Apr 2021 14:04:23 +0200 Subject: Enabled SMAP/SMEP protections --- libs/libc/random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/libc/random.c') diff --git a/libs/libc/random.c b/libs/libc/random.c index 6e65959..6296407 100644 --- a/libs/libc/random.c +++ b/libs/libc/random.c @@ -18,7 +18,7 @@ void srand(u32 seed) u32 rdrand(void) { #ifdef KERNEL - if (!cpu_has_cfeature(CPUID_FEAT_ECX_RDRND)) + if (!(cpu_features.ecx & CPUID_FEAT_ECX_RDRND)) return rand(); u32 rd; @@ -35,7 +35,7 @@ u32 rdrand(void) u32 rdseed(void) { #ifdef KERNEL - if (!cpu_has_cfeature(CPUID_FEAT_ECX_RDRND)) + if (!(cpu_extended_features.ebx & CPUID_EXT_FEAT_EBX_RDSEED)) return rand(); u32 rd; -- cgit v1.2.3