diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-07 14:18:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-07 14:18:28 -0500 |
commit | 6339204ecc2aa2067a99595522de0403f0854bb8 (patch) | |
tree | 02665f55428bf646722cdc59750d2c2dee0595d1 /fs | |
parent | 80e1e823989ec44d8e35bdfddadbddcffec90424 (diff) | |
parent | 89068c576bf324ef6fbd50dfc745148f7def202c (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
Take ima_file_free() to proper place.
ima: rename PATH_CHECK to FILE_CHECK
ima: rename ima_path_check to ima_file_check
ima: initialize ima before inodes can be allocated
fix ima breakage
Take ima_path_check() in nfsd past dentry_open() in nfsd_open()
freeze_bdev: don't deactivate successfully frozen MS_RDONLY sb
befs: fix leak
Diffstat (limited to 'fs')
-rw-r--r-- | fs/befs/linuxvfs.c | 1 | ||||
-rw-r--r-- | fs/block_dev.c | 7 | ||||
-rw-r--r-- | fs/file_table.c | 1 | ||||
-rw-r--r-- | fs/namei.c | 6 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 2 |
5 files changed, 9 insertions, 8 deletions
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index 33baf27fac78..34ddda888e63 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c | |||
@@ -873,6 +873,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent) | |||
873 | brelse(bh); | 873 | brelse(bh); |
874 | 874 | ||
875 | unacquire_priv_sbp: | 875 | unacquire_priv_sbp: |
876 | kfree(befs_sb->mount_opts.iocharset); | ||
876 | kfree(sb->s_fs_info); | 877 | kfree(sb->s_fs_info); |
877 | 878 | ||
878 | unacquire_none: | 879 | unacquire_none: |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 73d6a735b8f3..d11d0289f3d2 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -246,7 +246,8 @@ struct super_block *freeze_bdev(struct block_device *bdev) | |||
246 | if (!sb) | 246 | if (!sb) |
247 | goto out; | 247 | goto out; |
248 | if (sb->s_flags & MS_RDONLY) { | 248 | if (sb->s_flags & MS_RDONLY) { |
249 | deactivate_locked_super(sb); | 249 | sb->s_frozen = SB_FREEZE_TRANS; |
250 | up_write(&sb->s_umount); | ||
250 | mutex_unlock(&bdev->bd_fsfreeze_mutex); | 251 | mutex_unlock(&bdev->bd_fsfreeze_mutex); |
251 | return sb; | 252 | return sb; |
252 | } | 253 | } |
@@ -307,7 +308,7 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb) | |||
307 | BUG_ON(sb->s_bdev != bdev); | 308 | BUG_ON(sb->s_bdev != bdev); |
308 | down_write(&sb->s_umount); | 309 | down_write(&sb->s_umount); |
309 | if (sb->s_flags & MS_RDONLY) | 310 | if (sb->s_flags & MS_RDONLY) |
310 | goto out_deactivate; | 311 | goto out_unfrozen; |
311 | 312 | ||
312 | if (sb->s_op->unfreeze_fs) { | 313 | if (sb->s_op->unfreeze_fs) { |
313 | error = sb->s_op->unfreeze_fs(sb); | 314 | error = sb->s_op->unfreeze_fs(sb); |
@@ -321,11 +322,11 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb) | |||
321 | } | 322 | } |
322 | } | 323 | } |
323 | 324 | ||
325 | out_unfrozen: | ||
324 | sb->s_frozen = SB_UNFROZEN; | 326 | sb->s_frozen = SB_UNFROZEN; |
325 | smp_wmb(); | 327 | smp_wmb(); |
326 | wake_up(&sb->s_wait_unfrozen); | 328 | wake_up(&sb->s_wait_unfrozen); |
327 | 329 | ||
328 | out_deactivate: | ||
329 | if (sb) | 330 | if (sb) |
330 | deactivate_locked_super(sb); | 331 | deactivate_locked_super(sb); |
331 | out_unlock: | 332 | out_unlock: |
diff --git a/fs/file_table.c b/fs/file_table.c index 69652c5bd5f0..b98404b54383 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
@@ -253,6 +253,7 @@ void __fput(struct file *file) | |||
253 | if (file->f_op && file->f_op->release) | 253 | if (file->f_op && file->f_op->release) |
254 | file->f_op->release(inode, file); | 254 | file->f_op->release(inode, file); |
255 | security_file_free(file); | 255 | security_file_free(file); |
256 | ima_file_free(file); | ||
256 | if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL)) | 257 | if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL)) |
257 | cdev_put(inode->i_cdev); | 258 | cdev_put(inode->i_cdev); |
258 | fops_put(file->f_op); | 259 | fops_put(file->f_op); |
diff --git a/fs/namei.c b/fs/namei.c index 94a5e60779f9..d62fdc875f22 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1736,8 +1736,7 @@ do_last: | |||
1736 | if (nd.root.mnt) | 1736 | if (nd.root.mnt) |
1737 | path_put(&nd.root); | 1737 | path_put(&nd.root); |
1738 | if (!IS_ERR(filp)) { | 1738 | if (!IS_ERR(filp)) { |
1739 | error = ima_path_check(&filp->f_path, filp->f_mode & | 1739 | error = ima_file_check(filp, acc_mode); |
1740 | (MAY_READ | MAY_WRITE | MAY_EXEC)); | ||
1741 | if (error) { | 1740 | if (error) { |
1742 | fput(filp); | 1741 | fput(filp); |
1743 | filp = ERR_PTR(error); | 1742 | filp = ERR_PTR(error); |
@@ -1797,8 +1796,7 @@ ok: | |||
1797 | } | 1796 | } |
1798 | filp = nameidata_to_filp(&nd); | 1797 | filp = nameidata_to_filp(&nd); |
1799 | if (!IS_ERR(filp)) { | 1798 | if (!IS_ERR(filp)) { |
1800 | error = ima_path_check(&filp->f_path, filp->f_mode & | 1799 | error = ima_file_check(filp, acc_mode); |
1801 | (MAY_READ | MAY_WRITE | MAY_EXEC)); | ||
1802 | if (error) { | 1800 | if (error) { |
1803 | fput(filp); | 1801 | fput(filp); |
1804 | filp = ERR_PTR(error); | 1802 | filp = ERR_PTR(error); |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index c194793b642b..97d79eff6b7f 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -752,6 +752,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
752 | flags, current_cred()); | 752 | flags, current_cred()); |
753 | if (IS_ERR(*filp)) | 753 | if (IS_ERR(*filp)) |
754 | host_err = PTR_ERR(*filp); | 754 | host_err = PTR_ERR(*filp); |
755 | host_err = ima_file_check(*filp, access); | ||
755 | out_nfserr: | 756 | out_nfserr: |
756 | err = nfserrno(host_err); | 757 | err = nfserrno(host_err); |
757 | out: | 758 | out: |
@@ -2127,7 +2128,6 @@ nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp, | |||
2127 | */ | 2128 | */ |
2128 | path.mnt = exp->ex_path.mnt; | 2129 | path.mnt = exp->ex_path.mnt; |
2129 | path.dentry = dentry; | 2130 | path.dentry = dentry; |
2130 | err = ima_path_check(&path, acc & (MAY_READ | MAY_WRITE | MAY_EXEC)); | ||
2131 | nfsd_out: | 2131 | nfsd_out: |
2132 | return err? nfserrno(err) : 0; | 2132 | return err? nfserrno(err) : 0; |
2133 | } | 2133 | } |