VM_MAP_CHECK_PROTECTION(9freebsd)
π VM_MAP_CHECK_PROTECTION π
okay bestie, gather round, because we're doing a kernel dev manual page and honestly? it's giving main character energy. this is vm_map_check_protection(9) from the Kernel Developer's Manual (yes, section 9, the cool section) π
β¨ NAME β¨
vm_map_check_protection β check memory protection for 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, literally copy-paste those includes, no cap πβ¨
π DESCRIPTION π
so vm_map_check_protection() is that friend who confirms things for you. it asserts that the target map allows the specified privilege protection over the entire address range from start to end. the whole range. no gaps. no sneaky little detours. π«Ά
and the region MUST be contiguous β no holes allowed, periodt. if there's a hole in there, this is not the vibe check you're looking for π
π§ IMPLEMENTATION NOTES π§
okay this part is important so pay attention bestie:
this code does not and SHOULD not check whether the contents of the region are accessible. iykyk. for example, a small file may be mapped into an address space which is significantly larger in size. π¦
like β the range being valid β the memory behind it actually having stuff in it. don't come for this function about that, it's simply not its job π
β RETURN VALUES β
TRUEβ the privilege is allowed β slayFALSEβ it is not allowed, or any other error occurred β it's giving nope
so basically: TRUE = yes queen, FALSE = no, and also FALSE covers "something else went wrong entirely," which is lowkey chaotic but that's just how it is π
π SEE ALSO π
go read those too, they're iconic π
π AUTHORS π
this manual page was written by Bruce M Simpson <bms@spc.org>. thank you for your service king π«‘π
aaaand that's the whole page fr fr. sourced from Debian, dated July 19, 2003 β vintage but still eating π β¨ no notes, absolute classic. bye bestie, go check your protections π¦π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2003 Bruce M Simpson <bms@spc.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms