From 9e6fa0a1ba2b6dcfd13a7c552720ae1e5df91d8d Mon Sep 17 00:00:00 2001 From: Bananymous Date: Sun, 17 May 2026 00:12:05 +0300 Subject: [PATCH] Kernel: Add fast path for invalid address during region pin Before I was falling through to the write lock which does allocation, but as the read loop already saw, specified address was not mapped. --- kernel/kernel/Process.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/kernel/Process.cpp b/kernel/kernel/Process.cpp index cf1e03c6..f1533741 100644 --- a/kernel/kernel/Process.cpp +++ b/kernel/kernel/Process.cpp @@ -3884,6 +3884,8 @@ namespace Kernel region->pin(); return region.ptr(); } + + return BAN::Error::from_errno(EFAULT); } validate_and_pin_pointer_access_with_allocation: