text_poke_copy(9)
π 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 modifyopcodeβ source of the copylenβ length to copy, could be more than2x 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:
text_poke_early(9)text_poke(9)text_poke_kgdb(9)text_poke_set(9)smp_text_poke_batch_finish(9)smp_text_poke_batch_add(9)smp_text_poke_single(9)
mwah π source/version: ./arch/x86/kernel Β· date: October 2026 Β· text_poke_copy(9) signing off, periodt π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms