diff options
author | Stafford Horne <shorne@gmail.com> | 2023-06-28 18:54:40 +0200 |
---|---|---|
committer | Stafford Horne <shorne@gmail.com> | 2023-07-10 23:03:26 +0200 |
commit | dceaafd668812115037fc13a1893d068b7b880f5 (patch) | |
tree | c86ff80abbd5c25188a044278116f4f66e600937 /arch/openrisc/include | |
parent | Linux 6.4-rc7 (diff) | |
download | linux-dceaafd668812115037fc13a1893d068b7b880f5.tar.xz linux-dceaafd668812115037fc13a1893d068b7b880f5.zip |
openrisc: Union fpcsr and oldmask in sigcontext to unbreak userspace ABI
With commit 27267655c531 ("openrisc: Support floating point user api") I
added an entry to the struct sigcontext which caused an unwanted change
to the userspace ABI.
To fix this we use the previously unused oldmask field space for the
floating point fpcsr state. We do this with a union to restore the ABI
back to the pre kernel v6.4 ABI and keep API compatibility.
This does mean if there is some code somewhere that is setting oldmask
in an OpenRISC specific userspace sighandler it would end up setting the
floating point register status, but I think it's unlikely as oldmask was
never functional before.
Fixes: 27267655c531 ("openrisc: Support floating point user api")
Reported-by: Szabolcs Nagy <nsz@port70.net>
Closes: https://lore.kernel.org/openrisc/20230626213840.GA1236108@port70.net/
Signed-off-by: Stafford Horne <shorne@gmail.com>
Diffstat (limited to 'arch/openrisc/include')
-rw-r--r-- | arch/openrisc/include/uapi/asm/sigcontext.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/openrisc/include/uapi/asm/sigcontext.h b/arch/openrisc/include/uapi/asm/sigcontext.h index ca585e4af6b8..e7ffb58ff58f 100644 --- a/arch/openrisc/include/uapi/asm/sigcontext.h +++ b/arch/openrisc/include/uapi/asm/sigcontext.h @@ -28,8 +28,10 @@ struct sigcontext { struct user_regs_struct regs; /* needs to be first */ - struct __or1k_fpu_state fpu; - unsigned long oldmask; + union { + unsigned long fpcsr; + unsigned long oldmask; /* unused */ + }; }; #endif /* __ASM_OPENRISC_SIGCONTEXT_H */ |