From: Mimi Zohar Date: Thu, 22 Jun 2017 01:13:18 +0000 (-0400) Subject: ima: call ima_file_free() prior to calling fasync X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=bb02b186d02f90f693bc573c392df843b024f4ef;p=openwrt%2Fstaging%2Fblogic.git 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 --- 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);