Commit cefb76b6 authored by Chris Wright's avatar Chris Wright Committed by Linus Torvalds

[PATCH] RLIM: pass task_struct in send_signal()

Update send_signal() api to allow passing the task receiving the signal.  This
is necessary to ensure signals generated out of process context can be charged
to the correct user.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3a948de7
...@@ -699,7 +699,8 @@ static void handle_stop_signal(int sig, struct task_struct *p) ...@@ -699,7 +699,8 @@ static void handle_stop_signal(int sig, struct task_struct *p)
} }
} }
static int send_signal(int sig, struct siginfo *info, struct sigpending *signals) static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
struct sigpending *signals)
{ {
struct sigqueue * q = NULL; struct sigqueue * q = NULL;
int ret = 0; int ret = 0;
...@@ -798,7 +799,7 @@ specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t) ...@@ -798,7 +799,7 @@ specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t)
if (LEGACY_QUEUE(&t->pending, sig)) if (LEGACY_QUEUE(&t->pending, sig))
goto out; goto out;
ret = send_signal(sig, info, &t->pending); ret = send_signal(sig, info, t, &t->pending);
if (!ret && !sigismember(&t->blocked, sig)) if (!ret && !sigismember(&t->blocked, sig))
signal_wake_up(t, sig == SIGKILL); signal_wake_up(t, sig == SIGKILL);
out: out:
...@@ -999,7 +1000,7 @@ __group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p) ...@@ -999,7 +1000,7 @@ __group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
* We always use the shared queue for process-wide signals, * We always use the shared queue for process-wide signals,
* to avoid several races. * to avoid several races.
*/ */
ret = send_signal(sig, info, &p->signal->shared_pending); ret = send_signal(sig, info, p, &p->signal->shared_pending);
if (unlikely(ret)) if (unlikely(ret))
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment