提交 5f6f027b 编写于 作者: E Eric Richter 提交者: Mimi Zohar

ima: change ima_measurements_show() to display the entry specific pcr

IMA assumes that the same default Kconfig PCR is extended for each
entry. This patch replaces the default configured PCR with the policy
defined PCR.
Signed-off-by: NEric Richter <erichte@linux.vnet.ibm.com>
Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
上级 14b1da85
...@@ -123,7 +123,6 @@ static int ima_measurements_show(struct seq_file *m, void *v) ...@@ -123,7 +123,6 @@ static int ima_measurements_show(struct seq_file *m, void *v)
struct ima_template_entry *e; struct ima_template_entry *e;
char *template_name; char *template_name;
int namelen; int namelen;
u32 pcr = CONFIG_IMA_MEASURE_PCR_IDX;
bool is_ima_template = false; bool is_ima_template = false;
int i; int i;
...@@ -137,10 +136,10 @@ static int ima_measurements_show(struct seq_file *m, void *v) ...@@ -137,10 +136,10 @@ static int ima_measurements_show(struct seq_file *m, void *v)
/* /*
* 1st: PCRIndex * 1st: PCRIndex
* PCR used is always the same (config option) in * PCR used defaults to the same (config option) in
* little-endian format * little-endian format, unless set in policy
*/ */
ima_putc(m, &pcr, sizeof(pcr)); ima_putc(m, &e->pcr, sizeof(e->pcr));
/* 2nd: template digest */ /* 2nd: template digest */
ima_putc(m, e->digest, TPM_DIGEST_SIZE); ima_putc(m, e->digest, TPM_DIGEST_SIZE);
...@@ -219,7 +218,7 @@ static int ima_ascii_measurements_show(struct seq_file *m, void *v) ...@@ -219,7 +218,7 @@ static int ima_ascii_measurements_show(struct seq_file *m, void *v)
e->template_desc->name : e->template_desc->fmt; e->template_desc->name : e->template_desc->fmt;
/* 1st: PCR used (config option) */ /* 1st: PCR used (config option) */
seq_printf(m, "%2d ", CONFIG_IMA_MEASURE_PCR_IDX); seq_printf(m, "%2d ", e->pcr);
/* 2nd: SHA1 template hash */ /* 2nd: SHA1 template hash */
ima_print_digest(m, e->digest, TPM_DIGEST_SIZE); ima_print_digest(m, e->digest, TPM_DIGEST_SIZE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册