Skip to content

Commit ed1e7db

Browse files
0x7f454c46Ingo Molnar
authored andcommitted
x86/signal: Remove bogus user_64bit_mode() check from sigaction_compat_abi()
The recent introduction of SA_X32/IA32 sa_flags added a check for user_64bit_mode() into sigaction_compat_abi(). user_64bit_mode() is true for native 64-bit processes and x32 processes. Due to that the function returns w/o setting the SA_X32_ABI flag for X32 processes. In consequence the kernel attempts to deliver the signal to the X32 process in native 64-bit mode causing the process to segfault. Remove the check, so the actual check for X32 mode which sets the ABI flag can be reached. There is no side effect for native 64-bit mode. [ tglx: Rewrote changelog ] Fixes: 6846351 ("x86/signal: Add SA_{X32,IA32}_ABI sa_flags") Reported-by: Mikulas Patocka <[email protected]> Tested-by: Adam Borowski <[email protected]> Signed-off-by: Dmitry Safonov <[email protected]> Cc: Dmitry Safonov <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: [email protected] Cc: Cyrill Gorcunov <[email protected]> Cc: Pavel Emelyanov <[email protected]> Link: http://lkml.kernel.org/r/CAJwJo6Z8ZWPqNfT6t-i8GW1MKxQrKDUagQqnZ%2B0%2B697%[email protected] Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent caef78b commit ed1e7db

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

arch/x86/kernel/signal_compat.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact)
105105
/* Don't let flags to be set from userspace */
106106
act->sa.sa_flags &= ~(SA_IA32_ABI | SA_X32_ABI);
107107

108-
if (user_64bit_mode(current_pt_regs()))
109-
return;
110-
111108
if (in_ia32_syscall())
112109
act->sa.sa_flags |= SA_IA32_ABI;
113110
if (in_x32_syscall())

0 commit comments

Comments
 (0)