Skip to content

Commit

Permalink
Merge tag 'parisc-for-6.15-rc5' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed May 4, 2025
2 parents 081bc61 + de3629b commit 593bde4
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions arch/parisc/math-emu/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,19 @@ handle_fpe(struct pt_regs *regs)

memcpy(regs->fr, frcopy, sizeof regs->fr);
if (signalcode != 0) {
force_sig_fault(signalcode >> 24, signalcode & 0xffffff,
(void __user *) regs->iaoq[0]);
return -1;
int sig = signalcode >> 24;

if (sig == SIGFPE) {
/*
* Clear floating point trap bit to avoid trapping
* again on the first floating-point instruction in
* the userspace signal handler.
*/
regs->fr[0] &= ~(1ULL << 38);
}
force_sig_fault(sig, signalcode & 0xffffff,
(void __user *) regs->iaoq[0]);
return -1;
}

return signalcode ? -1 : 0;
Expand Down

0 comments on commit 593bde4

Please sign in to comment.