diff mbox

[precise] UBUNTU: SAUCE: (no-up) apparmor: fix mount not handling disconnected paths

Message ID 560D75A7.5010709@canonical.com
State New
Headers show

Commit Message

John Johansen Oct. 1, 2015, 6:04 p.m. UTC
From a1f083ef2a15a0e6c098f088880bd20af784dead Mon Sep 17 00:00:00 2001
From: John Johansen <john.johansen@canonical.com>
Date: Thu, 1 Oct 2015 10:10:35 -0700
Subject: [PATCH] UBUNTU: SAUCE: (no-up) apparmor: fix mount not handling
 disconnected paths

upstream: No. This is a fix to an out of tree apparmor 3 patch

BugLink: http://bugs.launchpad.net/bugs/1496430

Mount rules are not honoring the attach_disconnected flag, causing
apparmor to deny mounts for lxc and docker even when the appropriate
rule exists in the profile.

Signed-off-by: John Johansen <john.johansen@canonical.com>
---
 security/apparmor/mount.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luis Henriques Oct. 1, 2015, 6:28 p.m. UTC | #1
Ack'ed and applied to Precise master-next branch.

Cheers,
--
Luís
diff mbox

Patch

diff --git a/security/apparmor/mount.c b/security/apparmor/mount.c
index 872d92d..f7d25f3 100644
--- a/security/apparmor/mount.c
+++ b/security/apparmor/mount.c
@@ -331,7 +331,7 @@  static int match_mnt(struct aa_profile *profile, const char *mntpnt,
 static int path_flags(struct aa_profile *profile, struct path *path)
 {
 	return profile->path_flags |
-		S_ISDIR(path->dentry->d_inode->i_mode) ? PATH_IS_DIR : 0;
+		(S_ISDIR(path->dentry->d_inode->i_mode) ? PATH_IS_DIR : 0);
 }
 
 int aa_remount(struct aa_profile *profile, struct path *path,