diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2006-03-16 12:31:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-17 10:46:59 -0500 |
commit | e0e8eb54d8ae0c4cfd1d297f6351b08a7f635c5f (patch) | |
tree | e6f6442aca13fe9d20d149ed9b414f038d90778f /kernel | |
parent | 232a347a444e687b5f8cf0f6485704db1c6024d3 (diff) |
[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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/fork.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index ccdfbb16c86d..46060cb24af0 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1569,7 +1569,7 @@ asmlinkage long sys_unshare(unsigned long unshare_flags) | |||
1569 | 1569 | ||
1570 | if (new_sigh) { | 1570 | if (new_sigh) { |
1571 | sigh = current->sighand; | 1571 | sigh = current->sighand; |
1572 | current->sighand = new_sigh; | 1572 | rcu_assign_pointer(current->sighand, new_sigh); |
1573 | new_sigh = sigh; | 1573 | new_sigh = sigh; |
1574 | } | 1574 | } |
1575 | 1575 | ||