diff options
| author | Petr Mladek <[email protected]> | 2019-01-09 12:43:22 +0000 |
|---|---|---|
| committer | Jiri Kosina <[email protected]> | 2019-01-11 19:51:24 +0000 |
| commit | 68007289bf3cd937a5b8fc4987d2787167bd06ca (patch) | |
| tree | 2c913929da4c5e65fcacdfc5afb47399d86cf446 /samples/livepatch/livepatch-callbacks-demo.c | |
| parent | livepatch: Consolidate klp_free functions (diff) | |
| download | kernel-68007289bf3cd937a5b8fc4987d2787167bd06ca.tar.gz kernel-68007289bf3cd937a5b8fc4987d2787167bd06ca.zip | |
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 <[email protected]>
Acked-by: Joe Lawrence <[email protected]>
Acked-by: Miroslav Benes <[email protected]>
Acked-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Diffstat (limited to 'samples/livepatch/livepatch-callbacks-demo.c')
0 files changed, 0 insertions, 0 deletions
