]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Sep 2021 08:11:59 +0000 (10:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Sep 2021 08:11:59 +0000 (10:11 +0200)
added patches:
arc-wireup-clone3-syscall.patch

queue-5.4/arc-wireup-clone3-syscall.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/arc-wireup-clone3-syscall.patch b/queue-5.4/arc-wireup-clone3-syscall.patch
new file mode 100644 (file)
index 0000000..78d08e4
--- /dev/null
@@ -0,0 +1,104 @@
+From bd71c453db91ecb464405411f2821d040f2a0d44 Mon Sep 17 00:00:00 2001
+From: Vineet Gupta <vgupta@synopsys.com>
+Date: Wed, 15 Jan 2020 16:08:12 -0800
+Subject: ARC: wireup clone3 syscall
+
+From: Vineet Gupta <vgupta@synopsys.com>
+
+commit bd71c453db91ecb464405411f2821d040f2a0d44 upstream.
+
+Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/arc/Kconfig                   |    1 +
+ arch/arc/include/asm/syscalls.h    |    1 +
+ arch/arc/include/uapi/asm/unistd.h |    1 +
+ arch/arc/kernel/entry.S            |   12 ++++++++++++
+ arch/arc/kernel/process.c          |    7 +++----
+ arch/arc/kernel/sys.c              |    1 +
+ 6 files changed, 19 insertions(+), 4 deletions(-)
+
+--- a/arch/arc/Kconfig
++++ b/arch/arc/Kconfig
+@@ -29,6 +29,7 @@ config ARC
+       select GENERIC_SMP_IDLE_THREAD
+       select HAVE_ARCH_KGDB
+       select HAVE_ARCH_TRACEHOOK
++      select HAVE_COPY_THREAD_TLS
+       select HAVE_DEBUG_STACKOVERFLOW
+       select HAVE_FUTEX_CMPXCHG if FUTEX
+       select HAVE_IOREMAP_PROT
+--- a/arch/arc/include/asm/syscalls.h
++++ b/arch/arc/include/asm/syscalls.h
+@@ -11,6 +11,7 @@
+ #include <linux/types.h>
+ int sys_clone_wrapper(int, int, int, int, int);
++int sys_clone3_wrapper(void *, size_t);
+ int sys_cacheflush(uint32_t, uint32_t uint32_t);
+ int sys_arc_settls(void *);
+ int sys_arc_gettls(void);
+--- a/arch/arc/include/uapi/asm/unistd.h
++++ b/arch/arc/include/uapi/asm/unistd.h
+@@ -21,6 +21,7 @@
+ #define __ARCH_WANT_SET_GET_RLIMIT
+ #define __ARCH_WANT_SYS_EXECVE
+ #define __ARCH_WANT_SYS_CLONE
++#define __ARCH_WANT_SYS_CLONE3
+ #define __ARCH_WANT_SYS_VFORK
+ #define __ARCH_WANT_SYS_FORK
+ #define __ARCH_WANT_TIME32_SYSCALLS
+--- a/arch/arc/kernel/entry.S
++++ b/arch/arc/kernel/entry.S
+@@ -35,6 +35,18 @@ ENTRY(sys_clone_wrapper)
+       b .Lret_from_system_call
+ END(sys_clone_wrapper)
++ENTRY(sys_clone3_wrapper)
++      SAVE_CALLEE_SAVED_USER
++      bl  @sys_clone3
++      DISCARD_CALLEE_SAVED_USER
++
++      GET_CURR_THR_INFO_FLAGS   r10
++      btst r10, TIF_SYSCALL_TRACE
++      bnz  tracesys_exit
++
++      b .Lret_from_system_call
++END(sys_clone3_wrapper)
++
+ ENTRY(ret_from_fork)
+       ; when the forked child comes here from the __switch_to function
+       ; r0 has the last task pointer.
+--- a/arch/arc/kernel/process.c
++++ b/arch/arc/kernel/process.c
+@@ -171,9 +171,8 @@ asmlinkage void ret_from_fork(void);
+  * |    user_r25    |
+  * ------------------  <===== END of PAGE
+  */
+-int copy_thread(unsigned long clone_flags,
+-              unsigned long usp, unsigned long kthread_arg,
+-              struct task_struct *p)
++int copy_thread_tls(unsigned long clone_flags, unsigned long usp,
++      unsigned long kthread_arg, struct task_struct *p, unsigned long tls)
+ {
+       struct pt_regs *c_regs;        /* child's pt_regs */
+       unsigned long *childksp;       /* to unwind out of __switch_to() */
+@@ -231,7 +230,7 @@ int copy_thread(unsigned long clone_flag
+                * set task's userland tls data ptr from 4th arg
+                * clone C-lib call is difft from clone sys-call
+                */
+-              task_thread_info(p)->thr_ptr = regs->r3;
++              task_thread_info(p)->thr_ptr = tls;
+       } else {
+               /* Normal fork case: set parent's TLS ptr in child */
+               task_thread_info(p)->thr_ptr =
+--- a/arch/arc/kernel/sys.c
++++ b/arch/arc/kernel/sys.c
+@@ -7,6 +7,7 @@
+ #include <asm/syscalls.h>
+ #define sys_clone     sys_clone_wrapper
++#define sys_clone3    sys_clone3_wrapper
+ #undef __SYSCALL
+ #define __SYSCALL(nr, call) [nr] = (call),
index 9f85bdc3efaf066422e4ec2ea580a74ca6f49a23..b643ebaeb5a48f8f0cdbc5d69121cc27913c297f 100644 (file)
@@ -17,3 +17,4 @@ cryptoloop-add-a-deprecation-warning.patch
 arm-8918-2-only-build-return_address-if-needed.patch
 alsa-hda-realtek-workaround-for-conflicting-ssid-on-asus-rog-strix-g17.patch
 alsa-pcm-fix-divide-error-in-snd_pcm_lib_ioctl.patch
+arc-wireup-clone3-syscall.patch