fault_in_user_writeable(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fault_in_user_writeable(9) β€” the Kernel API Manual glow-up

okay so bestie, welcome to fault_in_user_writeable, a lil function living in the Kernel API Manual. she's not famous, she's not flashy, but she is literally the cleanup crew for futex code and we're gonna stan her properly. 🫢


✨ NAME ✨

fault_in_user_writeable β€” fault in a user address and verify RW access. that's it, that's the whole vibe check. πŸ’–


🌸 SYNOPSIS 🌸

int fault_in_user_writeable (u32 __user *uaddr );

one argument, one int coming back atcha. simple. iconic. periodt. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • uaddr β€” pointer to the faulting user space address. yes bestie, user space, so be on your best behaviour about it. πŸ¦‹

πŸ”₯ DESCRIPTION πŸ”₯

so this is the slow path to fixup the fault we just took in the atomic write access to uaddr. think of it as the "okay gorl, let's handle this properly" branch instead of the fast in-line moment. 😭

here's the thing though β€” we have no generic implementation of a non-destructive write to the user address. none. doesn't exist. ngl that's just the situation. πŸ’€

but here's where it gets cute: we know we faulted in the atomic pagefault disabled section, which means we can as well avoid the #PF overhead by calling get_user_pages right away. so we do exactly that. main character energy from start to finish. πŸ‘‘

πŸ’‘ tiny reminder in her own words: it's the slow path, it's about a write that isn't destructive, and get_user_pages gets called straight away to dodge that #PF overhead. that's the whole story, no plot twists.

πŸ’œ SEE ALSO πŸ’œ

the whole futex friend group shows up, because of course they do (iykyk):


and that's the page, bestie!! 🌈 this one's filed under ./kernel/futex and dated October 2026 β€” screenshot it, memorise it, tell your friends. πŸ’…β­πŸ“

πŸ“¦ where this page comes from