浏览代码

ima: call ima_file_free() prior to calling fasync

The file hash is calculated and written out as an xattr after
calling fasync().  In order for the file data and metadata to be
written out to disk at the same time, this patch calculates the
file hash and stores it as an xattr before calling fasync.

Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Mimi Zohar 8 年之前
父节点
当前提交
bb02b186d0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/file_table.c

+ 1 - 1
fs/file_table.c

@@ -201,11 +201,11 @@ static void __fput(struct file *file)
 	eventpoll_release(file);
 	eventpoll_release(file);
 	locks_remove_file(file);
 	locks_remove_file(file);
 
 
+	ima_file_free(file);
 	if (unlikely(file->f_flags & FASYNC)) {
 	if (unlikely(file->f_flags & FASYNC)) {
 		if (file->f_op->fasync)
 		if (file->f_op->fasync)
 			file->f_op->fasync(-1, file, 0);
 			file->f_op->fasync(-1, file, 0);
 	}
 	}
-	ima_file_free(file);
 	if (file->f_op->release)
 	if (file->f_op->release)
 		file->f_op->release(inode, file);
 		file->f_op->release(inode, file);
 	security_file_free(file);
 	security_file_free(file);