All of lore.kernel.org
 help / color / mirror / Atom feed
* x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
@ 2016-10-19 17:19 ` Mikulas Patocka
  0 siblings, 0 replies; 17+ messages in thread
From: Mikulas Patocka @ 2016-10-19 17:19 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: 0x7f454c46, oleg, linux-mm, gorcunov, xemul, Thomas Gleixner,
	linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 995 bytes --]

Hi

In the kernel 4.9-rc1, the x32 support is seriously broken, a x32 process 
is killed with SIGKILL after returning from any signal handler.

I use Debian sid x64-64 distribution with x32 architecture added from 
debian-ports.

I bisected the bug and found out that it is caused by the patch 
6846351052e685c2d1428e80ead2d7ca3d7ed913 ("x86/signal: Add 
SA_{X32,IA32}_ABI sa_flags").

example (strace of a process after receiving the SIGWINCH signal):

epoll_wait(10, 0xef6890, 32, -1)        = -1 EINTR (Interrupted system call)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1772, si_uid=0} ---
poll([{fd=4, events=POLLOUT}], 1, 0)    = 1 ([{fd=4, revents=POLLOUT}])
write(4, "\0", 1)                       = 1
rt_sigreturn({mask=[INT QUIT ILL TRAP BUS KILL SEGV USR2 PIPE ALRM STKFLT TSTP TTOU URG XCPU XFSZ VTALRM IO PWR SYS RTMIN]}) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
+++ killed by SIGSEGV +++
Neoprávnìný pøístup do pamìti (SIGSEGV)

Mikulas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
@ 2016-10-19 17:19 ` Mikulas Patocka
  0 siblings, 0 replies; 17+ messages in thread
From: Mikulas Patocka @ 2016-10-19 17:19 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: 0x7f454c46, oleg, linux-mm, gorcunov, xemul, Thomas Gleixner,
	linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 995 bytes --]

Hi

In the kernel 4.9-rc1, the x32 support is seriously broken, a x32 process 
is killed with SIGKILL after returning from any signal handler.

I use Debian sid x64-64 distribution with x32 architecture added from 
debian-ports.

I bisected the bug and found out that it is caused by the patch 
6846351052e685c2d1428e80ead2d7ca3d7ed913 ("x86/signal: Add 
SA_{X32,IA32}_ABI sa_flags").

example (strace of a process after receiving the SIGWINCH signal):

epoll_wait(10, 0xef6890, 32, -1)        = -1 EINTR (Interrupted system call)
--- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1772, si_uid=0} ---
poll([{fd=4, events=POLLOUT}], 1, 0)    = 1 ([{fd=4, revents=POLLOUT}])
write(4, "\0", 1)                       = 1
rt_sigreturn({mask=[INT QUIT ILL TRAP BUS KILL SEGV USR2 PIPE ALRM STKFLT TSTP TTOU URG XCPU XFSZ VTALRM IO PWR SYS RTMIN]}) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
+++ killed by SIGSEGV +++
Neopravniny poistup do pamiti (SIGSEGV)

Mikulas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
  2016-10-19 17:19 ` Mikulas Patocka
@ 2016-10-19 17:33   ` Mikulas Patocka
  -1 siblings, 0 replies; 17+ messages in thread
From: Mikulas Patocka @ 2016-10-19 17:33 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: 0x7f454c46, oleg, linux-mm, gorcunov, xemul, Thomas Gleixner,
	linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1846 bytes --]



On Wed, 19 Oct 2016, Mikulas Patocka wrote:

> Hi
> 
> In the kernel 4.9-rc1, the x32 support is seriously broken, a x32 process 
> is killed with SIGKILL after returning from any signal handler.

I should have said they are killed with SIGSEGV, not SIGKILL.

> I use Debian sid x64-64 distribution with x32 architecture added from 
> debian-ports.
> 
> I bisected the bug and found out that it is caused by the patch 
> 6846351052e685c2d1428e80ead2d7ca3d7ed913 ("x86/signal: Add 
> SA_{X32,IA32}_ABI sa_flags").
> 
> example (strace of a process after receiving the SIGWINCH signal):
> 
> epoll_wait(10, 0xef6890, 32, -1)        = -1 EINTR (Interrupted system call)
> --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1772, si_uid=0} ---
> poll([{fd=4, events=POLLOUT}], 1, 0)    = 1 ([{fd=4, revents=POLLOUT}])
> write(4, "\0", 1)                       = 1
> rt_sigreturn({mask=[INT QUIT ILL TRAP BUS KILL SEGV USR2 PIPE ALRM STKFLT TSTP TTOU URG XCPU XFSZ VTALRM IO PWR SYS RTMIN]}) = 0
> --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
> +++ killed by SIGSEGV +++
> Neoprávnìný pøístup do pamìti (SIGSEGV)
> 
> Mikulas

BTW. when I take core dump of the killed x32 process, it shows:

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              CORE (Core file)
  Machine:                           Intel 80386
				^^^^^^^^^^^^^^^^^^^

