Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40695
b: refs/heads/master
c: 45c18b0
h: refs/heads/master
i:
  40693: b4bef51
  40691: f7356bf
  40687: 02e350f
v: v3
  • Loading branch information
Linus Torvalds committed Nov 4, 2006
1 parent f5f6120 commit ef8b65f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 80491eb90c750fcd7d13830062f27ae9b7cc5f75
refs/heads/master: 45c18b0bb579b5c1b89f8c99f1b6ffa4c586ba08
11 changes: 11 additions & 0 deletions trunk/kernel/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,17 @@ void switch_uid(struct user_struct *new_user)
atomic_dec(&old_user->processes);
switch_uid_keyring(new_user);
current->user = new_user;

/*
* We need to synchronize with __sigqueue_alloc()
* doing a get_uid(p->user).. If that saw the old
* user value, we need to wait until it has exited
* its critical region before we can free the old
* structure.
*/
smp_mb();
spin_unlock_wait(&current->sighand->siglock);

free_uid(old_user);
suid_keys(current);
}
Expand Down

0 comments on commit ef8b65f

Please sign in to comment.