Skip to content

Commit

Permalink
Revert "livepatch: Remove reliable stacktrace check in klp_try_switch…
Browse files Browse the repository at this point in the history
…_task()"

This reverts commit 1d98a69. Commit
31adf23 ("livepatch: Convert error about unsupported reliable
stacktrace into a warning") weakened the enforcement for architectures
to have reliable stack traces support. The system only warns now about
it.

It only makes sense to reintroduce the compile time checking in
klp_try_switch_task() again and bail out early.

Signed-off-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
  • Loading branch information
Miroslav Benes authored and Petr Mladek committed Jun 20, 2019
1 parent 380178e commit 67059d6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/livepatch/transition.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ static bool klp_try_switch_task(struct task_struct *task)
if (task->patch_state == klp_target_state)
return true;

/*
* For arches which don't have reliable stack traces, we have to rely
* on other methods (e.g., switching tasks at kernel exit).
*/
if (!klp_have_reliable_stack())
return false;

/*
* Now try to check the stack for any to-be-patched or to-be-unpatched
* functions. If all goes well, switch the task to the target patch
Expand Down

0 comments on commit 67059d6

Please sign in to comment.