So, the kernel somehow thinks that it is i386 process, not x32 process. A 
core dump of a real x32 process shows "Class: ELF32, Machine: Advanced 
Micro Devices X86-64".

Mikulas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
@ 2016-10-19 17:33   ` Mikulas Patocka
  0 siblings, 0 replies; 17+ messages in thread
From: Mikulas Patocka @ 2016-10-19 17:33 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: 0x7f454c46, oleg, linux-mm, gorcunov, xemul, Thomas Gleixner,
	linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1846 bytes --]



On Wed, 19 Oct 2016, Mikulas Patocka wrote:

> Hi
> 
> In the kernel 4.9-rc1, the x32 support is seriously broken, a x32 process 
> is killed with SIGKILL after returning from any signal handler.

I should have said they are killed with SIGSEGV, not SIGKILL.

> I use Debian sid x64-64 distribution with x32 architecture added from 
> debian-ports.
> 
> I bisected the bug and found out that it is caused by the patch 
> 6846351052e685c2d1428e80ead2d7ca3d7ed913 ("x86/signal: Add 
> SA_{X32,IA32}_ABI sa_flags").
> 
> example (strace of a process after receiving the SIGWINCH signal):
> 
> epoll_wait(10, 0xef6890, 32, -1)        = -1 EINTR (Interrupted system call)
> --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1772, si_uid=0} ---
> poll([{fd=4, events=POLLOUT}], 1, 0)    = 1 ([{fd=4, revents=POLLOUT}])
> write(4, "\0", 1)                       = 1
> rt_sigreturn({mask=[INT QUIT ILL TRAP BUS KILL SEGV USR2 PIPE ALRM STKFLT TSTP TTOU URG XCPU XFSZ VTALRM IO PWR SYS RTMIN]}) = 0
> --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
> +++ killed by SIGSEGV +++
> Neopravniny poistup do pamiti (SIGSEGV)
> 
> Mikulas

BTW. when I take core dump of the killed x32 process, it shows:

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              CORE (Core file)
  Machine:                           Intel 80386
				^^^^^^^^^^^^^^^^^^^

So, the kernel somehow thinks that it is i386 process, not x32 process. A 
core dump of a real x32 process shows "Class: ELF32, Machine: Advanced 
Micro Devices X86-64".

Mikulas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
  2016-10-19 17:33   ` Mikulas Patocka
@ 2016-10-19 17:45     ` Dmitry Safonov
  -1 siblings, 0 replies; 17+ messages in thread
From: Dmitry Safonov @ 2016-10-19 17:45 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: Dmitry Safonov, Oleg Nesterov, linux-mm, Cyrill Gorcunov,
	Pavel Emelyanov, Thomas Gleixner, open list

2016-10-19 20:33 GMT+03:00 Mikulas Patocka <mpatocka@redhat.com>:
>
>
> On Wed, 19 Oct 2016, Mikulas Patocka wrote:
>
>> Hi
>>
>> In the kernel 4.9-rc1, the x32 support is seriously broken, a x32 process
>> is killed with SIGKILL after returning from any signal handler.
>
> I should have said they are killed with SIGSEGV, not SIGKILL.
>
>> I use Debian sid x64-64 distribution with x32 architecture added from
>> debian-ports.
>>
>> I bisected the bug and found out that it is caused by the patch
>> 6846351052e685c2d1428e80ead2d7ca3d7ed913 ("x86/signal: Add
>> SA_{X32,IA32}_ABI sa_flags").
>>
>> example (strace of a process after receiving the SIGWINCH signal):
>>
>> epoll_wait(10, 0xef6890, 32, -1)        = -1 EINTR (Interrupted system call)
>> --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1772, si_uid=0} ---
>> poll([{fd=4, events=POLLOUT}], 1, 0)    = 1 ([{fd=4, revents=POLLOUT}])
>> write(4, "\0", 1)                       = 1
>> rt_sigreturn({mask=[INT QUIT ILL TRAP BUS KILL SEGV USR2 PIPE ALRM STKFLT TSTP TTOU URG XCPU XFSZ VTALRM IO PWR SYS RTMIN]}) = 0
>> --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
>> +++ killed by SIGSEGV +++
>> Neoprávnìný pøístup do pamìti (SIGSEGV)
>>
>> Mikulas
>
> BTW. when I take core dump of the killed x32 process, it shows:
>
> ELF Header:
>   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
>   Class:                             ELF32
>   Data:                              2's complement, little endian
>   Version:                           1 (current)
>   OS/ABI:                            UNIX - System V
>   ABI Version:                       0
>   Type:                              CORE (Core file)
>   Machine:                           Intel 80386
>                                 ^^^^^^^^^^^^^^^^^^^
>
> So, the kernel somehow thinks that it is i386 process, not x32 process. A
> core dump of a real x32 process shows "Class: ELF32, Machine: Advanced
> Micro Devices X86-64".

Thanks for catching, will check it today.

-- 
             Dmitry

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
@ 2016-10-19 17:45     ` Dmitry Safonov
  0 siblings, 0 replies; 17+ messages in thread
