kmsan_get_metadata(9)
π kmsan_get_metadata β like, the Kernel API Manual page you didn't know you needed π«Ά
Okay so bestie, welcome to kmsan_get_metadata(9), straight out of the Kernel API Manual. Lowkey this one is short but it's iconic β it's the little pointer-fetcher for KMSAN's shadow and origins. Let's get into it β¨
β¨ NAME β¨
kmsan_get_metadata β returns a pointer to the KMSAN shadow or the origins. That's it. That's the whole job. She's a one-trick pony and she ate π
πΈ SYNOPSIS πΈ
void * kmsan_get_metadata (void *addr , bool is_origin );
Look at her. Two args, one pointer back. Obsessed with the efficiency honestly π
π ARGUMENTS π
addrβ a kernel address. Just a kernel address, sitting there, being a kernel address π¦is_originβ the vibe selector: do you want the origins back, or the shadow? You literally have to pick one, bestie, no cap π
π DESCRIPTION π
So the whole deal here: if the metadata can't be found, it returns NULL. That's it. That's the description. Not me expecting a whole essay π β the original said it in one line and we're keeping it in one line, fr fr. No guessing, no extra lore, no invented behaviour. NULL = not found. Periodt π
π₯ SEE ALSO π₯
Okay this is where it gets good β the whole KMSAN friend group shows up. Kernel file ./include/linux/kmsan.h plus:
kmsan_task_create(9)kmsan_task_exit(9)kmsan_init_shadow(9)kmsan_init_runtime(9)kmsan_memblock_free_pages(9)kmsan_alloc_page(9)kmsan_free_page(9)kmsan_copy_page_meta(9)kmsan_slab_alloc(9)kmsan_slab_free(9)kmsan_kmalloc_large(9)kmsan_kfree_large(9)kmsan_ioremap_page_range(9)kmsan_iounmap_page_range(9)kmsan_handle_dma(9)kmsan_handle_dma_sg(9)kmsan_handle_urb(9)kmsan_unpoison_entry_regs(9)kmsan_enable_current(9)kmsan_disable_current(9)memset_no_sanitize_memory(9)
Twenty-one besties and every single one of them is a whole personality. Go read them all, iykyk π
π Sourced from./include/linux, dated October 2026, pagekmsan_get_metadata(9). That's the footer, bestie β now you have the receipts π§π
π¦ 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