move_addr_to_user(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– move_addr_to_user(9) πŸ’–

okay bestie, this page is from the Kernel API Manual, and it’s all about move_addr_to_user(9) β€” so cozy up, because it’s giving kernel-to-user copy realness ✨.

πŸ’– NAME πŸ’–

move_addr_to_user β€” copy an address to user space 🫢. That’s the name, that’s the assignment, periodt.

✨ SYNOPSIS ✨

       int move_addr_to_user (struct sockaddr_storage *kaddr , int klen , void
       __user *uaddr , int __user *ulen );

πŸŽ€ ARGUMENTS πŸŽ€

  • kaddr β€” the kernel space address, no cap.
  • klen β€” length of the address in kernel.
  • uaddr β€” the user space address.
  • ulen β€” pointer to the user length field.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so on entry, the value pointed to by ulen is the buffer length available. Then it gets overwritten with the buffer space used β€” the way it just updates, iconic πŸ’….

-EINVAL is returned if an overlong buffer is specified or a negative buffer size. -EFAULT is returned if either the buffer or the length field are not accessible. Those error returns are not a vibe, but they are important fr fr 😭.

After copying the data up to the limit the user specifies, the true length of the data is written over the length limit the user specified. And 0 is returned for a success β€” yes bestie, success gets a big fat zero and that’s slay πŸŽ‰.

🌸 SEE ALSO 🌸

Kernel file ./net/socket.c is the spot πŸ‘‘. The SEE ALSO crew, in order and with zero skips: move_addr_to_kernel(9), sock_read_xattr(9), sock_alloc_file(9), sock_from_file(9), sockfd_lookup(9), sock_alloc(9), sock_release(9), sock_sendmsg(9), kernel_sendmsg(9), sock_recvmsg(9), kernel_recvmsg(9), sock_create_lite(9), __sock_create(9), sock_create(9), sock_create_kern(9), sock_register(9), sock_unregister(9), kernel_bind(9), kernel_listen(9), kernel_accept(9), kernel_connect(9), kernel_getsockname(9), kernel_getpeername(9), kernel_sock_shutdown(9), kernel_sock_ip_overhead(9). iykyk πŸ’œ.


source vibes: ./net Β· date: October 2026 Β· manual: move_addr_to_user(9) β€” mwah πŸ’–βœ¨

πŸ“¦ where this page comes from