Skip to content

Commit

Permalink
ima: fix bug in argument order
Browse files Browse the repository at this point in the history
mask argument goes first, then func, like ima_must_measure
and ima_get_action. ima_inode_post_setattr() assumes that.

Signed-off-by: Dmitry Kasatkin <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
Dmitry Kasatkin authored and James Morris committed Oct 5, 2012
1 parent ecefbd9 commit d26e193
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions security/integrity/ima/ima.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void ima_delete_rules(void);
#ifdef CONFIG_IMA_APPRAISE
int ima_appraise_measurement(struct integrity_iint_cache *iint,
struct file *file, const unsigned char *filename);
int ima_must_appraise(struct inode *inode, enum ima_hooks func, int mask);
int ima_must_appraise(struct inode *inode, int mask, enum ima_hooks func);
void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file);

#else
Expand All @@ -154,8 +154,8 @@ static inline int ima_appraise_measurement(struct integrity_iint_cache *iint,
return INTEGRITY_UNKNOWN;
}

static inline int ima_must_appraise(struct inode *inode,
enum ima_hooks func, int mask)
static inline int ima_must_appraise(struct inode *inode, int mask,
enum ima_hooks func)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion security/integrity/ima/ima_appraise.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ __setup("ima_appraise=", default_appraise_setup);
*
* Return 1 to appraise
*/
int ima_must_appraise(struct inode *inode, enum ima_hooks func, int mask)
int ima_must_appraise(struct inode *inode, int mask, enum ima_hooks func)
{
if (!ima_appraise)
return 0;
Expand Down

0 comments on commit d26e193

Please sign in to comment.