diff -NurpP --minimal linux-2.6.11.9-vs2.0-rc2/kernel/vserver/signal.c linux-2.6.11.9-vs2.0-rc2-vkill/kernel/vserver/signal.c --- linux-2.6.11.9-vs2.0-rc2/kernel/vserver/signal.c 2005-05-26 15:50:35.000000000 +0200 +++ linux-2.6.11.9-vs2.0-rc2-vkill/kernel/vserver/signal.c 2005-05-28 14:29:04.000000000 +0200 @@ -23,21 +23,15 @@ int vc_ctx_kill(uint32_t id, void __user { int retval, count=0; struct vcmd_ctx_kill_v0 vc_data; - struct siginfo info; struct task_struct *p; struct vx_info *vxi; + int priv = 0; if (!vx_check(0, VX_ADMIN)) return -ENOSYS; if (copy_from_user (&vc_data, data, sizeof(vc_data))) return -EFAULT; - info.si_signo = vc_data.sig; - info.si_errno = 0; - info.si_code = SI_USER; - info.si_pid = current->pid; - info.si_uid = current->uid; - vxi = locate_vx_info(id); if (!vxi) return -ESRCH; @@ -46,17 +40,17 @@ int vc_ctx_kill(uint32_t id, void __user read_lock(&tasklist_lock); switch (vc_data.pid) { case 0: - info.si_code = SI_KERNEL; + priv = 1; case -1: for_each_process(p) { int err = 0; if (vx_task_xid(p) != id || p->pid <= 1 || - (vc_data.pid && vxi->vx_initpid == p->pid) || - !thread_group_leader(p)) + (vc_data.pid && vxi->vx_initpid == p->pid)) continue; - err = send_sig_info(vc_data.sig, &info, p); + err = group_send_sig_info(vc_data.sig, + (void *)(long)(priv != 0), p); ++count; if (err != -EPERM) retval = err; @@ -66,21 +60,15 @@ int vc_ctx_kill(uint32_t id, void __user case 1: if (vxi->vx_initpid) { vc_data.pid = vxi->vx_initpid; - info.si_code = SI_KERNEL; + priv = 1; } /* fallthrough */ default: p = find_task_by_real_pid(vc_data.pid); if (p) { - if (!thread_group_leader(p)) { - struct task_struct *tg; - - tg = find_task_by_real_pid(p->tgid); - if (tg) - p = tg; - } if ((id == -1) || (vx_task_xid(p) == id)) - retval = send_sig_info(vc_data.sig, &info, p); + retval = group_send_sig_info(vc_data.sig, + (void*)(long)(priv != 0), p); } break; }