From b61df2294f662540786f2558f691eba7447ff5ba Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 23 Sep 2015 18:33:49 +0000 Subject: fix signal return for sh/fdpic the restorer function pointer provided in the kernel sigaction structure is interpreted by the kernel as a raw code address, not a function descriptor. this commit moves the declarations of the __restore and __restore_rt symbols to ksigaction.h so that arch versions of the file can override them, and introduces a version for sh which declares them as objects rather than functions. an alternate solution would have been defining SA_RESTORER to 0 so that the functions are not used, but this both requires executable stack (since the sh kernel does not have a vdso page with permanent restorer functions) and crashes on qemu user-level emulation. --- arch/mips/ksigaction.h | 2 ++ arch/sh/ksigaction.h | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 arch/sh/ksigaction.h (limited to 'arch') diff --git a/arch/mips/ksigaction.h b/arch/mips/ksigaction.h index 6d731646..3127f7c0 100644 --- a/arch/mips/ksigaction.h +++ b/arch/mips/ksigaction.h @@ -7,3 +7,5 @@ struct k_sigaction { * mips-specific preprocessor conditionals in sigaction.c. */ void (*restorer)(); }; + +void __restore(), __restore_rt(); diff --git a/arch/sh/ksigaction.h b/arch/sh/ksigaction.h new file mode 100644 index 00000000..0c652bea --- /dev/null +++ b/arch/sh/ksigaction.h @@ -0,0 +1,8 @@ +struct k_sigaction { + void (*handler)(int); + unsigned long flags; + void *restorer; + unsigned mask[2]; +}; + +extern unsigned char __restore[], __restore_rt[]; -- cgit v1.2.1