kmsan_handle_dma(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 possible dma_data_direction values. 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_BIDIRECTIONAL transfer

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 🫢:


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