From 71ccd7528fa4380b146e71040d9bc246f8a5d82b Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 18 Jul 2024 21:08:34 -0400 Subject: kernel: exit: Drop loadmap entries with bad range Signed-off-by: Ian Moffett --- sys/kern/kern_exit.c | 5 +++++ 1 file changed, 5 insertions(+) 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", -- cgit v1.2.3