From 9a3c8a1c385726b2ab73abb3beaf7b5bb9a80337 Mon Sep 17 00:00:00 2001 From: EDiasAlberto Date: Tue, 3 Dec 2024 20:56:10 +0000 Subject: [PATCH] fix: grow stack upon page fault in kernel context to support syscall stack growth --- src/userprog/exception.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/userprog/exception.c b/src/userprog/exception.c index 7b8d3ee..6c707b1 100644 --- a/src/userprog/exception.c +++ b/src/userprog/exception.c @@ -177,7 +177,10 @@ page_fault (struct intr_frame *f) } } else - { + { + /* Allows for stack growth in kernel context, due to syscall failure */ + if (handle_stack_fault (fault_addr, thread_current ()->curr_esp)) return; + f->eip = (void *)f->eax; f->eax = 0xffffffff; return;