aboutsummaryrefslogtreecommitdiffstats
path: root/security/apparmor/lsm.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/apparmor/lsm.c')
-rw-r--r--security/apparmor/lsm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 8c2a7f6b35e2..b21830eced41 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -379,7 +379,7 @@ static int apparmor_file_open(struct file *file, const struct cred *cred)
379 struct aa_profile *profile; 379 struct aa_profile *profile;
380 int error = 0; 380 int error = 0;
381 381
382 if (!mediated_filesystem(file->f_path.dentry->d_inode)) 382 if (!mediated_filesystem(file_inode(file)))
383 return 0; 383 return 0;
384 384
385 /* If in exec, permission is handled by bprm hooks. 385 /* If in exec, permission is handled by bprm hooks.
@@ -394,7 +394,7 @@ static int apparmor_file_open(struct file *file, const struct cred *cred)
394 394
395 profile = aa_cred_profile(cred); 395 profile = aa_cred_profile(cred);
396 if (!unconfined(profile)) { 396 if (!unconfined(profile)) {
397 struct inode *inode = file->f_path.dentry->d_inode; 397 struct inode *inode = file_inode(file);
398 struct path_cond cond = { inode->i_uid, inode->i_mode }; 398 struct path_cond cond = { inode->i_uid, inode->i_mode };
399 399
400 error = aa_path_perm(OP_OPEN, profile, &file->f_path, 0, 400 error = aa_path_perm(OP_OPEN, profile, &file->f_path, 0,
@@ -432,7 +432,7 @@ static int common_file_perm(int op, struct file *file, u32 mask)
432 BUG_ON(!fprofile); 432 BUG_ON(!fprofile);
433 433
434 if (!file->f_path.mnt || 434 if (!file->f_path.mnt ||
435 !mediated_filesystem(file->f_path.dentry->d_inode)) 435 !mediated_filesystem(file_inode(file)))
436 return 0; 436 return 0;
437 437
438 profile = __aa_current_profile(); 438 profile = __aa_current_profile();