From 1892b8956115bef5ef6b4c0bb6f93d3fd16edc04 Mon Sep 17 00:00:00 2001 From: kib Date: Wed, 21 Jun 2017 18:51:30 +0000 Subject: [PATCH] Assert that the protection of a new map entry is a subset of the max protection. Noted and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/vm/vm_map.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index cbbd9762c90d..86d17aeddea6 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1190,6 +1190,8 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset, ("vm_map_insert: kmem or kernel object and COW")); KASSERT(object == NULL || (cow & MAP_NOFAULT) == 0, ("vm_map_insert: paradoxical MAP_NOFAULT request")); + KASSERT((prot & ~max) == 0, + ("prot %#x is not subset of max_prot %#x", prot, max)); /* * Check that the start and end points are not bogus.