memdup_array_user(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so bestie, we are in the Kernel API Manual, and the icon, the moment, the whole entire main character is memdup_array_user β€” duplicate array from user space. No cap, that’s the name and that’s the job. πŸ’…βœ¨


✨ SYNOPSIS ✨

        void * memdup_array_user (const void __user *src , size_t n , size_t
       size );

🫢 ARGUMENTS 🫢

the way that these three are literally just doing their little jobs, one by one, and we love them for it:

  • src β€” source address in user space 🌍
  • n β€” number of array members to copy πŸ”’
  • size β€” size of one array member πŸ“

πŸ’– RETURN πŸ’–

if things go sideways, you get an ERR_PTR on failure. and listen, the result is physically contiguous, to be freed by kfree. so yeah, that kfree cleanup arc is mandatory, bestie β€” don’t leave it hanging. πŸ§ΉπŸ’€


πŸ¦‹ SEE ALSO πŸ¦‹

the page points at the Kernel file ./include/linux/string.h plus this whole SEE ALSO friend group, and yes they all get their exact little names because we do not abbreviate the squad:


mwah πŸ’‹ this page’s footer tea is source/version ./include/linux, dated October 2026, and that’s the cute little sign-off, periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from