STRUCT KLP_FUNC(9)
β¨ struct klp_func β function structure for live patching β¨
okay bestie, welcome to the struct klp_func(9) page π
this is the kernel API manual, and this little struct is literally the main character of live patching. no cap, it's giving legend behaviour.
πΈ SYNOPSIS πΈ
struct klp_func {
const char *old_name;
void *new_func;
unsigned long old_sympos;
void *old_func;
struct kobject kobj;
struct list_head node;
struct list_head stack_node;
unsigned long old_size, new_size;
bool nop;
bool patched;
bool transition;
};
copy it exactly, don't be weird about the spacing π
π Members π
old_nameβ the name of the function that's getting patched, like the name tag at the party π«Άnew_funcβ pointer to the patched function code, aka the glow-up versionold_symposβ a hint telling you which symbol position the old function can be found in (optional, so no pressure) πold_funcβ pointer to the function actually being patchedkobjβ kobject for sysfs resources, its whole little sysfs situationnodeβ list node forklp_objectfunc_liststack_nodeβ list node forklp_opsfunc_stacklistold_sizeβ size of the old functionnew_sizeβ size of the new functionnopβ temporary patch to use the original code again; dyn. allocated (dynamic, not the nop instruction, don't @ me) πpatchedβ the func has been added to theklp_opslisttransitionβ the func is currently being applied or reverted
π Description π
so the patched and transition variables are the vibe check for the func's patching state β¨ when patching, a func is always in one of these four states, no in-betweens, periodt:
patched=0transition=0: unpatchedpatched=0transition=1: unpatched, temporary starting statepatched=1transition=1: patched, may be visible to some taskspatched=1transition=0: patched, visible to all tasks
and when unpatching, it goes in the reverse order, like a rewind π:
patched=1transition=0: patched, visible to all taskspatched=1transition=1: patched, may be visible to some taskspatched=0transition=1: unpatched, temporary ending statepatched=0transition=0: unpatched
fr fr memorize those two orders β the starting-and-ending temporary states are lowkey the whole point of transition, iykyk π
π SEE ALSO π
- Kernel file
./include/linux/livepatch.h struct klp_object(9)struct klp_state(9)struct klp_patch(9)
go read the whole squad, they're all iconic π
that's the page bestie!! ππ¦ from ./include/linux, dated October 2026 β mwah, slay, go patch something πβ¨
π¦ 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