[PATCH 05/14] ima: move ima_file_free before releasing the file

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Mimi Zohar
Date: Wednesday, April 21, 2010 - 2:49 pm

Integrity appraisal measures files on file_free and stores the file
measurement as an xattr.  Measure the file before releasing it.

Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>

diff --git a/fs/file_table.c b/fs/file_table.c
index 32d12b7..fac3e43 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -250,10 +250,10 @@ void __fput(struct file *file)
 		if (file->f_op && file->f_op->fasync)
 			file->f_op->fasync(-1, file, 0);
 	}
+	ima_file_free(file);
 	if (file->f_op && file->f_op->release)
 		file->f_op->release(inode, file);
 	security_file_free(file);
-	ima_file_free(file);
 	if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL))
 		cdev_put(inode->i_cdev);
 	fops_put(file->f_op);
-- 
1.6.6.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/14] EVM, Mimi Zohar, (Wed Apr 21, 2:49 pm)
[PATCH 04/14] evm: re-release, Mimi Zohar, (Wed Apr 21, 2:49 pm)
[PATCH 05/14] ima: move ima_file_free before releasing the ..., Mimi Zohar, (Wed Apr 21, 2:49 pm)
[PATCH 07/14] evm: inode post removexattr, Mimi Zohar, (Wed Apr 21, 2:49 pm)
[PATCH 08/14] evm: imbed evm_inode_post_setattr, Mimi Zohar, (Wed Apr 21, 2:49 pm)
[PATCH 09/14] evm: inode_post_init, Mimi Zohar, (Wed Apr 21, 2:49 pm)
[PATCH 10/14] fs: add evm_inode_post_init calls, Mimi Zohar, (Wed Apr 21, 2:49 pm)
[PATCH 11/14] ima: integrity appraisal extension, Mimi Zohar, (Wed Apr 21, 2:49 pm)
[PATCH 12/14] ima: appraise default rules, Mimi Zohar, (Wed Apr 21, 2:49 pm)
[PATCH 13/14] ima: inode post_setattr, Mimi Zohar, (Wed Apr 21, 2:49 pm)
Re: [PATCH 00/14] EVM, Randy Dunlap, (Wed Apr 21, 2:58 pm)
Re: [PATCH 00/14] EVM, Mimi Zohar, (Wed Apr 21, 3:18 pm)
Re: [PATCH 00/14] EVM, Randy Dunlap, (Wed Apr 21, 3:23 pm)
Re: [PATCH 00/14] EVM, Mimi Zohar, (Wed Apr 21, 3:41 pm)
Re: [PATCH 04/14] evm: re-release, Serge E. Hallyn, (Mon Apr 26, 2:03 pm)
Re: [PATCH 00/14] EVM, James Morris, (Sun May 30, 5:20 pm)
Re: [PATCH 00/14] EVM, Shaz, (Mon May 31, 3:02 am)
Re: [PATCH 00/14] EVM, Shaz, (Mon May 31, 3:08 am)
Re: [PATCH 00/14] EVM, Mimi Zohar, (Tue Jun 1, 12:28 pm)
Re: [PATCH 00/14] EVM, Dmitry Kasatkin, (Wed Jun 2, 12:03 am)
Re: [PATCH 00/14] EVM, Shaz, (Wed Jun 2, 12:50 am)
Re: [PATCH 00/14] EVM, Dmitry Kasatkin, (Wed Jun 2, 2:12 am)
Re: [PATCH 00/14] EVM, Shaz, (Wed Jun 2, 3:15 am)
Re: [PATCH 00/14] EVM, Dmitry Kasatkin, (Wed Jun 2, 3:23 am)
Re: [PATCH 00/14] EVM, Mimi Zohar, (Wed Jun 2, 7:02 am)
Re: [PATCH 00/14] EVM, James Morris, (Thu Jun 3, 5:57 pm)
Re: [PATCH 00/14] EVM, Shaz, (Thu Jun 3, 11:53 pm)
Re: [PATCH 00/14] EVM, Shaz, (Thu Jun 3, 11:56 pm)
Re: [PATCH 04/14] evm: re-release, Stephen Smalley, (Fri Jun 4, 7:28 am)
Re: [PATCH 04/14] evm: re-release, Mimi Zohar, (Fri Jun 4, 7:53 am)
Re: [PATCH 00/14] EVM, Mimi Zohar, (Fri Jun 4, 8:09 am)
Re: [PATCH 04/14] evm: re-release, Stephen Smalley, (Fri Jun 4, 8:20 am)
Re: [PATCH 04/14] evm: re-release, David Safford, (Fri Jun 4, 11:08 am)
Re: [PATCH 00/14] EVM, Shaz, (Fri Jun 4, 11:47 am)
Re: [ProbableSpam] Re: [PATCH 00/14] EVM, David Safford, (Fri Jun 4, 1:25 pm)