Skip to content

Commit 79df39d

Browse files
committed
Revert "parisc: Reduce sigreturn trampoline to 3 instructions"
This reverts commit e4f2006. This patch shows problems with signal handling. Revert it for now. Signed-off-by: Helge Deller <deller@gmx.de> Cc: <stable@vger.kernel.org> # v5.15
1 parent 4017b23 commit 79df39d

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

arch/parisc/include/asm/rt_sigframe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef _ASM_PARISC_RT_SIGFRAME_H
33
#define _ASM_PARISC_RT_SIGFRAME_H
44

5-
#define SIGRETURN_TRAMP 3
5+
#define SIGRETURN_TRAMP 4
66
#define SIGRESTARTBLOCK_TRAMP 5
77
#define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP)
88

arch/parisc/kernel/signal.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,21 +288,22 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs,
288288
already in userspace. The first words of tramp are used to
289289
save the previous sigrestartblock trampoline that might be
290290
on the stack. We start the sigreturn trampoline at
291-
SIGRESTARTBLOCK_TRAMP. */
291+
SIGRESTARTBLOCK_TRAMP+X. */
292292
err |= __put_user(in_syscall ? INSN_LDI_R25_1 : INSN_LDI_R25_0,
293293
&frame->tramp[SIGRESTARTBLOCK_TRAMP+0]);
294-
err |= __put_user(INSN_BLE_SR2_R0,
294+
err |= __put_user(INSN_LDI_R20,
295295
&frame->tramp[SIGRESTARTBLOCK_TRAMP+1]);
296-
err |= __put_user(INSN_LDI_R20,
296+
err |= __put_user(INSN_BLE_SR2_R0,
297297
&frame->tramp[SIGRESTARTBLOCK_TRAMP+2]);
298+
err |= __put_user(INSN_NOP, &frame->tramp[SIGRESTARTBLOCK_TRAMP+3]);
298299

299-
start = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP+0];
300-
end = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP+3];
300+
start = (unsigned long) &frame->tramp[0];
301+
end = (unsigned long) &frame->tramp[TRAMP_SIZE];
301302
flush_user_dcache_range_asm(start, end);
302303
flush_user_icache_range_asm(start, end);
303304

304305
/* TRAMP Words 0-4, Length 5 = SIGRESTARTBLOCK_TRAMP
305-
* TRAMP Words 5-7, Length 3 = SIGRETURN_TRAMP
306+
* TRAMP Words 5-9, Length 4 = SIGRETURN_TRAMP
306307
* So the SIGRETURN_TRAMP is at the end of SIGRESTARTBLOCK_TRAMP
307308
*/
308309
rp = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP];

arch/parisc/kernel/signal32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct compat_regfile {
3636
compat_int_t rf_sar;
3737
};
3838

39-
#define COMPAT_SIGRETURN_TRAMP 3
39+
#define COMPAT_SIGRETURN_TRAMP 4
4040
#define COMPAT_SIGRESTARTBLOCK_TRAMP 5
4141
#define COMPAT_TRAMP_SIZE (COMPAT_SIGRETURN_TRAMP + \
4242
COMPAT_SIGRESTARTBLOCK_TRAMP)

0 commit comments

Comments
 (0)