fork: Use RCU_INIT_POINTER() instead of rcu_access_pointer()
authorMadhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Mon, 27 Jan 2020 17:58:21 +0000 (23:28 +0530)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 28 Feb 2020 12:34:36 +0000 (13:34 +0100)
Use RCU_INIT_POINTER() instead of rcu_access_pointer() in
copy_sighand().

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
[christian.brauner@ubuntu.com: edit commit message]
Link: https://lore.kernel.org/r/20200127175821.10833-1-madhuparnabhowmik10@gmail.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
kernel/fork.c

index 60a1295f4384363ae9b35e589c02e52fbf914a26..86425305cd4acc59b9d1c6a76a4c912d73ca2059 100644 (file)
@@ -1508,7 +1508,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
                return 0;
        }
        sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL);
-       rcu_assign_pointer(tsk->sighand, sig);
+       RCU_INIT_POINTER(tsk->sighand, sig);
        if (!sig)
                return -ENOMEM;