linux/kernel/livepatch
Petr Mladek 68007289bf livepatch: Don't block the removal of patches loaded after a forced transition
module_put() is currently never called in klp_complete_transition() when
klp_force is set. As a result, we might keep the reference count even when
klp_enable_patch() fails and klp_cancel_transition() is called.

This might give the impression that a module might get blocked in some
strange init state. Fortunately, it is not the case. The reference count
is ignored when mod->init fails and erroneous modules are always removed.

Anyway, this might be confusing. Instead, this patch moves
the global klp_forced flag into struct klp_patch. As a result,
we block only modules that might still be in use after a forced
transition. Newly loaded livepatches might be eventually completely
removed later.

It is not a big deal. But the code is at least consistent with
the reality.

Signed-off-by: Petr Mladek <pmladek@suse.com>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-01-11 20:51:24 +01:00
..
core.c livepatch: Don't block the removal of patches loaded after a forced transition 2019-01-11 20:51:24 +01:00
core.h livepatch: Don't block the removal of patches loaded after a forced transition 2019-01-11 20:51:24 +01:00
Kconfig livepatch: Make livepatch dependent on !TRIM_UNUSED_KSYMS 2017-05-27 00:27:37 +02:00
Makefile livepatch: introduce shadow variable API 2017-09-14 23:06:12 +02:00
patch.c livepatch: Change unsigned long old_addr -> void *old_func in struct klp_func 2019-01-11 20:51:23 +01:00
patch.h livepatch: Change unsigned long old_addr -> void *old_func in struct klp_func 2019-01-11 20:51:23 +01:00
shadow.c livepatch: Allow to call a custom callback when freeing shadow variables 2018-04-17 13:42:48 +02:00
transition.c livepatch: Don't block the removal of patches loaded after a forced transition 2019-01-11 20:51:24 +01:00
transition.h livepatch: force transition to finish 2017-12-07 13:21:35 +01:00