summaryrefslogtreecommitdiff
path: root/kernel/arch/i386
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-11-13 16:05:31 +0100
committerAnton Kling <anton@kling.gg>2023-11-13 16:05:31 +0100
commit761f57a1b167abeda40c5cc0fce801a4230f2400 (patch)
tree4ed5bc3c542ca0155f5a21d2d1dae0679db209a4 /kernel/arch/i386
parente7b5cb7ca649455b926d6e8494c8dd7d6aed9ad0 (diff)
Crypto: Implement fast insecure RNG for overwritting memory areas.
This is mainly done to test for uninitlalized memory and find bugs faster. Therefore it does not need to be cryptographically secure or perfectly uniform. Xoshiro256++ seems like a good fit.
Diffstat (limited to 'kernel/arch/i386')
-rw-r--r--kernel/arch/i386/mmu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/arch/i386/mmu.c b/kernel/arch/i386/mmu.c
index 2b6c0b5..4ac17da 100644
--- a/kernel/arch/i386/mmu.c
+++ b/kernel/arch/i386/mmu.c
@@ -36,7 +36,7 @@ void *ksbrk(size_t s) {
// If there is no active pagedirectory we
// just assume that the memory is
// already mapped.
- get_random((void *)rc, data_end - rc);
+ get_fast_insecure_random((void *)rc, data_end - rc);
return (void *)rc;
}
// Determine whether we are approaching a unallocated table
@@ -59,7 +59,7 @@ void *ksbrk(size_t s) {
assert(((uintptr_t)rc % PAGE_SIZE) == 0);
memset((void *)rc, 0x00, s);
- get_random((void *)rc, data_end - rc);
+ get_fast_insecure_random((void *)rc, data_end - rc);
return (void *)rc;
}