[PATCH 07/14] UBUNTU: SAUCE: apparmor: fix not handling error case when securityfs_pin_fs() fails

John Johansen john.johansen at canonical.com
Wed Feb 1 09:13:03 UTC 2017


BugLink: http://bugs.launchpad.net/bugs/1660842
Signed-off-by: John Johansen <john.johansen at canonical.com>
---
 security/apparmor/apparmorfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index b8ba1bb..019dba8 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -1049,8 +1049,10 @@ static int ns_mkdir_op(struct inode *dir, struct dentry *dentry, umode_t mode)
 	 * for pin_fs
 	 */
 	inode_unlock(dir);
-	securityfs_pin_fs();
+	error = securityfs_pin_fs();
 	inode_lock_nested(dir, I_MUTEX_PARENT);
+	if (error)
+		return error;
 
 	error = __securityfs_setup_d_inode(dir, dentry, mode | S_IFDIR,  NULL,
 					   NULL, NULL);
-- 
2.9.3





More information about the kernel-team mailing list