Skip to content

Commit 167ee0b

Browse files
AmanieuChristian Brauner
authored andcommitted
arm: Implement copy_thread_tls
This is required for clone3 which passes the TLS value through a struct rather than a register. Signed-off-by: Amanieu d'Antras <[email protected]> Cc: [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 a4376f2 commit 167ee0b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ config ARM
7272
select HAVE_ARM_SMCCC if CPU_V7
7373
select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
7474
select HAVE_CONTEXT_TRACKING
75+
select HAVE_COPY_THREAD_TLS
7576
select HAVE_C_RECORDMCOUNT
7677
select HAVE_DEBUG_KMEMLEAK
7778
select HAVE_DMA_CONTIGUOUS if MMU

arch/arm/kernel/process.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ void release_thread(struct task_struct *dead_task)
226226
asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
227227

228228
int
229-
copy_thread(unsigned long clone_flags, unsigned long stack_start,
230-
unsigned long stk_sz, struct task_struct *p)
229+
copy_thread_tls(unsigned long clone_flags, unsigned long stack_start,
230+
unsigned long stk_sz, struct task_struct *p, unsigned long tls)
231231
{
232232
struct thread_info *thread = task_thread_info(p);
233233
struct pt_regs *childregs = task_pt_regs(p);
@@ -261,7 +261,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
261261
clear_ptrace_hw_breakpoint(p);
262262

263263
if (clone_flags & CLONE_SETTLS)
264-
thread->tp_value[0] = childregs->ARM_r3;
264+
thread->tp_value[0] = tls;
265265
thread->tp_value[1] = get_tpuser();
266266

267267
thread_notify(THREAD_NOTIFY_COPY, thread);

0 commit comments

Comments
 (0)