[Bug 205183] PPC64: Signal delivery fails with SIGSEGV if between about 1KB and 4KB bytes of stack remain

2020-08-31 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205183

Michael Ellerman (mich...@ellerman.id.au) changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

[Bug 205183] PPC64: Signal delivery fails with SIGSEGV if between about 1KB and 4KB bytes of stack remain

2020-08-10 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205183

--- Comment #6 from Michael Ellerman (mich...@ellerman.id.au) ---
Fixed in 63dee5df43a3 ("powerpc: Allow 4224 bytes of stack expansion for the
signal frame")

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

[Bug 205183] PPC64: Signal delivery fails with SIGSEGV if between about 1KB and 4KB bytes of stack remain

2020-07-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205183

Michael Ellerman (mich...@ellerman.id.au) changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |CODE_FIX

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

[Bug 205183] PPC64: Signal delivery fails with SIGSEGV if between about 1KB and 4KB bytes of stack remain

2020-07-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205183

Michael Ellerman (mich...@ellerman.id.au) changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||mich...@ellerman.id.au

--- Comment #5 from Michael Ellerman (mich...@ellerman.id.au) ---
Patches posted:

https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=192046

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

[Bug 205183] PPC64: Signal delivery fails with SIGSEGV if between about 1KB and 4KB bytes of stack remain

2020-06-11 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205183

--- Comment #4 from Daniel Black (dan...@linux.ibm.com) ---
Still broken.

danielgb@talos2:~$ gcc -g -Wall -O stacktest.c
danielgb@talos2:~$  ./a.out 124 &
[1] 494618
danielgb@talos2:~$ cat /proc/$(pidof a.out)/maps | grep stack
7fffcde8-7fffcdfb rw-p  00:00 0 
[stack]
danielgb@talos2:~$ kill -USR1 %1
danielgb@talos2:~$ signal delivered, stack base 0x7fffcdfb top
0x7fffcde81427 (1240025 used)

[1]+  Done./a.out 124
danielgb@talos2:~$ ./a.out 1241000 &
[1] 494677
danielgb@talos2:~$ kill -USR1 %1
danielgb@talos2:~$ 
[1]+  Segmentation fault  ./a.out 1241000
danielgb@talos2:~$ 
danielgb@talos2:~$ dmesg | grep a.out
[10617.616145] a.out[494587]: bad frame in setup_rt_frame: 7fffdea30010 nip
00011a0a09fc lr 7fffa1c404c8
[10865.752876] a.out[494677]: bad frame in setup_rt_frame: 7fffcc420030 nip
000135a70a3c lr 7fff952604c8
danielgb@talos2:~$ uname -a
Linux talos2 5.7.0-rc5-77151-gfea086b627a0 #1 SMP Mon May 11 16:00:00 AEST 2020
ppc64le ppc64le ppc64le GNU/Linux

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

[Bug 205183] PPC64: Signal delivery fails with SIGSEGV if between about 1KB and 4KB bytes of stack remain

2019-12-10 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205183

--- Comment #3 from Daniel Axtens (d...@axtens.net) ---
I have a proposed patch at
https://lore.kernel.org/linuxppc-dev/20191211014337.28128-1-...@axtens.net/T/#u

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

[Bug 205183] PPC64: Signal delivery fails with SIGSEGV if between about 1KB and 4KB bytes of stack remain

2019-12-10 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205183

Daniel Axtens (d...@axtens.net) changed:

   What|Removed |Added

 CC||d...@axtens.net

--- Comment #2 from Daniel Axtens (d...@axtens.net) ---
Hi, I'm starting to have a look at this for Daniel B.

So looking at the fault that fails, I see that it's a fault with the NIP in the
_kernel_ that fails, rather than in userspace. Dumping stack we see:

[  118.917679] Call Trace:
[  118.917715] [c0007b457820] [c0b71538] dump_stack+0xbc/0x104
(unreliable)
[  118.917719] [c0007b457860] [c006e8f0]
__do_page_fault+0x860/0xf90
[  118.917721] [c0007b457940] [c000af68]
handle_page_fault+0x10/0x30
[  118.917725] --- interrupt: 301 at handle_rt_signal64+0x180/0x13a0
   LR = handle_rt_signal64+0x148/0x13a0
[  118.917726] [c0007b457d30] [c0023d30]
do_notify_resume+0x2e0/0x410
[  118.917728] [c0007b457e20] [c000e4c4]
ret_from_except_lite+0x70/0x74

I'm still debugging, but it looks like handle_rt_signal64 attempts to reserve a
stack frame for the signal, but computes a stack address that sits outside
valid stack space. Then when writing to it, it pagefaults, and because it's not
a userland NIP, it refuses to expand the stack.

I'll keep you up to date.

Regards,
Daniel A

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

[Bug 205183] PPC64: Signal delivery fails with SIGSEGV if between about 1KB and 4KB bytes of stack remain

2019-11-17 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205183

Daniel Black (dan...@linux.ibm.com) changed:

   What|Removed |Added

 CC||dan...@linux.ibm.com

--- Comment #1 from Daniel Black (dan...@linux.ibm.com) ---
Tom,

Thanks for the bug report. Appreciate it. Feel free to use the
linuxppc-dev@lists.ozlabs.org list.


Reproduced in 5.4.0-rc8

danielgb@talos2:~$ uname -a
Linux talos2 5.4.0-rc8 #5 SMP Mon Nov 18 13:27:11 AEDT 2019 ppc64le ppc64le
ppc64le GNU/Linux
danielgb@talos2:~$ gcc -g -Wall -O stacktest.c
danielgb@talos2:~$ ./a.out 124 &
[1] 2944
danielgb@talos2:~$  cat /proc/$(pidof a.out)/maps | grep stack
7fffc62f-7fffc642 rw-p  00:00 0 
[stack]
danielgb@talos2:~$ kill -USR1 %1
danielgb@talos2:~$ signal delivered, stack base 0x7fffc642 top
0x7fffc62f1427 (1240025 used)

[1]+  Done./a.out 124
danielgb@talos2:~$  ./a.out 1241000 &
[1] 2948
danielgb@talos2:~$ kill -USR1 %1
danielgb@talos2:~$ 
[1]+  Segmentation fault  ./a.out 1241000


[ 6415.077590] a.out[2948]: bad frame in setup_rt_frame: 7fffe4fb0010 nip
06a185d909fc lr 77ecda3c04e8


I'll get someone to look at this soon.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.