text_poke(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ’œ


okay that's the whole page, bestie 🫢 source: ./arch/x86/kernel; date: October 2026; page: text_poke(9). byeeee πŸ’…βœ¨

πŸ“¦ where this page comes from