diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2017-08-09 23:42:51 -0400 |
---|---|---|
committer | Nicolas Pitre <nicolas.pitre@linaro.org> | 2017-09-10 19:31:46 -0400 |
commit | 5c16595353e0743af99294db48549c3145e3a5ad (patch) | |
tree | f3235a25b45bf879e523ac56037a06e8325f961f /arch/arm/kernel/signal.h | |
parent | 5e5881143297c97207486349ec1cf9fd833b1510 (diff) | |
download | talos-op-linux-5c16595353e0743af99294db48549c3145e3a5ad.tar.gz talos-op-linux-5c16595353e0743af99294db48549c3145e3a5ad.zip |
ARM: signal handling support for FDPIC_FUNCPTRS functions
Signal handlers are not direct function pointers but pointers to function
descriptor in that case. Therefore we must retrieve the actual function
address and load the GOT value into r9 from the descriptor before branching
to the actual handler.
If a restorer is provided, we also have to load its address and GOT from
its descriptor. That descriptor address and the code to load it is pushed
onto the stack to be executed as soon as the signal handler returns.
However, to be compatible with NX stacks, the FDPIC bounce code is also
copied to the signal page along with the other code stubs. Therefore this
code must get at the descriptor address whether it executes from the stack
or the signal page. To do so we use the stack pointer which points at the
signal stack frame where the descriptor address was stored. Because the
rt signal frame is different from the simpler frame, two versions of the
bounce code are needed, and two variants (ARM and Thumb) as well. The
asm-offsets facility is used to determine the actual offset in the signal
frame for each version, meaning that struct sigframe and rt_sigframe had
to be moved to a separate file.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Mickael GUENE <mickael.guene@st.com>
Tested-by: Vincent Abriou <vincent.abriou@st.com>
Tested-by: Andras Szemzo <szemzo.andras@gmail.com>
Diffstat (limited to 'arch/arm/kernel/signal.h')
-rw-r--r-- | arch/arm/kernel/signal.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/kernel/signal.h b/arch/arm/kernel/signal.h new file mode 100644 index 000000000000..b7b838b05229 --- /dev/null +++ b/arch/arm/kernel/signal.h @@ -0,0 +1,11 @@ +#include <asm/ucontext.h> + +struct sigframe { + struct ucontext uc; + unsigned long retcode[4]; +}; + +struct rt_sigframe { + struct siginfo info; + struct sigframe sig; +}; |