VM_MAP_CHECK_PROTECTION(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… VM_MAP_CHECK_PROTECTION(9) β€” the kernel dev manual, bestie edition ✨

okay so this is a page from the Kernel Developer's Manual, section 9 (that's the kernel-functions girlies, iykyk) πŸŽ€

🌸 NAME 🌸

vm_map_check_protection β€” the vibe check for memory protection on a vm_map πŸ‘‘

✨ SYNOPSIS ✨

#include <sys/param.h>
#include <vm/vm.h>
#include <vm/vm_map.h>

boolean_t
vm_map_check_protection(vm_map_t map, vm_offset_t start,
    vm_offset_t end, vm_prot_t protection);

like, include all three of those headers, no skipping, fr fr 🫢

πŸ’– DESCRIPTION πŸ’–

The vm_map_check_protection() function asserts that the target map allows the specified privilege protection over the entire address range from start to end. literally the whole thing, no gaps, no excuses πŸ’…

The region MUST be contiguous β€” no holes allowed, periodt. πŸ™ˆ

πŸ”₯ IMPLEMENTATION NOTES πŸ”₯

bestie listen. this code does not check β€” and SHOULD not check β€” whether the contents of the region are actually accessible. it's giving "not my department." for example, a small file may be mapped into an address space which is significantly larger in size. so yeah, size of mapping β‰  size of file, don't come for her πŸ’€

🌈 RETURN VALUES 🌈

  • TRUE β€” the privilege is allowed, slay πŸ‘‘
  • FALSE β€” it is not allowed, or any other error occurred. either way you get FALSE. that's the whole answer, no nuance, no crumbs 😭

πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, they're iconic in their own right ⭐

πŸ“ AUTHORS πŸ“

This manual page was written by Bruce M Simpson <bms@spc.org>. king behaviour, we stan 🫢


and that's the whole page diva πŸ’œ this edition came from Debian, dated July 19, 2003 β€” yeah she's vintage, and she still ate 🌸

πŸ“¦ where this page comes from