aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-07-18 21:08:34 -0400
committerIan Moffett <ian@osmora.org>2024-07-18 21:08:34 -0400
commit71ccd7528fa4380b146e71040d9bc246f8a5d82b (patch)
treedce01c67383b4b113411cf607c8624ae582547cc
parent4b57a4986725ac5584bb6a7d346dbc83efe2d454 (diff)
kernel: exit: Drop loadmap entries with bad range
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/kern/kern_exit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 3f8f17e..d109725 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -56,6 +56,11 @@ unload_td(struct proc *td)
range = &execp->loadmap[i];
len = (range->end - range->start);
+ /* Drop entries with zeroed range */
+ if (range->start == 0 && range->end == 0) {
+ continue;
+ }
+
/* Attempt to unmap the range */
if (vm_unmap(pcbp->addrsp, range->vbase, len) != 0) {
pr_error("Failed to unmap %p - %p (pid=%d)\n",