kmsan_copy_to_user(9)
π NAME π
okay so bestie, meet kmsan_copy_to_user(9) from the Kernel API Manual β itβs literally the function that notifies KMSAN about a data transfer to userspace. no cap, thatβs the whole name-and-purpose moment β¨
β¨ SYNOPSIS β¨
void kmsan_copy_to_user (void __user *to , const void *from , size_t
to_copy , size_t left );
π ARGUMENTS π
toβ the destination address in the userspace π where the data is headed.fromβ the source address in the kernel πΈ where the data is coming from.to_copyβ the number of bytes to copy πleftβ the number of bytes not copied π
π₯ DESCRIPTION π₯
So hereβs the tea: if this is a real userspace data transfer, KMSAN does a little vibe check on the bytes that were actually copied to make sure there was no information leak πβ¨
And if to belongs to the kernel space β which is possible for compat syscalls β KMSAN just copies the metadata. periodt π
π SEE ALSO π
- Kernel file
./include/linux/kmsan-checks.h kmsan_poison_memory(9)kmsan_unpoison_memory(9)kmsan_check_memory(9)kmsan_memmove(9)
okay thatβs the whole page, bestie π«Ά source/version ./include/linux, dated October 2026, page kmsan_copy_to_user(9) β mwah π
π¦ 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