diff mbox

[13/14] UBUNTU: SAUCE: apparmor: deleted dentries can be disconnected

Message ID 1471943154-14507-14-git-send-email-john.johansen@canonical.com
State New
Headers show

Commit Message

John Johansen Aug. 23, 2016, 9:05 a.m. UTC
BugLink: http://bugs.launchpad.net/bugs/1615892

Signed-off-by: John Johansen <john.johansen@canonical.com>
---
 security/apparmor/path.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/security/apparmor/path.c b/security/apparmor/path.c
index 6cea2a6..4d45493 100644
--- a/security/apparmor/path.c
+++ b/security/apparmor/path.c
@@ -152,6 +152,9 @@  static int d_namespace_path(struct path *path, char *buf, char **name,
 
 	*name = res;
 
+	if (!connected)
+		error = disconnect(path, buf, name, flags, disconnected);
+
 	/* Handle two cases:
 	 * 1. A deleted dentry && profile is not allowing mediation of deleted
 	 * 2. On some filesystems, newly allocated dentries appear to the
@@ -164,9 +167,6 @@  static int d_namespace_path(struct path *path, char *buf, char **name,
 			goto out;
 	}
 
-	if (!connected)
-		error = disconnect(path, buf, name, flags, disconnected);
-
 out:
 	/*
 	 * Append "/" to the pathname.  The root directory is a special