From faa61f70fa1b8107aa8cf61cbd24ae28e00c929a Mon Sep 17 00:00:00 2001 From: vasilito Date: Fri, 10 Jul 2026 01:07:21 +0300 Subject: [PATCH] kernel: replace todo!(oom) with proper ENOMEM-based signal path --- src/memory/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/memory/mod.rs b/src/memory/mod.rs index 4516247ad3..b0aa906e1b 100644 --- a/src/memory/mod.rs +++ b/src/memory/mod.rs @@ -1028,11 +1028,12 @@ pub fn page_fault_handler( match context::memory::try_correcting_page_tables(faulting_page, mode, &mut token) { Ok(()) => return Ok(()), Err(PfError::Oom) => { - log::warn!("page fault recovery failed: out of memory at {:#x}", faulting_page.start_address().data()); - // OOM during page table correction is non-fatal: the process - // receives SIGSEGV but the kernel continues. The faulting - // allocation will be retried or the process killed by the OOM - // killer when it's implemented. + log::error!( + "OOM during page fault for PID {} at {:#x}", + context::current().pid, + faulting_page.start_address().data() + ); + return Err(Segv); } Err(PfError::Segv | PfError::RecursionLimitExceeded | PfError::NonfatalInternalError) => (), }