[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200102172413.654385-8-amanieu@gmail.com>
Date: Thu, 2 Jan 2020 18:24:13 +0100
From: Amanieu d'Antras <amanieu@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Christian Brauner <christian@...uner.io>, stable@...r.kernel.org,
Amanieu d'Antras <amanieu@...il.com>
Subject: [PATCH 7/7] clone3: ensure copy_thread_tls is implemented
copy_thread implementations handle CLONE_SETTLS by reading the TLS
value from the registers containing the syscall arguments for
clone. This doesn't work with clone3 since the TLS value is passed
in clone_args instead.
Signed-off-by: Amanieu d'Antras <amanieu@...il.com>
Cc: <stable@...r.kernel.org> # 5.3.x
---
kernel/fork.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/kernel/fork.c b/kernel/fork.c
index 2508a4f238a3..080809560072 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2578,6 +2578,16 @@ SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
#endif
#ifdef __ARCH_WANT_SYS_CLONE3
+
+/*
+ * copy_thread implementations handle CLONE_SETTLS by reading the TLS value from
+ * the registers containing the syscall arguments for clone. This doesn't work
+ * with clone3 since the TLS value is passed in clone_args instead.
+ */
+#ifndef CONFIG_HAVE_COPY_THREAD_TLS
+#error clone3 requires copy_thread_tls support in arch
+#endif
+
noinline static int copy_clone_args_from_user(struct kernel_clone_args *kargs,
struct clone_args __user *uargs,
size_t usize)
--
2.24.1
Powered by blists - more mailing lists