]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
UBUNTU: SAUCE: LSM stacking: inherit current display LSM
authorJohn Johansen <john.johansen@canonical.com>
Wed, 27 Sep 2017 04:45:16 +0000 (00:45 -0400)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 28 Sep 2017 20:54:26 +0000 (16:54 -0400)
If a current display LSM is set it should be inherited. As per 2017
LSS discussion.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
security/security.c

index d7ee5f8b8cfeda1a22004c9eec6176f10400b628..72f38cbadbb7da6bc352a395c5c97f6c747032a4 100644 (file)
@@ -452,6 +452,12 @@ int lsm_task_alloc(struct task_struct *task)
        task->security = kzalloc(blob_sizes.lbs_task, GFP_KERNEL);
        if (task->security == NULL)
                return -ENOMEM;
+
+       /* inherit current display lsm */
+#ifdef CONFIG_SECURITY_STACKING
+       if (current->security)
+               strcpy(task->security, lsm_of_task(current));
+#endif
        return 0;
 }