Skip to content

Commit

Permalink
fixup! Revoke fully unmapped reservations
Browse files Browse the repository at this point in the history
Better document the quarantine path in vm_map_remove_locked.
  • Loading branch information
brooksdavis committed Feb 14, 2023
1 parent 350757d commit dc1bd41
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sys/vm/vm_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -4720,7 +4720,15 @@ vm_map_remove_locked(vm_map_t map, vm_offset_t start, vm_offset_t end)
#ifdef CHERI_CAPREVOKE
if (quarantine_unmapped_reservations &&
start < VM_MAXUSER_ADDRESS) {
/*
* If we're here, [start, end) was the last mapped
* range in reservation and it has transitioned to
* fully unmapped with a new entry. Look up the
* entry and quarantine it.
*/
vm_map_lookup_entry(map, start, &entry);
KASSERT(entry->start <= start && entry->end >= end,
("entry doesn't cover removed range"));
vm_map_entry_quarantine(map, entry);
} else
#endif
Expand Down

0 comments on commit dc1bd41

Please sign in to comment.