Index | Thread | Search

From:
David Higgs <higgsd@gmail.com>
Subject:
VMMAP_DEBUG fix
To:
OpenBSD Tech <tech@openbsd.org>
Date:
Wed, 19 Feb 2025 21:11:47 -0500

Download raw body.

Thread
Is it possible that VMMAP_DEBUG is never enabled?  I think I found a
bug in vmspace_validate that panics because it ignores anon mmap pages
rather than counting them.

Apologies for the undoubtedly mangled diff.

--david

diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 0042c0c3d88..174eda984df 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -2744,7 +2744,7 @@ vmspace_validate(struct vm_map *map)
                imin = imax = iter->start;

                if (UVM_ET_ISHOLE(iter) || iter->object.uvm_obj != NULL ||
-                   iter->protection != PROT_NONE)
+                   iter->protection == PROT_NONE)
                        continue;

                /*