diff options
author | Jiri Kosina <jkosina@suse.cz> | 2019-07-10 01:20:26 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2019-07-10 01:20:26 +0200 |
commit | 38195dd5e916f3e55aec585703f2432562c2db02 (patch) | |
tree | 15f9c1a2249d3325c3b5fd8cbc395b4a2964bb74 /kernel | |
parent | aec71d794731c441a9b7ee9705efedd2f6054173 (diff) | |
parent | ac59a471e9371e3184425efd6a2fd8ac5c7e4c2b (diff) |
Merge branch 'for-5.3/core' into for-linus
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/livepatch/transition.c | 11 | ||||
-rw-r--r-- | kernel/stacktrace.c | 8 |
2 files changed, 8 insertions, 11 deletions
diff --git a/kernel/livepatch/transition.c b/kernel/livepatch/transition.c index c53370d596be..3c764e73b032 100644 --- a/kernel/livepatch/transition.c +++ b/kernel/livepatch/transition.c @@ -259,7 +259,6 @@ static int klp_check_stack(struct task_struct *task, char *err_buf) int ret, nr_entries; ret = stack_trace_save_tsk_reliable(task, entries, ARRAY_SIZE(entries)); - WARN_ON_ONCE(ret == -ENOSYS); if (ret < 0) { snprintf(err_buf, STACK_ERR_BUF_SIZE, "%s: %s:%d has an unreliable stack\n", @@ -293,11 +292,11 @@ static int klp_check_stack(struct task_struct *task, char *err_buf) */ static bool klp_try_switch_task(struct task_struct *task) { + static char err_buf[STACK_ERR_BUF_SIZE]; struct rq *rq; struct rq_flags flags; int ret; bool success = false; - char err_buf[STACK_ERR_BUF_SIZE]; err_buf[0] = '\0'; @@ -306,6 +305,13 @@ static bool klp_try_switch_task(struct task_struct *task) 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 * state. @@ -340,7 +346,6 @@ done: pr_debug("%s", err_buf); return success; - } /* diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c index 27bafc1e271e..319e7fcf3083 100644 --- a/kernel/stacktrace.c +++ b/kernel/stacktrace.c @@ -254,14 +254,6 @@ save_stack_trace_regs(struct pt_regs *regs, struct stack_trace *trace) WARN_ONCE(1, KERN_INFO "save_stack_trace_regs() not implemented yet.\n"); } -__weak int -save_stack_trace_tsk_reliable(struct task_struct *tsk, - struct stack_trace *trace) -{ - WARN_ONCE(1, KERN_INFO "save_stack_tsk_reliable() not implemented yet.\n"); - return -ENOSYS; -} - /** * stack_trace_save - Save a stack trace into a storage array * @store: Pointer to storage array |