ima: extend ima_get_action() to return the policy pcr
Different policy rules may extend different PCRs. This patch retrieves the specific PCR for the matched rule. Subsequent patches will include the rule specific PCR in the measurement list and extend the appropriate PCR. Signed-off-by: Eric Richter <erichte@linux.vnet.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
This commit is contained in:
@@ -162,6 +162,7 @@ static int process_measurement(struct file *file, char *buf, loff_t size,
|
||||
char *pathbuf = NULL;
|
||||
const char *pathname = NULL;
|
||||
int rc = -ENOMEM, action, must_appraise;
|
||||
int pcr = CONFIG_IMA_MEASURE_PCR_IDX;
|
||||
struct evm_ima_xattr_data *xattr_value = NULL;
|
||||
int xattr_len = 0;
|
||||
bool violation_check;
|
||||
@@ -174,7 +175,7 @@ static int process_measurement(struct file *file, char *buf, loff_t size,
|
||||
* bitmask based on the appraise/audit/measurement policy.
|
||||
* Included is the appraise submask.
|
||||
*/
|
||||
action = ima_get_action(inode, mask, func);
|
||||
action = ima_get_action(inode, mask, func, &pcr);
|
||||
violation_check = ((func == FILE_CHECK || func == MMAP_CHECK) &&
|
||||
(ima_policy_flag & IMA_MEASURE));
|
||||
if (!action && !violation_check)
|
||||
|
Reference in New Issue
Block a user