aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/random.c
diff options
context:
space:
mode:
authorMarvin Borner2021-04-03 14:04:23 +0200
committerMarvin Borner2021-04-03 14:04:23 +0200
commit394ee169ea6eb4dd5c8fa778d1c2769e26e52f01 (patch)
tree70440fb0d9eeb09e1aeec7eba6f2319d34b4918c /libs/libc/random.c
parentce98400f8a9ebd4e62e76b9e292b7598d0d66cc0 (diff)
Enabled SMAP/SMEP protections
Diffstat (limited to 'libs/libc/random.c')
-rw-r--r--libs/libc/random.c4
1 files changed, 2 insertions, 2 deletions
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;