Skip to content

Commit dd499f7

Browse files
AmanieuChristian Brauner
authored andcommitted
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 <[email protected]> Cc: <[email protected]> # 5.3.x Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent c346b94 commit dd499f7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

kernel/fork.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2578,6 +2578,16 @@ SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
25782578
#endif
25792579

25802580
#ifdef __ARCH_WANT_SYS_CLONE3
2581+
2582+
/*
2583+
* copy_thread implementations handle CLONE_SETTLS by reading the TLS value from
2584+
* the registers containing the syscall arguments for clone. This doesn't work
2585+
* with clone3 since the TLS value is passed in clone_args instead.
2586+
*/
2587+
#ifndef CONFIG_HAVE_COPY_THREAD_TLS
2588+
#error clone3 requires copy_thread_tls support in arch
2589+
#endif
2590+
25812591
noinline static int copy_clone_args_from_user(struct kernel_clone_args *kargs,
25822592
struct clone_args __user *uargs,
25832593
size_t usize)

0 commit comments

Comments
 (0)