From: Amanieu d'Antras <amanieu@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Christian Brauner <christian@brauner.io>,
stable@vger.kernel.org, Amanieu d'Antras <amanieu@gmail.com>
Subject: [PATCH 7/7] clone3: ensure copy_thread_tls is implemented
Date: Thu, 2 Jan 2020 18:24:13 +0100 [thread overview]
Message-ID: <20200102172413.654385-8-amanieu@gmail.com> (raw)
In-Reply-To: <20200102172413.654385-1-amanieu@gmail.com>
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@gmail.com>
Cc: <stable@vger.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
next prev parent reply other threads:[~2020-01-02 17:24 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-02 17:24 [PATCH 0/7] Fix CLONE_SETTLS with clone3 Amanieu d'Antras
2020-01-02 17:24 ` [PATCH 1/7] arm64: Move __ARCH_WANT_SYS_CLONE3 definition to uapi headers Amanieu d'Antras
2020-01-02 17:50 ` Christian Brauner
2020-01-02 19:25 ` Arnd Bergmann
2020-01-02 19:32 ` Amanieu d'Antras
2020-01-02 19:59 ` Arnd Bergmann
2020-01-02 17:24 ` [PATCH 2/7] arm64: Implement copy_thread_tls Amanieu d'Antras
2020-01-02 18:01 ` Christian Brauner
2020-01-06 17:39 ` Will Deacon
2020-01-06 18:03 ` Amanieu d'Antras
2020-01-07 9:02 ` Christian Brauner
2020-01-07 17:45 ` Will Deacon
2020-01-07 18:12 ` Kees Cook
2020-01-07 19:30 ` Christian Brauner
2020-01-07 19:30 ` Christian Brauner
2020-01-02 17:24 ` [PATCH 3/7] arm: " Amanieu d'Antras
2020-01-02 18:02 ` Christian Brauner
2020-01-02 17:24 ` [PATCH 4/7] parisc: " Amanieu d'Antras
2020-01-02 17:24 ` [PATCH 5/7] riscv: " Amanieu d'Antras
2020-01-02 17:24 ` [PATCH 6/7] xtensa: " Amanieu d'Antras
2020-01-02 17:24 ` Amanieu d'Antras [this message]
2020-01-02 18:09 ` [PATCH 7/7] clone3: ensure copy_thread_tls is implemented Christian Brauner
2020-01-02 18:19 ` Amanieu d'Antras
2020-01-02 18:24 ` Christian Brauner
2020-01-02 18:11 ` [PATCH 0/7] Fix CLONE_SETTLS with clone3 Christian Brauner
2020-01-04 12:39 ` [PATCH] um: Implement copy_thread_tls Amanieu d'Antras
2020-01-05 15:19 ` Christian Brauner
2020-01-07 12:35 ` Christian Brauner
2020-01-17 0:12 ` Richard Weinberger
2020-01-17 0:14 ` Christian Brauner
2020-01-07 12:34 ` [PATCH 0/7] Fix CLONE_SETTLS with clone3 Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200102172413.654385-8-amanieu@gmail.com \
--to=amanieu@gmail.com \
--cc=christian@brauner.io \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).