Skip to content

Commit 67059d6

Browse files
mirabpmladek
authored andcommitted
Revert "livepatch: Remove reliable stacktrace check in klp_try_switch_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 <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Reviewed-by: Kamalesh Babulal <[email protected]> Signed-off-by: Petr Mladek <[email protected]>
1 parent 380178e commit 67059d6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/livepatch/transition.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,13 @@ static bool klp_try_switch_task(struct task_struct *task)
305305
if (task->patch_state == klp_target_state)
306306
return true;
307307

308+
/*
309+
* For arches which don't have reliable stack traces, we have to rely
310+
* on other methods (e.g., switching tasks at kernel exit).
311+
*/
312+
if (!klp_have_reliable_stack())
313+
return false;
314+
308315
/*
309316
* Now try to check the stack for any to-be-patched or to-be-unpatched
310317
* functions. If all goes well, switch the task to the target patch

0 commit comments

Comments
 (0)