Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40696
b: refs/heads/master
c: 10b1fbd
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Nov 4, 2006
1 parent ef8b65f commit 09d4256
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 45c18b0bb579b5c1b89f8c99f1b6ffa4c586ba08
refs/heads/master: 10b1fbdb0a0ca91847a534ad26d0bc250c25b74f
15 changes: 11 additions & 4 deletions trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,25 @@ static struct sigqueue *__sigqueue_alloc(struct task_struct *t, gfp_t flags,
int override_rlimit)
{
struct sigqueue *q = NULL;
struct user_struct *user;

atomic_inc(&t->user->sigpending);
/*
* In order to avoid problems with "switch_user()", we want to make
* sure that the compiler doesn't re-load "t->user"
*/
user = t->user;
barrier();
atomic_inc(&user->sigpending);
if (override_rlimit ||
atomic_read(&t->user->sigpending) <=
atomic_read(&user->sigpending) <=
t->signal->rlim[RLIMIT_SIGPENDING].rlim_cur)
q = kmem_cache_alloc(sigqueue_cachep, flags);
if (unlikely(q == NULL)) {
atomic_dec(&t->user->sigpending);
atomic_dec(&user->sigpending);
} else {
INIT_LIST_HEAD(&q->list);
q->flags = 0;
q->user = get_uid(t->user);
q->user = get_uid(user);
}
return(q);
}
Expand Down

0 comments on commit 09d4256

Please sign in to comment.