STRUCT KLP_CALLBACKS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct klp_callbacks(9)

okay bestie, welcome to the struct klp_callbacks(9) page from the Kernel API Manual ✨ β€” this is the callback structure for pre/post live-(un)patch, and we're gonna make it make sense, fr fr.

✨ NAME

  • struct klp_callbacks β€” pre/post live-(un)patch callback structure. that's the whole name, iconic and exact πŸ’…

πŸŽ€ SYNOPSIS

struct klp_callbacks {
    klp_pre_patch_t pre_patch;
    klp_post_patch_t post_patch;
    klp_pre_unpatch_t pre_unpatch;
    klp_post_unpatch_t post_unpatch;
    bool post_unpatch_enabled;
};

🫢 MEMBERS

  • pre_patch β€” executed before code patching. yep, before the patch moment πŸ‘‘
  • post_patch β€” executed after code patching. after the patch, bestie 🌸
  • pre_unpatch β€” executed before code unpatching. before the unpatch era πŸ¦‹
  • post_unpatch β€” executed after code unpatching. after the unpatch, periodt πŸ’œ
  • post_unpatch_enabled β€” flag indicating if post-unpatch callback should run. it's the little bool vibe check for that callback βœ…

🌈 DESCRIPTION

okay so all callbacks are optional β€” every single one. Only the pre-patch callback, if provided, will be unconditionally executed. that's the main character of this struct, no cap.

If the parent klp_object fails to patch for any reason, including a non-zero error status returned from the pre-patch callback, no further callbacks will be executed. like, full stop, bestie 😭

πŸ”₯ SEE ALSO

  • Kernel file ./tools/include/linux/livepatch_external.h β€” go read it, iykyk πŸ“–

mwah πŸ’‹ source: ./tools/include/linux Β· date: October 2026 Β· page: struct klp_callbacks(9) β€” catch you in the kernel, bestie 🫢

πŸ“¦ where this page comes from