Skip to content

Commit

Permalink
[PATCH] unshare: Use rcu_assign_pointer when setting sighand
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ebiederm authored and Linus Torvalds committed Mar 17, 2006
1 parent 232a347 commit e0e8eb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/fork.c
Expand Up @@ -1569,7 +1569,7 @@ asmlinkage long sys_unshare(unsigned long unshare_flags)

if (new_sigh) {
sigh = current->sighand;
current->sighand = new_sigh;
rcu_assign_pointer(current->sighand, new_sigh);
new_sigh = sigh;
}

Expand Down

0 comments on commit e0e8eb5

Please sign in to comment.