From 5c51579fde0876f815a20d6125242d790a4347e8 Mon Sep 17 00:00:00 2001 From: Jing-Ting Wu Date: Tue, 6 Jul 2021 15:13:55 +0800 Subject: [PATCH] ANDROID: fork: Export task_newtask tracepoint android_rvh_sched_fork() and android_rvh_sched_fork_init() already let us register probes during fork(), but those are invoked *before* the new task is added to the tasklist, which can lead to some undesired races when a module is trying to initialize vendor-specific task_struct fields. Export the task_newtask tracepoint to register probes to run during fork() but *after* the task has been inserted into the tasklist. Bug: 192873984 Signed-off-by: Jing-Ting Wu Cc: Valentin Schneider Change-Id: Ifef14819264385b5e955a5966b4e4f66d50da5e3 --- kernel/fork.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/fork.c b/kernel/fork.c index 0d7d98bc37fb..c2657304d67b 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -121,6 +121,8 @@ */ #define MAX_THREADS FUTEX_TID_MASK +EXPORT_TRACEPOINT_SYMBOL_GPL(task_newtask); + /* * Protected counters by write_lock_irq(&tasklist_lock) */