text_poke_copy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– text_poke_copy(9) πŸ’–

okay so bestie, welcome to text_poke_copy(9) from the Kernel API Manual ✨ this one is giving low-level code-injection realness, and we're gonna read it together 🫢


✨ NAME ✨

text_poke_copy β€” copy instructions into (an unused part of) RX memory πŸ’…


🌸 SYNOPSIS 🌸

void * text_poke_copy (void *addr , const void *opcode , size_t len );

πŸŽ€ ARGUMENTS πŸŽ€

  • addr β€” address to modify
  • opcode β€” source of the copy
  • len β€” length to copy, could be more than 2x PAGE_SIZE

πŸ¦‹ DESCRIPTION πŸ¦‹

⚠️ Not safe against concurrent execution ⚠️ like, fr fr, do not ignore this part.

It's useful for JITs to dump new code blocks into unused regions of RX memory. You can use it in conjunction with synchronize_rcu_tasks to wait for existing execution to quiesce after having made sure no existing functions pointers are live. no cap, that's the whole vibe πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./arch/x86/kernel/alternative.c β€” and yes, the whole friend group is here:


mwah πŸ’‹ source/version: ./arch/x86/kernel Β· date: October 2026 Β· text_poke_copy(9) signing off, periodt πŸ’œ

πŸ“¦ where this page comes from