--- zzzz-none-000/linux-2.6.19.2/kernel/signal.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/kernel/signal.c 2007-01-19 14:42:56.000000000 +0000 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -267,25 +268,18 @@ int override_rlimit) { struct sigqueue *q = NULL; - struct user_struct *user; - /* - * 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); + atomic_inc(&t->user->sigpending); if (override_rlimit || - atomic_read(&user->sigpending) <= + atomic_read(&t->user->sigpending) <= t->signal->rlim[RLIMIT_SIGPENDING].rlim_cur) q = kmem_cache_alloc(sigqueue_cachep, flags); if (unlikely(q == NULL)) { - atomic_dec(&user->sigpending); + atomic_dec(&t->user->sigpending); } else { INIT_LIST_HEAD(&q->list); q->flags = 0; - q->user = get_uid(user); + q->user = get_uid(t->user); } return(q); } @@ -581,16 +575,18 @@ return error; error = -EPERM; if ((info == SEND_SIG_NOINFO || (!is_si_special(info) && SI_FROMUSER(info))) - && ((sig != SIGCONT) || + && ((((sig != SIGCONT) || (current->signal->session != t->signal->session)) && (current->euid ^ t->suid) && (current->euid ^ t->uid) && (current->uid ^ t->suid) && (current->uid ^ t->uid) - && !capable(CAP_KILL)) + && !capable(CAP_KILL)) || gr_handle_signal(t, sig))) return error; error = security_task_kill(t, info, sig, 0); - if (!error) + if (!error) { audit_signal_info(sig, t); /* Let audit system see the signal */ + gr_log_signal(sig, t); + } return error; } @@ -768,7 +764,7 @@ (((sig) < SIGRTMIN) && sigismember(&(sigptr)->signal, (sig))) -static int +int specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t) { int ret = 0; @@ -822,6 +818,10 @@ } } ret = specific_send_sig_info(sig, info, t); + + gr_log_signal(sig, t); + gr_handle_crash(t, sig); + spin_unlock_irqrestore(&t->sighand->siglock, flags); return ret;