Merge branch 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[muen/linux.git] / security / selinux / hooks.c
index 0314fc7..2b8c55e 100644 (file)
@@ -4156,16 +4156,19 @@ static int selinux_task_movememory(struct task_struct *p)
 }
 
 static int selinux_task_kill(struct task_struct *p, struct siginfo *info,
-                               int sig, u32 secid)
+                               int sig, const struct cred *cred)
 {
+       u32 secid;
        u32 perm;
 
        if (!sig)
                perm = PROCESS__SIGNULL; /* null signal; existence test */
        else
                perm = signal_to_av(sig);
-       if (!secid)
+       if (!cred)
                secid = current_sid();
+       else
+               secid = cred_sid(cred);
        return avc_has_perm(&selinux_state,
                            secid, task_sid(p), SECCLASS_PROCESS, perm, NULL);
 }