fault_in_subpage_writeable(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fault_in_subpage_writeable(9) β€” Kernel API Manual, but make it make sense

okay so bestie, this is the fault_in_subpage_writeable(9) page from the Kernel API Manual, and it's lowkey about faulting in an address range for writing. Let's get into it ✨

✨ NAME ✨

fault_in_subpage_writeable β€” fault in an address range for writing

🌸 SYNOPSIS 🌸

size_t fault_in_subpage_writeable (char __user *uaddr , size_t size );

πŸŽ€ ARGUMENTS πŸŽ€

  • uaddr β€” start of address range
  • size β€” size of address range

πŸ¦‹ DESCRIPTION πŸ¦‹

So this function faults in a user address range for writing, and it checks permissions at sub-page granularity (e.g. arm64 MTE, bestie). Use it when the caller cannot guarantee forward progress of a copy_to_user loop β€” that's the whole reason it exists.

It returns the number of bytes not faulted in (like copy_to_user and copy_from_user). No cap, that's the return value.

πŸ’œ SEE ALSO πŸ’œ

Kernel file ./mm/gup.c has the whole squad, and here's every single one:


okay byeee bestie 🫢 this page comes from the ./mm source, Kernel API Manual section 9, dated October 2026 β€” periodt πŸ’…

πŸ“¦ where this page comes from