]> git.proxmox.com Git - mirror_ubuntu-bionic-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>
Tue, 10 Apr 2018 18:06:18 +0000 (13:06 -0500)
BugLink: http://bugs.launchpad.net/bugs/1763062
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 b02f854b7981a845b75d12a9149bcfcb820a77e3..5439dc346539bb90288eade50b93330bcb0c60f6 100644 (file)
@@ -461,6 +461,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;
 }