[RFC][PATCH] Load/Unload Hooks for Livepatch

From: Chris J Arges
Date: Fri Aug 26 2016 - 14:51:16 EST


Load/unload hooks will be useful to have when applying livepatches. Today
one can create hooks by writing code in the livepatch init/exit functions
and properly setting up module notifier callbacks to handle various cases.
This can be error prone and unwieldy as we have the proper mechanisms
already in the livepatch proper code.

I've tested this code with some sample livepatch code that exercised the
following:
- works with single/multiple hooks for both load/unload
- works if load_hooks/unload_hooks are NULL
- works if individual hooks are NULL
- handles bad return values from hooks
- handles properly when inserting/removing dependent modules
- can handle load_hook for vmlinux as well

The idea of these hooks are based off of the kpatch project.

Chris J Arges (1):
livepatch: add load/unload hooks to objects

include/linux/livepatch.h | 33 +++++++++++++++++++++++++++------
kernel/livepatch/core.c | 29 +++++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 6 deletions(-)

--
2.7.4