summaryrefslogtreecommitdiff
path: root/fs/file_table.c
diff options
context:
space:
mode:
authorMimi Zohar <zohar@linux.vnet.ibm.com>2017-06-22 04:13:18 +0300
committerMimi Zohar <zohar@linux.vnet.ibm.com>2017-11-08 23:16:36 +0300
commitbb02b186d02f90f693bc573c392df843b024f4ef (patch)
treeb13e88ebb2cc873dd9ad72dc3cf9e3de69ecb32b /fs/file_table.c
parenta7d3d0392a325d630225b7dbccf2558f944114e5 (diff)
downloadlinux-bb02b186d02f90f693bc573c392df843b024f4ef.tar.xz
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>
Diffstat (limited to 'fs/file_table.c')
-rw-r--r--fs/file_table.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/file_table.c b/fs/file_table.c
index 61517f57f8ef..49e1f2f1a4cb 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -201,11 +201,11 @@ static void __fput(struct file *file)
eventpoll_release(file);
locks_remove_file(file);
+ ima_file_free(file);
if (unlikely(file->f_flags & FASYNC)) {
if (file->f_op->fasync)
file->f_op->fasync(-1, file, 0);
}
- ima_file_free(file);
if (file->f_op->release)
file->f_op->release(inode, file);
security_file_free(file);