Commit c7aa953c authored by Ulrich Drepper's avatar Ulrich Drepper Committed by Linus Torvalds

[PATCH] wrong pid in siginfo_t

If a signal is sent via kill() or tkill() the kernel fills in the wrong
PID value in the siginfo_t structure (obviously only if the handler has
SA_SIGINFO set).

POSIX specifies the the si_pid field is filled with the process ID, and
in Linux parlance that's the "thread group" ID, not the thread ID.
parent 9e008c3c
...@@ -2082,7 +2082,7 @@ sys_kill(int pid, int sig) ...@@ -2082,7 +2082,7 @@ sys_kill(int pid, int sig)
info.si_signo = sig; info.si_signo = sig;
info.si_errno = 0; info.si_errno = 0;
info.si_code = SI_USER; info.si_code = SI_USER;
info.si_pid = current->pid; info.si_pid = current->tgid;
info.si_uid = current->uid; info.si_uid = current->uid;
return kill_something_info(sig, &info, pid); return kill_something_info(sig, &info, pid);
...@@ -2105,7 +2105,7 @@ sys_tkill(int pid, int sig) ...@@ -2105,7 +2105,7 @@ sys_tkill(int pid, int sig)
info.si_signo = sig; info.si_signo = sig;
info.si_errno = 0; info.si_errno = 0;
info.si_code = SI_TKILL; info.si_code = SI_TKILL;
info.si_pid = current->pid; info.si_pid = current->tgid;
info.si_uid = current->uid; info.si_uid = current->uid;
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
......
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