summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/memory.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/memory.c b/kernel/memory.c
index fcd0f1f..9d44be5 100644
--- a/kernel/memory.c
+++ b/kernel/memory.c
@@ -453,7 +453,12 @@ static struct memory_space *get_memory_space(void *address)
int anonymous_page_handler(uint32_t code, void *address)
{
- (void)code;
+ if (code & PAGE_PR)
+ {
+ // there's no reason a protection violation should happen
+ // in anonymous space
+ panic(UNHANDLED_FAULT);
+ }
kputs("anonymous fault\n");
// kernel page mappings are built different
if (address >= (void *)&k_virt_base)