From 9ec9d20e847476e552ea8f9303b58d381949dc4c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 2 Jan 2021 13:34:29 +0100 Subject: [PATCH] Kernel: Fix bad VMObject iteration in sys$purge() We were fooling ourselves into thinking all VMObjects are anonymous and then tried to call purge() on them as if they were. --- Kernel/Syscalls/purge.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Kernel/Syscalls/purge.cpp b/Kernel/Syscalls/purge.cpp index 0d6991a1f1..582fb4c016 100644 --- a/Kernel/Syscalls/purge.cpp +++ b/Kernel/Syscalls/purge.cpp @@ -43,7 +43,8 @@ int Process::sys$purge(int mode) { InterruptDisabler disabler; MM.for_each_vmobject([&](auto& vmobject) { - vmobjects.append(vmobject); + if (vmobject.is_anonymous()) + vmobjects.append(vmobject); return IterationDecision::Continue; }); }