Skip to content

Commit 28f28ea

Browse files
committed
Merge branch 'for-5.3-core' into for-next
2 parents eb1bfcf + ac59a47 commit 28f28ea

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

kernel/livepatch/transition.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ static int klp_check_stack(struct task_struct *task, char *err_buf)
247247
int ret, nr_entries;
248248

249249
ret = stack_trace_save_tsk_reliable(task, entries, ARRAY_SIZE(entries));
250-
WARN_ON_ONCE(ret == -ENOSYS);
251250
if (ret < 0) {
252251
snprintf(err_buf, STACK_ERR_BUF_SIZE,
253252
"%s: %s:%d has an unreliable stack\n",
@@ -293,6 +292,13 @@ static bool klp_try_switch_task(struct task_struct *task)
293292
if (task->patch_state == klp_target_state)
294293
return true;
295294

295+
/*
296+
* For arches which don't have reliable stack traces, we have to rely
297+
* on other methods (e.g., switching tasks at kernel exit).
298+
*/
299+
if (!klp_have_reliable_stack())
300+
return false;
301+
296302
/*
297303
* Now try to check the stack for any to-be-patched or to-be-unpatched
298304
* functions. If all goes well, switch the task to the target patch

kernel/stacktrace.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,6 @@ save_stack_trace_regs(struct pt_regs *regs, struct stack_trace *trace)
255255
WARN_ONCE(1, KERN_INFO "save_stack_trace_regs() not implemented yet.\n");
256256
}
257257

258-
__weak int
259-
save_stack_trace_tsk_reliable(struct task_struct *tsk,
260-
struct stack_trace *trace)
261-
{
262-
WARN_ONCE(1, KERN_INFO "save_stack_tsk_reliable() not implemented yet.\n");
263-
return -ENOSYS;
264-
}
265-
266258
/**
267259
* stack_trace_save - Save a stack trace into a storage array
268260
* @store: Pointer to storage array

0 commit comments

Comments
 (0)