Skip to content

Commit 593bde4

Browse files
committed
Merge tag 'parisc-for-6.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc fix from Helge Deller: "Fix a double SIGFPE crash" * tag 'parisc-for-6.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix double SIGFPE crash
2 parents 081bc61 + de3629b commit 593bde4

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

arch/parisc/math-emu/driver.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,19 @@ handle_fpe(struct pt_regs *regs)
9797

9898
memcpy(regs->fr, frcopy, sizeof regs->fr);
9999
if (signalcode != 0) {
100-
force_sig_fault(signalcode >> 24, signalcode & 0xffffff,
101-
(void __user *) regs->iaoq[0]);
102-
return -1;
100+
int sig = signalcode >> 24;
101+
102+
if (sig == SIGFPE) {
103+
/*
104+
* Clear floating point trap bit to avoid trapping
105+
* again on the first floating-point instruction in
106+
* the userspace signal handler.
107+
*/
108+
regs->fr[0] &= ~(1ULL << 38);
109+
}
110+
force_sig_fault(sig, signalcode & 0xffffff,
111+
(void __user *) regs->iaoq[0]);
112+
return -1;
103113
}
104114

105115
return signalcode ? -1 : 0;

0 commit comments

Comments
 (0)