Message ID | 20170331125744.16986-6-john.johansen@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 330437c..a93b701 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -443,6 +443,9 @@ static int common_file_perm(const char *op, struct file *file, u32 mask) struct aa_label *label; int error = 0; + if (file->f_path.dentry == aa_null.dentry) + return -EACCES; + label = aa_begin_current_label(NO_UPDATE); error = aa_file_perm(op, label, file, mask); aa_end_current_label(label);