move_addr_to_kernel(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… move_addr_to_kernel(9) β€” a Kernel API Manual moment

okay bestie, welcome to the Kernel API Manual πŸ’– this one's a little kernel-space baddie called move_addr_to_kernel and tbh she's giving "small function, big responsibilities." let's get into it πŸŽ€


✨ NAME ✨

move_addr_to_kernel β€” copy a socket address into kernel space 🫢

like, she takes your lil user-space address and yeets it over to kernel space. that's the whole vibe. no cap.


✨ SYNOPSIS ✨

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

lowkey iconic signature ngl πŸ’…


✨ ARGUMENTS ✨

  • uaddr β€” the address in user space 🌸 this is the one you're handing over
  • ulen β€” the length in user space πŸ“ how much of it we're dealing with
  • kaddr β€” the address in kernel space πŸ‘‘ this is where it's going, bestie

✨ DESCRIPTION ✨

so here's the tea β˜• the address gets copied into kernel space. that's it, that's the job, and honestly? she ate.

but listen, there are rules (there are always rules πŸ™ˆ):

  • if the address you provided is too long, you get an error code of -EINVAL back πŸ’€
  • if the copy gives invalid addresses, you get -EFAULT 😭
  • and on a success, you get 0 back ✨ slay
heads up bestie: those first two are error paths, not victories. don't go celebrating a -EINVAL, i'm begging πŸ™

✨ SEE ALSO ✨

she doesn't work alone, she's got a whole friend group 🫢 and it is long, so buckle up:

Kernel file ./net/socket.c move_addr_to_user(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)

like i said. whole friend group. main character energy all around πŸ‘‘


πŸ’– that's the whole page bestie, go forth and copy those socket addresses responsibly πŸ’–

this little love letter lives in the ./net source tree, dated October 2026, and it's filed under move_addr_to_kernel(9) πŸ¦‹ mwah, bye ✨

πŸ“¦ where this page comes from