Merge branch 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[muen/linux.git] / security / apparmor / lsm.c
index 6134302..528f59b 100644 (file)
@@ -716,16 +716,23 @@ static int apparmor_task_setrlimit(struct task_struct *task,
 }
 
 static int apparmor_task_kill(struct task_struct *target, struct siginfo *info,
-                             int sig, u32 secid)
+                             int sig, const struct cred *cred)
 {
        struct aa_label *cl, *tl;
        int error;
 
-       if (secid)
-               /* TODO: after secid to label mapping is done.
-                *  Dealing with USB IO specific behavior
+       if (cred) {
+               /*
+                * Dealing with USB IO specific behavior
                 */
-               return 0;
+               cl = aa_get_newest_cred_label(cred);
+               tl = aa_get_task_label(target);
+               error = aa_may_signal(cl, tl, sig);
+               aa_put_label(cl);
+               aa_put_label(tl);
+               return error;
+       }
+
        cl = __begin_current_label_crit_section();
        tl = aa_get_task_label(target);
        error = aa_may_signal(cl, tl, sig);