diff options
| author | David Howells <dhowells@redhat.com> | 2015-03-17 18:26:22 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-15 15:06:56 -0400 |
| commit | c6f493d631c4d40cea5c36055f9148f547b200af (patch) | |
| tree | 233b04dca85cd796dffe1284a55b1fba24d0d59a /security/apparmor | |
| parent | c5ef60352893b139147b7c033354e8e028e7f52a (diff) | |
VFS: security/: d_backing_inode() annotations
most of the ->d_inode uses there refer to the same inode IO would
go to, i.e. d_backing_inode()
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/apparmor')
| -rw-r--r-- | security/apparmor/file.c | 6 | ||||
| -rw-r--r-- | security/apparmor/lsm.c | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/security/apparmor/file.c b/security/apparmor/file.c index fdaa50cb1876..913f377a038a 100644 --- a/security/apparmor/file.c +++ b/security/apparmor/file.c | |||
| @@ -259,7 +259,7 @@ unsigned int aa_str_perms(struct aa_dfa *dfa, unsigned int start, | |||
| 259 | */ | 259 | */ |
| 260 | static inline bool is_deleted(struct dentry *dentry) | 260 | static inline bool is_deleted(struct dentry *dentry) |
| 261 | { | 261 | { |
| 262 | if (d_unlinked(dentry) && dentry->d_inode->i_nlink == 0) | 262 | if (d_unlinked(dentry) && d_backing_inode(dentry)->i_nlink == 0) |
| 263 | return 1; | 263 | return 1; |
| 264 | return 0; | 264 | return 0; |
| 265 | } | 265 | } |
| @@ -351,8 +351,8 @@ int aa_path_link(struct aa_profile *profile, struct dentry *old_dentry, | |||
| 351 | struct path link = { new_dir->mnt, new_dentry }; | 351 | struct path link = { new_dir->mnt, new_dentry }; |
| 352 | struct path target = { new_dir->mnt, old_dentry }; | 352 | struct path target = { new_dir->mnt, old_dentry }; |
| 353 | struct path_cond cond = { | 353 | struct path_cond cond = { |
| 354 | old_dentry->d_inode->i_uid, | 354 | d_backing_inode(old_dentry)->i_uid, |
| 355 | old_dentry->d_inode->i_mode | 355 | d_backing_inode(old_dentry)->i_mode |
| 356 | }; | 356 | }; |
| 357 | char *buffer = NULL, *buffer2 = NULL; | 357 | char *buffer = NULL, *buffer2 = NULL; |
| 358 | const char *lname, *tname = NULL, *info = NULL; | 358 | const char *lname, *tname = NULL, *info = NULL; |
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index dd56bffd6500..e5f1561439db 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c | |||
| @@ -204,8 +204,8 @@ static int common_perm_mnt_dentry(int op, struct vfsmount *mnt, | |||
| 204 | struct dentry *dentry, u32 mask) | 204 | struct dentry *dentry, u32 mask) |
| 205 | { | 205 | { |
| 206 | struct path path = { mnt, dentry }; | 206 | struct path path = { mnt, dentry }; |
| 207 | struct path_cond cond = { dentry->d_inode->i_uid, | 207 | struct path_cond cond = { d_backing_inode(dentry)->i_uid, |
| 208 | dentry->d_inode->i_mode | 208 | d_backing_inode(dentry)->i_mode |
| 209 | }; | 209 | }; |
| 210 | 210 | ||
| 211 | return common_perm(op, &path, mask, &cond); | 211 | return common_perm(op, &path, mask, &cond); |
| @@ -223,7 +223,7 @@ static int common_perm_mnt_dentry(int op, struct vfsmount *mnt, | |||
| 223 | static int common_perm_rm(int op, struct path *dir, | 223 | static int common_perm_rm(int op, struct path *dir, |
| 224 | struct dentry *dentry, u32 mask) | 224 | struct dentry *dentry, u32 mask) |
| 225 | { | 225 | { |
| 226 | struct inode *inode = dentry->d_inode; | 226 | struct inode *inode = d_backing_inode(dentry); |
| 227 | struct path_cond cond = { }; | 227 | struct path_cond cond = { }; |
| 228 | 228 | ||
| 229 | if (!inode || !dir->mnt || !mediated_filesystem(dentry)) | 229 | if (!inode || !dir->mnt || !mediated_filesystem(dentry)) |
| @@ -281,8 +281,8 @@ static int apparmor_path_mknod(struct path *dir, struct dentry *dentry, | |||
| 281 | 281 | ||
| 282 | static int apparmor_path_truncate(struct path *path) | 282 | static int apparmor_path_truncate(struct path *path) |
| 283 | { | 283 | { |
| 284 | struct path_cond cond = { path->dentry->d_inode->i_uid, | 284 | struct path_cond cond = { d_backing_inode(path->dentry)->i_uid, |
| 285 | path->dentry->d_inode->i_mode | 285 | d_backing_inode(path->dentry)->i_mode |
| 286 | }; | 286 | }; |
| 287 | 287 | ||
| 288 | if (!path->mnt || !mediated_filesystem(path->dentry)) | 288 | if (!path->mnt || !mediated_filesystem(path->dentry)) |
| @@ -327,8 +327,8 @@ static int apparmor_path_rename(struct path *old_dir, struct dentry *old_dentry, | |||
| 327 | if (!unconfined(profile)) { | 327 | if (!unconfined(profile)) { |
| 328 | struct path old_path = { old_dir->mnt, old_dentry }; | 328 | struct path old_path = { old_dir->mnt, old_dentry }; |
| 329 | struct path new_path = { new_dir->mnt, new_dentry }; | 329 | struct path new_path = { new_dir->mnt, new_dentry }; |
| 330 | struct path_cond cond = { old_dentry->d_inode->i_uid, | 330 | struct path_cond cond = { d_backing_inode(old_dentry)->i_uid, |
| 331 | old_dentry->d_inode->i_mode | 331 | d_backing_inode(old_dentry)->i_mode |
| 332 | }; | 332 | }; |
| 333 | 333 | ||
| 334 | error = aa_path_perm(OP_RENAME_SRC, profile, &old_path, 0, | 334 | error = aa_path_perm(OP_RENAME_SRC, profile, &old_path, 0, |
| @@ -354,8 +354,8 @@ static int apparmor_path_chmod(struct path *path, umode_t mode) | |||
| 354 | 354 | ||
| 355 | static int apparmor_path_chown(struct path *path, kuid_t uid, kgid_t gid) | 355 | static int apparmor_path_chown(struct path *path, kuid_t uid, kgid_t gid) |
| 356 | { | 356 | { |
| 357 | struct path_cond cond = { path->dentry->d_inode->i_uid, | 357 | struct path_cond cond = { d_backing_inode(path->dentry)->i_uid, |
| 358 | path->dentry->d_inode->i_mode | 358 | d_backing_inode(path->dentry)->i_mode |
| 359 | }; | 359 | }; |
| 360 | 360 | ||
| 361 | if (!mediated_filesystem(path->dentry)) | 361 | if (!mediated_filesystem(path->dentry)) |
