History

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.

Mimi Zohar committed 9 years ago

Commit bb02b181 parent a7d3d031 file · +1 −1Browse files

Unified · Split

fs/file_table.c+1−1
@@ -201,11 +201,11 @@ static void __fput(struct file *file) · 200 unmodified lines
201 eventpoll_release(file);201 eventpoll_release(file);
202 locks_remove_file(file);202 locks_remove_file(file);
203 203
204 ima_file_free(file);
204 if (unlikely(file->f_flags & FASYNC)) {205 if (unlikely(file->f_flags & FASYNC)) {
205 if (file->f_op->fasync)206 if (file->f_op->fasync)
206 file->f_op->fasync(-1, file, 0);207 file->f_op->fasync(-1, file, 0);
207 }208 }
208 ima_file_free(file);
209 if (file->f_op->release)209 if (file->f_op->release)
210 file->f_op->release(inode, file);210 file->f_op->release(inode, file);
211 security_file_free(file);211 security_file_free(file);