text_poke(9)
π
text_poke(9) β a Kernel API Manual moment π
okay bestie, this is the text_poke(9) page from the Kernel API Manual β and it's literally about updating instructions on a live kernel. yes, live, as in already running. main character energy, but careful hands. β¨
β¨ NAME β¨
text_poke β Update instructions on a live kernel.
πΈ SYNOPSIS πΈ
void * text_poke (void *addr , const void *opcode , size_t len );
π ARGUMENTS π
addrβ address to modify.opcodeβ source of the copy.lenβ length to copy.
π¦ DESCRIPTION π¦
okay so here's the rule, no cap: when you are not doing early patching, only atomic text poke/set should be allowed. that means the size must be writable atomically, and the address must be aligned in a way that permits an atomic write. it also makes sure we fit on a single page. β¨
also, the caller must ensure that if the modified code is part of a module, the module would not be removed during poking. how do you lock that down? register a module notifier, and order module removal and patching through a mutex. periodt. π«Ά
π SEE ALSO π
- Kernel file
./arch/x86/kernel/alternative.c text_poke_early(9)text_poke_kgdb(9)text_poke_copy(9)text_poke_set(9)smp_text_poke_batch_finish(9)smp_text_poke_batch_add(9)smp_text_poke_single(9)
okay that's the whole page, bestie π«Ά source: ./arch/x86/kernel; date: October 2026; page: text_poke(9). byeeee π
β¨
π¦ 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