From: Dmitry Safonov @ 2016-10-19 17:45 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: Dmitry Safonov, Oleg Nesterov, linux-mm, Cyrill Gorcunov,
	Pavel Emelyanov, Thomas Gleixner, open list

2016-10-19 20:33 GMT+03:00 Mikulas Patocka <mpatocka@redhat.com>:
>
>
> On Wed, 19 Oct 2016, Mikulas Patocka wrote:
>
>> Hi
>>
>> In the kernel 4.9-rc1, the x32 support is seriously broken, a x32 process
>> is killed with SIGKILL after returning from any signal handler.
>
> I should have said they are killed with SIGSEGV, not SIGKILL.
>
>> I use Debian sid x64-64 distribution with x32 architecture added from
>> debian-ports.
>>
>> I bisected the bug and found out that it is caused by the patch
>> 6846351052e685c2d1428e80ead2d7ca3d7ed913 ("x86/signal: Add
>> SA_{X32,IA32}_ABI sa_flags").
>>
>> example (strace of a process after receiving the SIGWINCH signal):
>>
>> epoll_wait(10, 0xef6890, 32, -1)        = -1 EINTR (Interrupted system call)
>> --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1772, si_uid=0} ---
>> poll([{fd=4, events=POLLOUT}], 1, 0)    = 1 ([{fd=4, revents=POLLOUT}])
>> write(4, "\0", 1)                       = 1
>> rt_sigreturn({mask=[INT QUIT ILL TRAP BUS KILL SEGV USR2 PIPE ALRM STKFLT TSTP TTOU URG XCPU XFSZ VTALRM IO PWR SYS RTMIN]}) = 0
>> --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
>> +++ killed by SIGSEGV +++
>> Neoprávnìný pøístup do pamìti (SIGSEGV)
>>
>> Mikulas
>
> BTW. when I take core dump of the killed x32 process, it shows:
>
> ELF Header:
>   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
>   Class:                             ELF32
>   Data:                              2's complement, little endian
>   Version:                           1 (current)
>   OS/ABI:                            UNIX - System V
>   ABI Version:                       0
>   Type:                              CORE (Core file)
>   Machine:                           Intel 80386
>                                 ^^^^^^^^^^^^^^^^^^^
>
> So, the kernel somehow thinks that it is i386 process, not x32 process. A
> core dump of a real x32 process shows "Class: ELF32, Machine: Advanced
> Micro Devices X86-64".

Thanks for catching, will check it today.

-- 
             Dmitry

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
  2016-10-19 17:33   ` Mikulas Patocka
  (?)
  (?)
@ 2016-10-19 22:02   ` Dmitry Safonov
  2016-10-20  3:13       ` Adam Borowski
                       ` (4 more replies)
  -1 siblings, 5 replies; 17+ messages in thread
From: Dmitry Safonov @ 2016-10-19 22:02 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: Dmitry Safonov, Oleg Nesterov, linux-mm, Cyrill Gorcunov,
	Pavel Emelyanov, Thomas Gleixner, open list

