diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-23 17:07:38 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-22 23:31:31 -0500 |
commit | 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch) | |
tree | 8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /security/apparmor | |
parent | 57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff) |
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/apparmor')
-rw-r--r-- | security/apparmor/domain.c | 4 | ||||
-rw-r--r-- | security/apparmor/file.c | 4 | ||||
-rw-r--r-- | security/apparmor/lsm.c | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index 60f0c76a27d3..859abdaac1ea 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c | |||
@@ -349,8 +349,8 @@ int apparmor_bprm_set_creds(struct linux_binprm *bprm) | |||
349 | unsigned int state; | 349 | unsigned int state; |
350 | struct file_perms perms = {}; | 350 | struct file_perms perms = {}; |
351 | struct path_cond cond = { | 351 | struct path_cond cond = { |
352 | bprm->file->f_path.dentry->d_inode->i_uid, | 352 | file_inode(bprm->file)->i_uid, |
353 | bprm->file->f_path.dentry->d_inode->i_mode | 353 | file_inode(bprm->file)->i_mode |
354 | }; | 354 | }; |
355 | const char *name = NULL, *target = NULL, *info = NULL; | 355 | const char *name = NULL, *target = NULL, *info = NULL; |
356 | int error = cap_bprm_set_creds(bprm); | 356 | int error = cap_bprm_set_creds(bprm); |
diff --git a/security/apparmor/file.c b/security/apparmor/file.c index cd21ec5b90af..fdaa50cb1876 100644 --- a/security/apparmor/file.c +++ b/security/apparmor/file.c | |||
@@ -449,8 +449,8 @@ int aa_file_perm(int op, struct aa_profile *profile, struct file *file, | |||
449 | u32 request) | 449 | u32 request) |
450 | { | 450 | { |
451 | struct path_cond cond = { | 451 | struct path_cond cond = { |
452 | .uid = file->f_path.dentry->d_inode->i_uid, | 452 | .uid = file_inode(file)->i_uid, |
453 | .mode = file->f_path.dentry->d_inode->i_mode | 453 | .mode = file_inode(file)->i_mode |
454 | }; | 454 | }; |
455 | 455 | ||
456 | return aa_path_perm(op, profile, &file->f_path, PATH_DELEGATE_DELETED, | 456 | return aa_path_perm(op, profile, &file->f_path, PATH_DELEGATE_DELETED, |
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(); |