kmsan_handle_dma(9)
π kmsan_handle_dma(9)
okay so bestie, welcome to the Kernel API Manual β yes, the actual manual manual, we're doing this π β and today's main character is kmsan_handle_dma, the little function that keeps your DMA transfers from lying to the kernel's memory sanitizer. no cap, it's lowkey important.
β¨ NAME β¨
kmsan_handle_dma β handle a DMA data transfer. that's it. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
void kmsan_handle_dma (phys_addr_t phys , size_t size , enum
dma_data_direction dir );
three args, one job, zero drama. slay. β¨
π ARGUMENTS π
physβ the physical address of the buffer. like, where the buffer physically is. πsizeβ buffer size. how many bytes we're talking about, bestie. πdirβ one of the possibledma_data_directionvalues. it's giving "which way is the data even going" π
π§ DESCRIPTION π§
so depending on the direction, KMSAN does one of three things β pick your fighter:
- β checks the buffer, if it's copied to the device
- π« initializes the buffer, if it's copied from the device
- π₯ does both, if this is a
DMA_BIDIRECTIONALtransfer
bidirectional said "why not both" and honestly? iconic. π
π SEE ALSO π
kernel file ./include/linux/kmsan.h β plus the whole kmsan bestie squad, all of them, no one left behind π«Ά:
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_sg(9)kmsan_handle_urb(9)kmsan_unpoison_entry_regs(9)kmsan_get_metadata(9)kmsan_enable_current(9)kmsan_disable_current(9)memset_no_sanitize_memory(9)
ok that's the whole page, you ate that π go forth and sanitize your DMA, bestie. fr fr.
mwah π this lil page lives in ./include/linux and it's stamped October 2026 β that's the source and the date, and yes I did save you a seat in the group chat. bye bb πβ¨
π¦ 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