A very small improvement to ptrace_vm_entry can be made at the cost of zeroing the eflags field in the map->headerInitializing the eflags field of the map->header entry to a value with a unique new bit set makes a few comparisons to &map->header unnecessary.