execmem_alloc(9)
π execmem_alloc β it's giving "here's your executable memory, bestie"
okay so real talk, this page lives in the Kernel API Manual section 9, and the star of the show is execmem_alloc(9). she's a kernel-space girlie who hands out memory that's allowed to run stuff. β¨
π NAME
execmem_alloc β allocate executable memory π«Ά
πΈ SYNOPSIS
void * execmem_alloc (enum execmem_type type , size_t size );
like, that's the whole vibe. you give her a type and a size, she gives you back a pointer. iconic. π
π¦ ARGUMENTS
typeβ the type of the allocation π (yes it's anenum execmem_type, she's fancy)sizeβ how many bytes of memory are required π (count carefully bestie, bytes are bytes)
β¨ DESCRIPTION
okay so first thing: this allocates memory that will contain executable code β either code that's been generated, or code loaded from kernel modules. both. she does both. ππ₯
also β and this is the part people forget β she allocates memory that will contain data coupled with executable code, like the data sections in kernel modules. so it's not just code-code, it's the data that rides shotgun with the code. iykyk. π«Ά
and the memory comes with protections defined by the architecture for the executable region of the type. so like, whatever type you picked? the arch already decided how that region gets guarded. not your call, not my call. that's just how it is. no cap. β¨
π RETURN
a pointer to the allocated memory, or NULL π (fr fr, check for the NULL, don't just vibe forward and crash)
π SEE ALSO
Kernel file ./include/linux/execmem.h β go read it, she's thorough π
enum execmem_type(9)enum execmem_range_flags(9)execmem_fill_trapping_insns(9)execmem_restore_rox(9)struct execmem_range(9)struct execmem_info(9)execmem_arch_setup(9)execmem_alloc_rw(9)execmem_free(9)execmem_vmap(9)execmem_is_rox(9)
and that's the page, bestie π§ this one ships out of ./include/linux and it's dated October 2026 β so, yeah, she's from the future and she's still slaying. periodt. ππ
π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms