diff options
author | Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> | 2009-03-02 20:20:01 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-03 03:03:12 -0500 |
commit | 2505170211f7630361a852e25b60f4df4c878daa (patch) | |
tree | 3a641f60e07b93a090805b268b21ac3fb3e42040 | |
parent | 1fae0279ce4811fa123001515d1ed3d68c1d557f (diff) |
x86, signals: fix xine & firefox bustage
Impact: fix bad frame in rt_sigreturn on 64-bit
After commit 97286a2b64725aac2d584ddd1f94871f9991d5a1 some applications
fail to return from signal handler:
[ 145.150133] firefox[3250] bad frame in rt_sigreturn frame:00007f902b44eb28 ip:352e80b307 sp:7f902b44ef70 orax:ffffffffffffffff in libpthread-2.9.so[352e800000+17000]
[ 665.519017] firefox[5420] bad frame in rt_sigreturn frame:00007faa8deaeb28 ip:352e80b307 sp:7faa8deaef70 orax:ffffffffffffffff in libpthread-2.9.so[352e800000+17000]
The root cause is forgetting to keep 64 byte aligned value of
fpstate for next stack pointer calculation.
Reported-by: Jaswinder Singh Rajput <jaswinder@kernel.org>
Reported-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
LKML-Reference: <49AC85C1.7060600@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/signal.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index dde3f2ae2371..d2cc6428c587 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -240,11 +240,10 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size, | |||
240 | 240 | ||
241 | if (used_math()) { | 241 | if (used_math()) { |
242 | sp -= sig_xstate_size; | 242 | sp -= sig_xstate_size; |
243 | #ifdef CONFIG_X86_32 | 243 | #ifdef CONFIG_X86_64 |
244 | *fpstate = (void __user *) sp; | 244 | sp = round_down(sp, 64); |
245 | #else /* !CONFIG_X86_32 */ | 245 | #endif /* CONFIG_X86_64 */ |
246 | *fpstate = (void __user *)round_down(sp, 64); | 246 | *fpstate = (void __user *)sp; |
247 | #endif /* CONFIG_X86_32 */ | ||
248 | 247 | ||
249 | if (save_i387_xstate(*fpstate) < 0) | 248 | if (save_i387_xstate(*fpstate) < 0) |
250 | return (void __user *)-1L; | 249 | return (void __user *)-1L; |