kmsan_copy_to_user(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 🌈


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