Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+1 -1
+1 -1
fs/file_table.c
··· 201 201 eventpoll_release(file); 202 202 locks_remove_file(file); 203 203 204 + ima_file_free(file); 204 205 if (unlikely(file->f_flags & FASYNC)) { 205 206 if (file->f_op->fasync) 206 207 file->f_op->fasync(-1, file, 0); 207 208 } 208 - ima_file_free(file); 209 209 if (file->f_op->release) 210 210 file->f_op->release(inode, file); 211 211 security_file_free(file);