vma_modify_flags_uffd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ vma_modify_flags_uffd(9) πŸ¦‹

okay so bestie, welcome to the manual page for vma_modify_flags_uffd(9) β€” lowkey the kernel API function that does the pre-game prep before the actual flag glow-up πŸ’…βœ¨ it's giving "backstage crew, not the main character" and honestly? iconic.


🌸 NAME 🌸

vma_modify_flags_uffd β€” Perform any necessary split/merge in preparation for setting VMA flags to @vm_flags and UFFD context to @new_ctx in the range @start to @end contained within @vma.


✨ SYNOPSIS ✨

struct vm_area_struct * vma_modify_flags_uffd (struct vma_iterator *vmi
, struct vm_area_struct *prev , struct vm_area_struct *vma , unsigned
long start , unsigned long end , const vma_flags_t *vma_flags , struct
vm_userfaultfd_ctx new_ctx , bool give_up_on_oom );

πŸŽ€ ARGUMENTS πŸŽ€

  • vmi β€” a valid VMA iterator, positioned at vma. no cap, it has to be valid.
  • prev β€” the VMA immediately prior to vma, or NULL if vma is the first one. first-place energy πŸ₯‡
  • vma β€” the VMA containing the range start to end that's getting updated.
  • start β€” the start of the range to update. it may be offset within vma, so don't assume it starts at the very beginning.
  • end β€” the exclusive end of the range to update, and yes it may be offset within vma. exclusive means the end itself is not included, bestie.
  • vma_flags β€” the VMA flags that the start to end range is about to be set to.
  • new_ctx β€” the userfaultfd context that the start to end range is about to be set to.
  • give_up_on_oom β€” if an out of memory condition occurs on merge, simply give up on it and treat the merge as best-effort. it's the "we tried, it's fine" flag 🫢

πŸ’œ DESCRIPTION πŸ’œ

IMPORTANT: the actual modification being requested here is NOT applied. periodt. this function is not doing the flag flip or the context swap for you.

instead, the VMA is perhaps split, perhaps merged to accommodate the change β€” and the caller is expected to perform the actual modification. yes, that means you, the caller. you're the main character now πŸ‘‘.


🌈 RETURN 🌈

a VMA which contains the range start to end, ready to have its VMA flags changed to vma_flags and its userfaultfd context changed to new_ctx. it's prepped and ready, like a fit laid out the night before πŸ’…


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./mm/vma.h, plus vma_modify_flags(9), vma_modify_name(9), and vma_modify_policy(9). go read those too, iykyk.


made with πŸ’– from ./mm Β· October 2026 Β· vma_modify_flags_uffd(9) β€” slay and stay safe out there πŸŽ€

πŸ“¦ where this page comes from