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

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] unshare: Use rcu_assign_pointer when setting sighand

The sighand pointer only needs the rcu_read_lock on the
read side. So only depending on task_lock protection
when setting this pointer is not enough. We also need
a memory barrier to ensure the initialization is seen first.

Use rcu_assign_pointer as it does this for us, and clearly
documents that we are setting an rcu readable pointer.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Paul E. McKenney <paulmck@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Eric W. Biederman and committed by
Linus Torvalds
e0e8eb54 232a347a

+1 -1
+1 -1
kernel/fork.c
··· 1569 1569 1570 1570 if (new_sigh) { 1571 1571 sigh = current->sighand; 1572 - current->sighand = new_sigh; 1572 + rcu_assign_pointer(current->sighand, new_sigh); 1573 1573 new_sigh = sigh; 1574 1574 } 1575 1575