mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
avoid race by removing memset
This commit is contained in:
parent
22be514ed1
commit
c84d638aa9
1 changed files with 2 additions and 1 deletions
|
@ -324,6 +324,7 @@ void page_fault_handler(struct state *s)
|
|||
// on demand userspace heap mapping
|
||||
viraddr &= PAGE_MASK;
|
||||
|
||||
// TODO: a function to get zeroed pages is missing
|
||||
size_t phyaddr = get_page();
|
||||
if (BUILTIN_EXPECT(!phyaddr, 0)) {
|
||||
kprintf("out of memory: task = %u\n", task->id);
|
||||
|
@ -338,7 +339,7 @@ void page_fault_handler(struct state *s)
|
|||
goto default_handler;
|
||||
}
|
||||
|
||||
memset((void*) viraddr, 0x00, PAGE_SIZE); // fill with zeros
|
||||
// TODO: reusing of old data is possible => security issue
|
||||
|
||||
spinlock_irqsave_unlock(task->page_lock);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue