Re: [WARNING] livepatch/x86: Invalid return address when checking a stack of the schedule stuff

From: Josh Poimboeuf
Date: Mon May 22 2017 - 10:04:13 EST


On Mon, May 22, 2017 at 01:50:36PM +0200, Petr Mladek wrote:
> Hi,
>
> I have just tried to apply the livepatch-sample module using
> the consistency model in current Linus' tree (4.12-rc2) and
> got the following warning from the stack checker code:
>
> [ 28.580616] livepatch_sample: tainting kernel with TAINT_LIVEPATCH
> [ 28.581572] livepatch_sample: module verification failed: signature and/or required key missing - tainting kernel
> [ 28.589943] livepatch: enabling patch 'livepatch_sample'
> [ 28.592146] livepatch: 'livepatch_sample': patching...
> [ 28.592643] ------------[ cut here ]------------
> [ 28.593069] WARNING: CPU: 1 PID: 3699 at arch/x86/kernel/stacktrace.c:132 save_stack_trace_tsk_reliable+0x133/0x1a0

Thanks, I was able to recreate it too. We should really add
livepatch-sample loading to the kernel selftests.

This seems to be caused by:

ff3f7e2475bb ("x86/entry: Fix the end of the stack for newly forked tasks")

I'm not sure what I was smoking when I made that patch because now it
seems completely wrong. Need to think about it a little more.

--
Josh