Commit 3bfa784a6539f91a27d7ffdd408efdb638e3bebd
1 parent
1b5d783c94
Exists in
master
and in
4 other branches
kill file_permission() completely
convert the last remaining caller to inode_permission() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 3 changed files with 2 additions and 20 deletions Side-by-side Diff
fs/namei.c
... | ... | @@ -303,23 +303,6 @@ |
303 | 303 | return security_inode_permission(inode, mask); |
304 | 304 | } |
305 | 305 | |
306 | -/** | |
307 | - * file_permission - check for additional access rights to a given file | |
308 | - * @file: file to check access rights for | |
309 | - * @mask: right to check for (%MAY_READ, %MAY_WRITE, %MAY_EXEC) | |
310 | - * | |
311 | - * Used to check for read/write/execute permissions on an already opened | |
312 | - * file. | |
313 | - * | |
314 | - * Note: | |
315 | - * Do not use this function in new code. All access checks should | |
316 | - * be done using inode_permission(). | |
317 | - */ | |
318 | -int file_permission(struct file *file, int mask) | |
319 | -{ | |
320 | - return inode_permission(file->f_path.dentry->d_inode, mask); | |
321 | -} | |
322 | - | |
323 | 306 | /* |
324 | 307 | * get_write_access() gets write permission for a file. |
325 | 308 | * put_write_access() releases this write permission. |
... | ... | @@ -3405,7 +3388,6 @@ |
3405 | 3388 | EXPORT_SYMBOL(kern_path); |
3406 | 3389 | EXPORT_SYMBOL(vfs_path_lookup); |
3407 | 3390 | EXPORT_SYMBOL(inode_permission); |
3408 | -EXPORT_SYMBOL(file_permission); | |
3409 | 3391 | EXPORT_SYMBOL(unlock_rename); |
3410 | 3392 | EXPORT_SYMBOL(vfs_create); |
3411 | 3393 | EXPORT_SYMBOL(vfs_follow_link); |
include/linux/fs.h
kernel/cgroup.c
... | ... | @@ -3542,7 +3542,8 @@ |
3542 | 3542 | } |
3543 | 3543 | |
3544 | 3544 | /* the process need read permission on control file */ |
3545 | - ret = file_permission(cfile, MAY_READ); | |
3545 | + /* AV: shouldn't we check that it's been opened for read instead? */ | |
3546 | + ret = inode_permission(cfile->f_path.dentry->d_inode, MAY_READ); | |
3546 | 3547 | if (ret < 0) |
3547 | 3548 | goto fail; |
3548 | 3549 |