diff mbox

[06/14] UBUNTU: SAUCE: apparmor: fix oops in bind_mnt when dev_path lookup fails

Message ID 20170201091310.22695-7-john.johansen@canonical.com
State New
Headers show

Commit Message

John Johansen Feb. 1, 2017, 9:13 a.m. UTC
Bind mounts can oops when devname lookup fails because the devname is
uninitialized and used in auditing the denial.

BugLink: http://bugs.launchpad.net/bugs/1660840
Signed-off-by: John Johansen <john.johansen@canonical.com>
---
 security/apparmor/mount.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/security/apparmor/mount.c b/security/apparmor/mount.c
index 907d3f0..e780181 100644
--- a/security/apparmor/mount.c
+++ b/security/apparmor/mount.c
@@ -335,6 +335,7 @@  static int match_mnt_path_str(struct aa_profile *profile, const struct path *mnt
 		goto audit;
 	if (IS_ERR(devname)) {
 		error = PTR_ERR(devname);
+		devname = NULL;
 		info = devinfo;
 		goto audit;
 	}