diff options
author | Paul Moore <pmoore@redhat.com> | 2014-06-17 17:30:23 -0400 |
---|---|---|
committer | Paul Moore <pmoore@redhat.com> | 2014-06-17 17:30:23 -0400 |
commit | 170b5910d9fbea79de1bb40df22eda5f98250c0c (patch) | |
tree | ca9560e878d2842d45c6f99077d0d8b8f8b0f9ba /security/integrity/ima/ima_queue.c | |
parent | 47dd0b76ace953bd2c0479076db0d3e3b9594003 (diff) | |
parent | 1860e379875dfe7271c649058aeddffe5afd9d0d (diff) |
Merge tag 'v3.15' into next
Linux 3.15
Diffstat (limited to 'security/integrity/ima/ima_queue.c')
-rw-r--r-- | security/integrity/ima/ima_queue.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c index d85e99761f4f..552705d5a78d 100644 --- a/security/integrity/ima/ima_queue.c +++ b/security/integrity/ima/ima_queue.c | |||
@@ -18,6 +18,9 @@ | |||
18 | * The measurement list is append-only. No entry is | 18 | * The measurement list is append-only. No entry is |
19 | * ever removed or changed during the boot-cycle. | 19 | * ever removed or changed during the boot-cycle. |
20 | */ | 20 | */ |
21 | |||
22 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | |||
21 | #include <linux/module.h> | 24 | #include <linux/module.h> |
22 | #include <linux/rculist.h> | 25 | #include <linux/rculist.h> |
23 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
@@ -72,7 +75,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry) | |||
72 | 75 | ||
73 | qe = kmalloc(sizeof(*qe), GFP_KERNEL); | 76 | qe = kmalloc(sizeof(*qe), GFP_KERNEL); |
74 | if (qe == NULL) { | 77 | if (qe == NULL) { |
75 | pr_err("IMA: OUT OF MEMORY ERROR creating queue entry.\n"); | 78 | pr_err("OUT OF MEMORY ERROR creating queue entry\n"); |
76 | return -ENOMEM; | 79 | return -ENOMEM; |
77 | } | 80 | } |
78 | qe->entry = entry; | 81 | qe->entry = entry; |
@@ -95,8 +98,7 @@ static int ima_pcr_extend(const u8 *hash) | |||
95 | 98 | ||
96 | result = tpm_pcr_extend(TPM_ANY_NUM, CONFIG_IMA_MEASURE_PCR_IDX, hash); | 99 | result = tpm_pcr_extend(TPM_ANY_NUM, CONFIG_IMA_MEASURE_PCR_IDX, hash); |
97 | if (result != 0) | 100 | if (result != 0) |
98 | pr_err("IMA: Error Communicating to TPM chip, result: %d\n", | 101 | pr_err("Error Communicating to TPM chip, result: %d\n", result); |
99 | result); | ||
100 | return result; | 102 | return result; |
101 | } | 103 | } |
102 | 104 | ||
@@ -115,7 +117,7 @@ int ima_add_template_entry(struct ima_template_entry *entry, int violation, | |||
115 | 117 | ||
116 | mutex_lock(&ima_extend_list_mutex); | 118 | mutex_lock(&ima_extend_list_mutex); |
117 | if (!violation) { | 119 | if (!violation) { |
118 | memcpy(digest, entry->digest, sizeof digest); | 120 | memcpy(digest, entry->digest, sizeof(digest)); |
119 | if (ima_lookup_digest_entry(digest)) { | 121 | if (ima_lookup_digest_entry(digest)) { |
120 | audit_cause = "hash_exists"; | 122 | audit_cause = "hash_exists"; |
121 | result = -EEXIST; | 123 | result = -EEXIST; |
@@ -131,7 +133,7 @@ int ima_add_template_entry(struct ima_template_entry *entry, int violation, | |||
131 | } | 133 | } |
132 | 134 | ||
133 | if (violation) /* invalidate pcr */ | 135 | if (violation) /* invalidate pcr */ |
134 | memset(digest, 0xff, sizeof digest); | 136 | memset(digest, 0xff, sizeof(digest)); |
135 | 137 | ||
136 | tpmresult = ima_pcr_extend(digest); | 138 | tpmresult = ima_pcr_extend(digest); |
137 | if (tpmresult != 0) { | 139 | if (tpmresult != 0) { |