It seems the kernel can not deal with uncommitted stack space in the area intended
for the register window when executing the clone() system call. So create a nested
frame (proxy for the kernel frame) and flush it from the processor to memory to
force committing pages to the stack before invoking the system call.
Bug: https://www.mail-archive.com/debian-glibc@lists.debian.org/msg62592.html
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31394
See-also: https://lore.kernel.org/sparclinux/
62f9be9d-a086-4134-9a9f-
5df8822708af@mkarcher.dialup.fu-berlin.de/
Signed-off-by: Michael Karcher <sourceware-bugzilla@mkarcher.dialup.fu-berlin.de>
Reviewed-by: DJ Delorie <dj@redhat.com>
(cherry picked from commit
faeaa3bc9f76030b9882ccfdee232fc0ca6dcb06)
[27821] ungetc: Fix backup buffer leak on program exit
[30081] resolv: Do not wait for non-existing second DNS response after error
+ [31394] clone on sparc might fail with -EFAULT for no valid reason
[31717] elf: Avoid re-initializing already allocated TLS in dlopen
[31890] resolv: Allow short error responses to match any DNS query
[31968] mremap implementation in C does not handle arguments correctly
.text
ENTRY (__clone)
save %sp,-96,%sp
+ save %sp,-96,%sp
+ flushw
+ restore
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
ENTRY (__clone)
save %sp, -192, %sp
+ save %sp, -192, %sp
+ flushw
+ restore
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)