@@ -3698,7 +3698,7 @@ static int vfs_tmpfile(struct mnt_idmap *idmap,
inode->i_state |= I_LINKABLE;
spin_unlock(&inode->i_lock);
}
- ima_post_create_tmpfile(idmap, inode);
+ ima_post_create_tmpfile(idmap, dir, file, mode);
return 0;
}
@@ -19,7 +19,8 @@ extern enum hash_algo ima_get_current_hash_algo(void);
extern int ima_bprm_check(struct linux_binprm *bprm);
extern int ima_file_check(struct file *file, int mask);
extern void ima_post_create_tmpfile(struct mnt_idmap *idmap,
- struct inode *inode);
+ struct inode *dir, struct file *file,
+ umode_t mode);
extern void ima_file_free(struct file *file);
extern int ima_file_mmap(struct file *file, unsigned long reqprot,
unsigned long prot, unsigned long flags);
@@ -69,7 +70,9 @@ static inline int ima_file_check(struct file *file, int mask)
}
static inline void ima_post_create_tmpfile(struct mnt_idmap *idmap,
- struct inode *inode)
+ struct inode *dir,
+ struct file *file,
+ umode_t mode)
{
}
@@ -663,16 +663,20 @@ EXPORT_SYMBOL_GPL(ima_inode_hash);
/**
* ima_post_create_tmpfile - mark newly created tmpfile as new
* @idmap: idmap of the mount the inode was found from
- * @inode: inode of the newly created tmpfile
+ * @dir: inode structure of the parent of the new file
+ * @file: file descriptor of the new file
+ * @mode: mode of the new file
*
* No measuring, appraising or auditing of newly created tmpfiles is needed.
* Skip calling process_measurement(), but indicate which newly, created
* tmpfiles are in policy.
*/
void ima_post_create_tmpfile(struct mnt_idmap *idmap,
- struct inode *inode)
+ struct inode *dir, struct file *file,
+ umode_t mode)
{
struct integrity_iint_cache *iint;
+ struct inode *inode = file_inode(file);
int must_appraise;
if (!ima_policy_flag || !S_ISREG(inode->i_mode))