Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fork: Use RCU_INIT_POINTER() instead of rcu_access_pointer()

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>

authored by

Madhuparna Bhowmik and committed by
Christian Brauner
0c282b06 bb6d3fb3

+1 -1
+1 -1
kernel/fork.c
··· 1508 1508 return 0; 1509 1509 } 1510 1510 sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL); 1511 - rcu_assign_pointer(tsk->sighand, sig); 1511 + RCU_INIT_POINTER(tsk->sighand, sig); 1512 1512 if (!sig) 1513 1513 return -ENOMEM; 1514 1514