[-- Attachment #1: Type: text/plain, Size: 2254 bytes --]

2016-10-19 20:33 GMT+03:00 Mikulas Patocka <mpatocka@redhat.com>:
>
>
> On Wed, 19 Oct 2016, Mikulas Patocka wrote:
>
>> Hi
>>
>> In the kernel 4.9-rc1, the x32 support is seriously broken, a x32 process
>> is killed with SIGKILL after returning from any signal handler.
>
> I should have said they are killed with SIGSEGV, not SIGKILL.
>
>> I use Debian sid x64-64 distribution with x32 architecture added from
>> debian-ports.
>>
>> I bisected the bug and found out that it is caused by the patch
>> 6846351052e685c2d1428e80ead2d7ca3d7ed913 ("x86/signal: Add
>> SA_{X32,IA32}_ABI sa_flags").
>>
>> example (strace of a process after receiving the SIGWINCH signal):
>>
>> epoll_wait(10, 0xef6890, 32, -1)        = -1 EINTR (Interrupted system call)
>> --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1772, si_uid=0} ---
>> poll([{fd=4, events=POLLOUT}], 1, 0)    = 1 ([{fd=4, revents=POLLOUT}])
>> write(4, "\0", 1)                       = 1
>> rt_sigreturn({mask=[INT QUIT ILL TRAP BUS KILL SEGV USR2 PIPE ALRM STKFLT TSTP TTOU URG XCPU XFSZ VTALRM IO PWR SYS RTMIN]}) = 0
>> --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
>> +++ killed by SIGSEGV +++
>> Neoprávnìný pøístup do pamìti (SIGSEGV)
>>
>> Mikulas
>
> BTW. when I take core dump of the killed x32 process, it shows:
>
> ELF Header:
>   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
>   Class:                             ELF32
>   Data:                              2's complement, little endian
>   Version:                           1 (current)
>   OS/ABI:                            UNIX - System V
>   ABI Version:                       0
>   Type:                              CORE (Core file)
>   Machine:                           Intel 80386
>                                 ^^^^^^^^^^^^^^^^^^^
>
> So, the kernel somehow thinks that it is i386 process, not x32 process. A
> core dump of a real x32 process shows "Class: ELF32, Machine: Advanced
> Micro Devices X86-64".

Hi Mikulas,

could you give attached patch a shot?
In about 10 hours I'll be at work and will have debian-x32 install,
but for now, I can't test it.
Thanks again on catching that.

-- 
             Dmitry

[-- Attachment #2: 0001-x86-signal-set-SA_X32_ABI-flag-for-x32-programs.patch --]
[-- Type: text/x-patch, Size: 1139 bytes --]

From a546f8da1d12676fe79c746d859eb1e17aa4c331 Mon Sep 17 00:00:00 2001
From: Dmitry Safonov <0x7f454c46@gmail.com>
Date: Thu, 20 Oct 2016 00:53:08 +0300
Subject: [PATCH] x86/signal: set SA_X32_ABI flag for x32 programs

For x32 programs cs register is __USER_CS, so it returns here
unconditionally - remove this check completely here.

Fixes: commit 6846351052e6 ("x86/signal: Add SA_{X32,IA32}_ABI sa_flags")

Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
---
 arch/x86/kernel/signal_compat.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/kernel/signal_compat.c b/arch/x86/kernel/signal_compat.c
index 40df33753bae..ec1f756f9dc9 100644
--- a/arch/x86/kernel/signal_compat.c
+++ b/arch/x86/kernel/signal_compat.c
@@ -105,9 +105,6 @@ void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact)
 	/* Don't let flags to be set from userspace */
 	act->sa.sa_flags &= ~(SA_IA32_ABI | SA_X32_ABI);
 
-	if (user_64bit_mode(current_pt_regs()))
-		return;
-
 	if (in_ia32_syscall())
 		act->sa.sa_flags |= SA_IA32_ABI;
 	if (in_x32_syscall())
-- 
2.10.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
  2016-10-19 22:02   ` Dmitry Safonov
@ 2016-10-20  3:13       ` Adam Borowski
  2016-10-20  9:21     ` [tip:x86/urgent] x86/signal: Remove bogus user_64bit_mode() check from sigaction_compat_abi() tip-bot for Dmitry Safonov
                         ` (3 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Adam Borowski @ 2016-10-20  3:13 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: Mikulas Patocka, Dmitry Safonov, Oleg Nesterov, linux-mm,
	Cyrill Gorcunov, Pavel Emelyanov, Thomas Gleixner, open list

On Thu, Oct 20, 2016 at 01:02:59AM +0300, Dmitry Safonov wrote:
> 2016-10-19 20:33 GMT+03:00 Mikulas Patocka <mpatocka@redhat.com>:
> > On Wed, 19 Oct 2016, Mikulas Patocka wrote:
> >> In the kernel 4.9-rc1, the x32 support is seriously broken, a x32 process
> >> is killed with SIGKILL after returning from any signal handler.
> >
> > I should have said they are killed with SIGSEGV, not SIGKILL.
> >
> >> I use Debian sid x64-64 distribution with x32 architecture added from
> >> debian-ports.
> >>
> >> I bisected the bug and found out that it is caused by the patch
> >> 6846351052e685c2d1428e80ead2d7ca3d7ed913 ("x86/signal: Add
> >> SA_{X32,IA32}_ABI sa_flags").
> >
> > So, the kernel somehow thinks that it is i386 process, not x32 process. A
> > core dump of a real x32 process shows "Class: ELF32, Machine: Advanced
> > Micro Devices X86-64".
> 
> could you give attached patch a shot?
> In about 10 hours I'll be at work and will have debian-x32 install,
> but for now, I can't test it.
> Thanks again on catching that.
> 

> From a546f8da1d12676fe79c746d859eb1e17aa4c331 Mon Sep 17 00:00:00 2001
> From: Dmitry Safonov <0x7f454c46@gmail.com>
> Date: Thu, 20 Oct 2016 00:53:08 +0300
> Subject: [PATCH] x86/signal: set SA_X32_ABI flag for x32 programs
> 
> For x32 programs cs register is __USER_CS, so it returns here
> unconditionally - remove this check completely here.
> 
> Fixes: commit 6846351052e6 ("x86/signal: Add SA_{X32,IA32}_ABI sa_flags")
> 
> Reported-by: Mikulas Patocka <mpatocka@redhat.com>
> Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
> ---
>  arch/x86/kernel/signal_compat.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/arch/x86/kernel/signal_compat.c b/arch/x86/kernel/signal_compat.c
> index 40df33753bae..ec1f756f9dc9 100644
> --- a/arch/x86/kernel/signal_compat.c
> +++ b/arch/x86/kernel/signal_compat.c
> @@ -105,9 +105,6 @@ void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact)
>  	/* Don't let flags to be set from userspace */
>  	act->sa.sa_flags &= ~(SA_IA32_ABI | SA_X32_ABI);
>  
> -	if (user_64bit_mode(current_pt_regs()))
> -		return;
> -
>  	if (in_ia32_syscall())
>  		act->sa.sa_flags |= SA_IA32_ABI;
>  	if (in_x32_syscall())
> -- 
> 2.10.0

Works for me.  Tested on general operation, a few by-hand checks and several
random package builds.

It'd be nice to check glibc's testsuite as well as it had recent regressions
caused by kernel changes on x32 (like https://bugs.debian.org/841240) but as
gcc-6 in sid is broken right now (fails to build kernel, glibc:amd64, etc),
I didn't bother that much.

Tested-by: Adam Borowski <kilobyte@angband.pl>

-- 
A MAP07 (Dead Simple) raspberry tincture recipe: 0.5l 95% alcohol, 1kg
raspberries, 0.4kg sugar; put into a big jar for 1 month.  Filter out and
throw away the fruits (can dump them into a cake, etc), let the drink age
at least 3-6 months.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
@ 2016-10-20  3:13       ` Adam Borowski
  0 siblings, 0 replies; 17+ messages in thread
From: Adam Borowski @ 2016-10-20  3:13 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: Mikulas Patocka, Dmitry Safonov, Oleg Nesterov, linux-mm,
	Cyrill Gorcunov, Pavel Emelyanov, Thomas Gleixner, open list

On Thu, Oct 20, 2016 at 01:02:59AM +0300, Dmitry Safonov wrote:
> 2016-10-19 20:33 GMT+03:00 Mikulas Patocka <mpatocka@redhat.com>:
> > On Wed, 19 Oct 2016, Mikulas Patocka wrote:
> >> In the kernel 4.9-rc1, the x32 support is seriously broken, a x32 process
> >> is killed with SIGKILL after returning from any signal handler.
> >
> > I should have said they are killed with SIGSEGV, not SIGKILL.
> >
> >> I use Debian sid x64-64 distribution with x32 architecture added from
> >> debian-ports.
> >>
> >> I bisected the bug and found out that it is caused by the patch
> >> 6846351052e685c2d1428e80ead2d7ca3d7ed913 ("x86/signal: Add
> >> SA_{X32,IA32}_ABI sa_flags").
> >
> > So, the kernel somehow thinks that it is i386 process, not x32 process. A
> > core dump of a real x32 process shows "Class: ELF32, Machine: Advanced
> > Micro Devices X86-64".
> 
> could you give attached patch a shot?
> In about 10 hours I'll be at work and will have debian-x32 install,
> but for now, I can't test it.
> Thanks again on catching that.
> 

> From a546f8da1d12676fe79c746d859eb1e17aa4c331 Mon Sep 17 00:00:00 2001
> From: Dmitry Safonov <0x7f454c46@gmail.com>
> Date: Thu, 20 Oct 2016 00:53:08 +0300
> Subject: [PATCH] x86/signal: set SA_X32_ABI flag for x32 programs
> 
> For x32 programs cs register is __USER_CS, so it returns here
> unconditionally - remove this check completely here.
> 
> Fixes: commit 6846351052e6 ("x86/signal: Add SA_{X32,IA32}_ABI sa_flags")
> 
> Reported-by: Mikulas Patocka <mpatocka@redhat.com>
> Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
> ---
>  arch/x86/kernel/signal_compat.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/arch/x86/kernel/signal_compat.c b/arch/x86/kernel/signal_compat.c
> index 40df33753bae..ec1f756f9dc9 100644
> --- a/arch/x86/kernel/signal_compat.c
> +++ b/arch/x86/kernel/signal_compat.c
> @@ -105,9 +105,6 @@ void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact)
>  	/* Don't let flags to be set from userspace */
>  	act->sa.sa_flags &= ~(SA_IA32_ABI | SA_X32_ABI);
>  
> -	if (user_64bit_mode(current_pt_regs()))
> -		return;
> -
>  	if (in_ia32_syscall())
>  		act->sa.sa_flags |= SA_IA32_ABI;
>  	if (in_x32_syscall())
> -- 
> 2.10.0

Works for me.  Tested on general operation, a few by-hand checks and several
random package builds.

It'd be nice to check glibc's testsuite as well as it had recent regressions
caused by kernel changes on x32 (like https://bugs.debian.org/841240) but as
gcc-6 in sid is broken right now (fails to build kernel, glibc:amd64, etc),
I didn't bother that much.

Tested-by: Adam Borowski <kilobyte@angband.pl>

-- 
A MAP07 (Dead Simple) raspberry tincture recipe: 0.5l 95% alcohol, 1kg
raspberries, 0.4kg sugar; put into a big jar for 1 month.  Filter out and
throw away the fruits (can dump them into a cake, etc), let the drink age
at least 3-6 months.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [tip:x86/urgent] x86/signal: Remove bogus user_64bit_mode() check from sigaction_compat_abi()
  2016-10-19 22:02   ` Dmitry Safonov
  2016-10-20  3:13       ` Adam Borowski
@ 2016-10-20  9:21     ` tip-bot for Dmitry Safonov
  2016-10-20  9:24       ` Thomas Gleixner
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: tip-bot for Dmitry Safonov @ 2016-10-20  9:21 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: dsafonov, mpatocka, xemul, gorcunov, hpa, mingo, tglx,
	0x7f454c46, oleg, linux-kernel, kilobyte

Commit-ID:  3b68db0c1f80c763213f07db60b4feda186345f5
Gitweb:     http://git.kernel.org/tip/3b68db0c1f80c763213f07db60b4feda186345f5
Author:     Dmitry Safonov <0x7f454c46@gmail.com>
AuthorDate: Thu, 20 Oct 2016 00:53:08 +0300
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 20 Oct 2016 11:17:12 +0200

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 64bit 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 64bit 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 64bit mode.

[ tglx: Rewrote changelog ]

Fixes: 6846351052e6 ("x86/signal: Add SA_{X32,IA32}_ABI sa_flags")
Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Tested-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: linux-mm@kvack.org
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Link: http://lkml.kernel.org/r/CAJwJo6Z8ZWPqNfT6t-i8GW1MKxQrKDUagQqnZ%2B0%2B697%3DMyVeGg@mail.gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/signal_compat.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/kernel/signal_compat.c b/arch/x86/kernel/signal_compat.c
index 40df337..ec1f756 100644
--- a/arch/x86/kernel/signal_compat.c
+++ b/arch/x86/kernel/signal_compat.c
@@ -105,9 +105,6 @@ void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact)
 	/* Don't let flags to be set from userspace */
 	act->sa.sa_flags &= ~(SA_IA32_ABI | SA_X32_ABI);
 
-	if (user_64bit_mode(current_pt_regs()))
-		return;
-
 	if (in_ia32_syscall())
 		act->sa.sa_flags |= SA_IA32_ABI;
 	if (in_x32_syscall())

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
  2016-10-19 22:02   ` Dmitry Safonov
@ 2016-10-20  9:24       ` Thomas Gleixner
  2016-10-20  9:21     ` [tip:x86/urgent] x86/signal: Remove bogus user_64bit_mode() check from sigaction_compat_abi() tip-bot for Dmitry Safonov
                         ` (3 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Thomas Gleixner @ 2016-10-20  9:24 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: Mikulas Patocka, Dmitry Safonov, Oleg Nesterov, linux-mm,
	Cyrill Gorcunov, Pavel Emelyanov, open list

On Thu, 20 Oct 2016, Dmitry Safonov wrote:
> could you give attached patch a shot?

Can you please stop sending attached patches? It's a pain to look at them
and it makes it hard to reply inline.

I applied it and rewrote the changelog because the one liner you slapped
into it is more than useless. Ditto for the completely misleading subject
line. Please be more careful with that. 

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
@ 2016-10-20  9:24       ` Thomas Gleixner
  0 siblings, 0 replies; 17+ messages in thread
From: Thomas Gleixner @ 2016-10-20  9:24 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: Mikulas Patocka, Dmitry Safonov, Oleg Nesterov, linux-mm,
	Cyrill Gorcunov, Pavel Emelyanov, open list

On Thu, 20 Oct 2016, Dmitry Safonov wrote:
> could you give attached patch a shot?

Can you please stop sending attached patches? It's a pain to look at them
and it makes it hard to reply inline.

I applied it and rewrote the changelog because the one liner you slapped
into it is more than useless. Ditto for the completely misleading subject
line. Please be more careful with that. 

Thanks,

	tglx

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
  2016-10-20  9:24       ` Thomas Gleixner
@ 2016-10-20 11:00         ` Dmitry Safonov
  -1 siblings, 0 replies; 17+ messages in thread
From: Dmitry Safonov @ 2016-10-20 11:00 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Mikulas Patocka, Dmitry Safonov, Oleg Nesterov, linux-mm,
	Cyrill Gorcunov, Pavel Emelyanov, open list

2016-10-20 12:24 GMT+03:00 Thomas Gleixner <tglx@linutronix.de>:
> On Thu, 20 Oct 2016, Dmitry Safonov wrote:
>> could you give attached patch a shot?
>
> Can you please stop sending attached patches? It's a pain to look at them
> and it makes it hard to reply inline.

Sure, I've planned to resend it after get tested-by or when I test
on x32 by myself. Sorry about attaching and changelog.

> I applied it and rewrote the changelog because the one liner you slapped
> into it is more than useless. Ditto for the completely misleading subject
> line. Please be more careful with that.

Thanks, Thomas!

-- 
             Dmitry

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
@ 2016-10-20 11:00         ` Dmitry Safonov
  0 siblings, 0 replies; 17+ messages in thread
From: Dmitry Safonov @ 2016-10-20 11:00 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Mikulas Patocka, Dmitry Safonov, Oleg Nesterov, linux-mm,
	Cyrill Gorcunov, Pavel Emelyanov, open list

2016-10-20 12:24 GMT+03:00 Thomas Gleixner <tglx@linutronix.de>:
> On Thu, 20 Oct 2016, Dmitry Safonov wrote:
>> could you give attached patch a shot?
>
> Can you please stop sending attached patches? It's a pain to look at them
> and it makes it hard to reply inline.

Sure, I've planned to resend it after get tested-by or when I test
on x32 by myself. Sorry about attaching and changelog.

> I applied it and rewrote the changelog because the one liner you slapped
> into it is more than useless. Ditto for the completely misleading subject
> line. Please be more careful with that.

Thanks, Thomas!

-- 
             Dmitry

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
  2016-10-19 22:02   ` Dmitry Safonov
@ 2016-10-20 15:22       ` Mikulas Patocka
  2016-10-20  9:21     ` [tip:x86/urgent] x86/signal: Remove bogus user_64bit_mode() check from sigaction_compat_abi() tip-bot for Dmitry Safonov
                         ` (3 subsequent siblings)
  4 siblings, 0 replies; 17+ messages in thread
From: Mikulas Patocka @ 2016-10-20 15:22 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: Dmitry Safonov, Oleg Nesterov, linux-mm, Cyrill Gorcunov,
	Pavel Emelyanov, Thomas Gleixner, open list

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2390 bytes --]



On Thu, 20 Oct 2016, Dmitry Safonov wrote:

> 2016-10-19 20:33 GMT+03:00 Mikulas Patocka <mpatocka@redhat.com>:
> >
> >
> > On Wed, 19 Oct 2016, Mikulas Patocka wrote:
> >
> >> Hi
> >>
> >> In the kernel 4.9-rc1, the x32 support is seriously broken, a x32 process
> >> is killed with SIGKILL after returning from any signal handler.
> >
> > I should have said they are killed with SIGSEGV, not SIGKILL.
> >
> >> I use Debian sid x64-64 distribution with x32 architecture added from
> >> debian-ports.
> >>
> >> I bisected the bug and found out that it is caused by the patch
> >> 6846351052e685c2d1428e80ead2d7ca3d7ed913 ("x86/signal: Add
> >> SA_{X32,IA32}_ABI sa_flags").
> >>
> >> example (strace of a process after receiving the SIGWINCH signal):
> >>
> >> epoll_wait(10, 0xef6890, 32, -1)        = -1 EINTR (Interrupted system call)
> >> --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1772, si_uid=0} ---
> >> poll([{fd=4, events=POLLOUT}], 1, 0)    = 1 ([{fd=4, revents=POLLOUT}])
> >> write(4, "\0", 1)                       = 1
> >> rt_sigreturn({mask=[INT QUIT ILL TRAP BUS KILL SEGV USR2 PIPE ALRM STKFLT TSTP TTOU URG XCPU XFSZ VTALRM IO PWR SYS RTMIN]}) = 0
> >> --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
> >> +++ killed by SIGSEGV +++
> >> Neoprávnìný pøístup do pamìti (SIGSEGV)
> >>
> >> Mikulas
> >
> > BTW. when I take core dump of the killed x32 process, it shows:
> >
> > ELF Header:
> >   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
> >   Class:                             ELF32
> >   Data:                              2's complement, little endian
> >   Version:                           1 (current)
> >   OS/ABI:                            UNIX - System V
> >   ABI Version:                       0
> >   Type:                              CORE (Core file)
> >   Machine:                           Intel 80386
> >                                 ^^^^^^^^^^^^^^^^^^^
> >
> > So, the kernel somehow thinks that it is i386 process, not x32 process. A
> > core dump of a real x32 process shows "Class: ELF32, Machine: Advanced
> > Micro Devices X86-64".
> 
> Hi Mikulas,
> 
> could you give attached patch a shot?
> In about 10 hours I'll be at work and will have debian-x32 install,
> but for now, I can't test it.
> Thanks again on catching that.
> 
> -- 
>              Dmitry

Yes, it fixes the bug.

Mikulas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags"
@ 2016-10-20 15:22       ` Mikulas Patocka
  0 siblings, 0 replies; 17+ messages in thread
From: Mikulas Patocka @ 2016-10-20 15:22 UTC (permalink / raw)
  To: Dmitry Safonov
  Cc: Dmitry Safonov, Oleg Nesterov, linux-mm, Cyrill Gorcunov,
	Pavel Emelyanov, Thomas Gleixner, open list

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2394 bytes --]



On Thu, 20 Oct 2016, Dmitry Safonov wrote:

> 2016-10-19 20:33 GMT+03:00 Mikulas Patocka <mpatocka@redhat.com>:
> >
> >
> > On Wed, 19 Oct 2016, Mikulas Patocka wrote:
> >
> >> Hi
> >>
> >> In the kernel 4.9-rc1, the x32 support is seriously broken, a x32 process
> >> is killed with SIGKILL after returning from any signal handler.
> >
> > I should have said they are killed with SIGSEGV, not SIGKILL.
> >
> >> I use Debian sid x64-64 distribution with x32 architecture added from
> >> debian-ports.
> >>
> >> I bisected the bug and found out that it is caused by the patch
> >> 6846351052e685c2d1428e80ead2d7ca3d7ed913 ("x86/signal: Add
> >> SA_{X32,IA32}_ABI sa_flags").
> >>
> >> example (strace of a process after receiving the SIGWINCH signal):
> >>
> >> epoll_wait(10, 0xef6890, 32, -1)        = -1 EINTR (Interrupted system call)
> >> --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_USER, si_pid=1772, si_uid=0} ---
> >> poll([{fd=4, events=POLLOUT}], 1, 0)    = 1 ([{fd=4, revents=POLLOUT}])
> >> write(4, "\0", 1)                       = 1
> >> rt_sigreturn({mask=[INT QUIT ILL TRAP BUS KILL SEGV USR2 PIPE ALRM STKFLT TSTP TTOU URG XCPU XFSZ VTALRM IO PWR SYS RTMIN]}) = 0
> >> --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
> >> +++ killed by SIGSEGV +++
> >> NeoprA!vnA!nA 1/2  pA,A-stup do pamA!ti (SIGSEGV)
> >>
> >> Mikulas
> >
> > BTW. when I take core dump of the killed x32 process, it shows:
> >
> > ELF Header:
> >   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
> >   Class:                             ELF32
> >   Data:                              2's complement, little endian
> >   Version:                           1 (current)
> >   OS/ABI:                            UNIX - System V
> >   ABI Version:                       0
> >   Type:                              CORE (Core file)
> >   Machine:                           Intel 80386
> >                                 ^^^^^^^^^^^^^^^^^^^
> >
> > So, the kernel somehow thinks that it is i386 process, not x32 process. A
> > core dump of a real x32 process shows "Class: ELF32, Machine: Advanced
> > Micro Devices X86-64".
> 
> Hi Mikulas,
> 
> could you give attached patch a shot?
> In about 10 hours I'll be at work and will have debian-x32 install,
> but for now, I can't test it.
> Thanks again on catching that.
> 
> -- 
>              Dmitry

Yes, it fixes the bug.

Mikulas

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [tip:x86/urgent] x86/signal: Remove bogus user_64bit_mode() check from sigaction_compat_abi()
  2016-10-19 22:02   ` Dmitry Safonov
                       ` (3 preceding siblings ...)
  2016-10-20 15:22       ` Mikulas Patocka
@ 2016-10-21  5:49     ` tip-bot for Dmitry Safonov
  4 siblings, 0 replies; 17+ messages in thread
From: tip-bot for Dmitry Safonov @ 2016-10-21  5:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, gorcunov, 0x7f454c46, dsafonov, oleg, linux-kernel, hpa,
	kilobyte, tglx, xemul, mpatocka

Commit-ID:  ed1e7db33c3354e4f8b594738c5e793690213b43
Gitweb:     http://git.kernel.org/tip/ed1e7db33c3354e4f8b594738c5e793690213b43
Author:     Dmitry Safonov <0x7f454c46@gmail.com>
AuthorDate: Thu, 20 Oct 2016 00:53:08 +0300
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 20 Oct 2016 13:05:15 +0200

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: 6846351052e6 ("x86/signal: Add SA_{X32,IA32}_ABI sa_flags")
Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Tested-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: linux-mm@kvack.org
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Link: http://lkml.kernel.org/r/CAJwJo6Z8ZWPqNfT6t-i8GW1MKxQrKDUagQqnZ%2B0%2B697%3DMyVeGg@mail.gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/signal_compat.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/kernel/signal_compat.c b/arch/x86/kernel/signal_compat.c
index 40df337..ec1f756 100644
--- a/arch/x86/kernel/signal_compat.c
+++ b/arch/x86/kernel/signal_compat.c
@@ -105,9 +105,6 @@ void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact)
 	/* Don't let flags to be set from userspace */
 	act->sa.sa_flags &= ~(SA_IA32_ABI | SA_X32_ABI);
 
-	if (user_64bit_mode(current_pt_regs()))
-		return;
-
 	if (in_ia32_syscall())
 		act->sa.sa_flags |= SA_IA32_ABI;
 	if (in_x32_syscall())

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-10-21  5:50 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-19 17:19 x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags" Mikulas Patocka
2016-10-19 17:19 ` Mikulas Patocka
2016-10-19 17:33 ` Mikulas Patocka
2016-10-19 17:33   ` Mikulas Patocka
2016-10-19 17:45   ` Dmitry Safonov
2016-10-19 17:45     ` Dmitry Safonov
2016-10-19 22:02   ` Dmitry Safonov
2016-10-20  3:13     ` Adam Borowski
2016-10-20  3:13       ` Adam Borowski
2016-10-20  9:21     ` [tip:x86/urgent] x86/signal: Remove bogus user_64bit_mode() check from sigaction_compat_abi() tip-bot for Dmitry Safonov
2016-10-20  9:24     ` x32 is broken in 4.9-rc1 due to "x86/signal: Add SA_{X32,IA32}_ABI sa_flags" Thomas Gleixner
2016-10-20  9:24       ` Thomas Gleixner
2016-10-20 11:00       ` Dmitry Safonov
2016-10-20 11:00         ` Dmitry Safonov
2016-10-20 15:22     ` Mikulas Patocka
2016-10-20 15:22       ` Mikulas Patocka
2016-10-21  5:49     ` [tip:x86/urgent] x86/signal: Remove bogus user_64bit_mode() check from sigaction_compat_abi() tip-bot for Dmitry Safonov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.