Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235092
b: refs/heads/master
c: 1adace9
h: refs/heads/master
v: v3
  • Loading branch information
Mimi Zohar committed Feb 23, 2011
1 parent 31f9845 commit 5301b13
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 854fdd55bfdd56cfc61bd30f2062a9268fcebba6
refs/heads/master: 1adace9bb04a5f4a4dea9e642089102661bb0ceb
3 changes: 1 addition & 2 deletions trunk/security/integrity/ima/ima.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ struct ima_iint_cache {
};

/* LIM API function definitions */
int ima_must_measure(struct ima_iint_cache *iint, struct inode *inode,
int mask, int function);
int ima_must_measure(struct inode *inode, int mask, int function);
int ima_collect_measurement(struct ima_iint_cache *iint, struct file *file);
void ima_store_measurement(struct ima_iint_cache *iint, struct file *file,
const unsigned char *filename);
Expand Down
13 changes: 3 additions & 10 deletions trunk/security/integrity/ima/ima_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,13 @@ void ima_add_violation(struct inode *inode, const unsigned char *filename,
* mask: contains the permission mask
* fsmagic: hex value
*
* Must be called with iint->mutex held.
*
* Return 0 to measure. Return 1 if already measured.
* For matching a DONT_MEASURE policy, no policy, or other
* error, return an error code.
* Return 0 to measure. For matching a DONT_MEASURE policy, no policy,
* or other error, return an error code.
*/
int ima_must_measure(struct ima_iint_cache *iint, struct inode *inode,
int mask, int function)
int ima_must_measure(struct inode *inode, int mask, int function)
{
int must_measure;

if (iint && iint->flags & IMA_MEASURED)
return 1;

must_measure = ima_match_policy(inode, function, mask);
return must_measure ? 0 : -EACCES;
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/security/integrity/ima/ima_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static void ima_rdwr_violation_check(struct file *file)
goto out;
}

rc = ima_must_measure(NULL, inode, MAY_READ, FILE_CHECK);
rc = ima_must_measure(inode, MAY_READ, FILE_CHECK);
if (rc < 0)
goto out;

Expand Down Expand Up @@ -127,7 +127,7 @@ static int process_measurement(struct file *file, const unsigned char *filename,
if (!ima_initialized || !S_ISREG(inode->i_mode))
return 0;

rc = ima_must_measure(NULL, inode, mask, function);
rc = ima_must_measure(inode, mask, function);
if (rc != 0)
return rc;
retry:
Expand All @@ -141,7 +141,7 @@ static int process_measurement(struct file *file, const unsigned char *filename,

mutex_lock(&iint->mutex);

rc = ima_must_measure(iint, inode, mask, function);
rc = iint->flags & IMA_MEASURED ? 1 : 0;
if (rc != 0)
goto out;

Expand Down

0 comments on commit 5301b13

Please sign in to comment.