KERNACC(9)
πΈ NAME πΈ
okay bestie, welcome to KERNACC(9) from the Kernel Developer's Manual β this page is literally all about kernacc and useracc, aka the functions that check memory regions for accessibility. Yes, both of them. Iconic.
π SYNOPSIS π
the whole vibe is right here:
#include <sys/param.h>
#include <sys/proc.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
int
kernacc(void *addr, int len, int rw);
int
useracc(void *addr, int len, int rw);
β¨ DESCRIPTION β¨
okay so kernacc() and useracc() are the duo that checks whether operations of the type specified in rw are permitted in the range of virtual addresses given by addr and len. periodt.
the possible values of rw are any bitwise combination of VM_PROT_READ, VM_PROT_WRITE and VM_PROT_EXECUTE. no cap, that's the whole menu.
kernacc() checks addresses in the kernel address space, while useracc() considers addr to represent an user space address. the process context to use for this operation is taken from the global variable curproc. iykyk π«Ά
π RETURN VALUES π
both functions return boolean true if the type of access specified by rw is permitted. otherwise boolean false is returned. that's it, that's the tea. π
π BUGS π
the process pointer should be passed in as an argument to useracc(). yes bestie, that's the bug note, and we are reporting it with love. π
xoxo, this Debian manual page is dated June 16, 1996 β bye bestie, go check those memory regions! π β¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1996 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms