]> git.karo-electronics.de Git - karo-tx-linux.git/commit
arm64: signal: push the unwinding prologue on the signal stack
authorWill Deacon <will.deacon@arm.com>
Fri, 23 Nov 2012 12:34:13 +0000 (12:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Jan 2013 17:18:17 +0000 (09:18 -0800)
commit7dafc8952dc0964cead9646039a8d66a9ed4cf73
treeeaa56900f1e5cdb657c53857a8950669771a6cfd
parenta5220f902e102b27f529ffe3b9ef221583378597
arm64: signal: push the unwinding prologue on the signal stack

commit 304ef4e8367244b547734143c792a2ab764831e8 upstream.

To allow debuggers to unwind through signal frames, we create a fake
stack unwinding prologue containing the link register and frame pointer
of the interrupted context. The signal frame is then offset by 16 bytes
to make room for the two saved registers which are pushed onto the frame
of the *interrupted* context, rather than placed directly above the
signal stack.

This doesn't work when an alternative signal stack is set up for a SEGV
handler, which is raised in response to RLIMIT_STACK being reached. In
this case, we try to push the unwinding prologue onto the full stack and
subsequently take a fault which we fail to resolve, causing setup_return
to return -EFAULT and handle_signal to force_sigsegv on the current task.

This patch fixes the problem by including the unwinding prologue as part
of the rt_sigframe definition, which is populated during setup_sigframe,
ensuring that it always ends up on the signal stack.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/signal.c