Skip to content

Commit 0099852

Browse files
committed
Merge tag 'for-linus' of https://github.com/openrisc/linux
Pull OpenRISC fix from Stafford Horne: - During the 6.4 cycle my fpu support work broke ABI compatibility in the sigcontext struct. This was noticed by musl libc developers after the release. This fix restores the ABI. * tag 'for-linus' of https://github.com/openrisc/linux: openrisc: Union fpcsr and oldmask in sigcontext to unbreak userspace ABI
2 parents eb26cbb + dceaafd commit 0099852

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

arch/openrisc/include/uapi/asm/sigcontext.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828

2929
struct sigcontext {
3030
struct user_regs_struct regs; /* needs to be first */
31-
struct __or1k_fpu_state fpu;
32-
unsigned long oldmask;
31+
union {
32+
unsigned long fpcsr;
33+
unsigned long oldmask; /* unused */
34+
};
3335
};
3436

3537
#endif /* __ASM_OPENRISC_SIGCONTEXT_H */

arch/openrisc/kernel/signal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static int restore_sigcontext(struct pt_regs *regs,
5050
err |= __copy_from_user(regs, sc->regs.gpr, 32 * sizeof(unsigned long));
5151
err |= __copy_from_user(&regs->pc, &sc->regs.pc, sizeof(unsigned long));
5252
err |= __copy_from_user(&regs->sr, &sc->regs.sr, sizeof(unsigned long));
53-
err |= __copy_from_user(&regs->fpcsr, &sc->fpu.fpcsr, sizeof(unsigned long));
53+
err |= __copy_from_user(&regs->fpcsr, &sc->fpcsr, sizeof(unsigned long));
5454

5555
/* make sure the SM-bit is cleared so user-mode cannot fool us */
5656
regs->sr &= ~SPR_SR_SM;
@@ -113,7 +113,7 @@ static int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
113113
err |= __copy_to_user(sc->regs.gpr, regs, 32 * sizeof(unsigned long));
114114
err |= __copy_to_user(&sc->regs.pc, &regs->pc, sizeof(unsigned long));
115115
err |= __copy_to_user(&sc->regs.sr, &regs->sr, sizeof(unsigned long));
116-
err |= __copy_to_user(&sc->fpu.fpcsr, &regs->fpcsr, sizeof(unsigned long));
116+
err |= __copy_to_user(&sc->fpcsr, &regs->fpcsr, sizeof(unsigned long));
117117

118118
return err;
119119
}

0 commit comments

Comments
 (0)