linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IMA: Updated KBUILD_MODNAME for IMA files to ima
@ 2020-02-07 19:53 Tushar Sugandhi
  2020-02-07 19:53 ` [PATCH] IMA: Add log statements for failure conditions Tushar Sugandhi
  0 siblings, 1 reply; 17+ messages in thread
From: Tushar Sugandhi @ 2020-02-07 19:53 UTC (permalink / raw)
  To: zohar, linux-integrity; +Cc: sashal, nramas, linux-kernel

Log statements from ima_mok.c, ima_asymmetric_keys.c, and
ima_queue_keys.c are prefixed with the respective file names
and not with the string "ima". 

This change fixes the log statement prefix to be consistent with the rest
of the IMA files.

Signed-off-by: Tushar Sugandhi <tusharsu@linux.microsoft.com>
Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
---
 security/integrity/ima/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/security/integrity/ima/Makefile b/security/integrity/ima/Makefile
index 064a256f8725..67dabca670e2 100644
--- a/security/integrity/ima/Makefile
+++ b/security/integrity/ima/Makefile
@@ -11,6 +11,6 @@ ima-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \
 ima-$(CONFIG_IMA_APPRAISE) += ima_appraise.o
 ima-$(CONFIG_IMA_APPRAISE_MODSIG) += ima_modsig.o
 ima-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o
-obj-$(CONFIG_IMA_BLACKLIST_KEYRING) += ima_mok.o
-obj-$(CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS) += ima_asymmetric_keys.o
-obj-$(CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS) += ima_queue_keys.o
+ima-$(CONFIG_IMA_BLACKLIST_KEYRING) += ima_mok.o
+ima-$(CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS) += ima_asymmetric_keys.o
+ima-$(CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS) += ima_queue_keys.o
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread
* [PATCH] IMA: Add log statements for failure conditions
@ 2020-06-04 16:32 Lakshmi Ramasubramanian
  2020-06-05 18:46 ` Mimi Zohar
  0 siblings, 1 reply; 17+ messages in thread
From: Lakshmi Ramasubramanian @ 2020-06-04 16:32 UTC (permalink / raw)
  To: zohar, linux-integrity; +Cc: tusharsu, linux-kernel

The final log statement in process_buffer_measurement() for failure
condition is at debug level. This does not log the message unless
the system log level is raised which would significantly increase
the messages in the system log. Change this log message to error level,
and add eventname and ima_hooks enum to the message for better triaging
failures in the function.

ima_alloc_key_entry() does not log a message for failure condition.
Add an error message for failure condition in this function.

Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
---
 security/integrity/ima/ima_main.c       | 3 ++-
 security/integrity/ima/ima_queue_keys.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index 9d0abedeae77..3b371f31597b 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -756,7 +756,8 @@ void process_buffer_measurement(const void *buf, int size,
 
 out:
 	if (ret < 0)
-		pr_devel("%s: failed, result: %d\n", __func__, ret);
+		pr_err("%s failed. eventname: %s, func: %d, result: %d\n",
+		       __func__, eventname, func, ret);
 
 	return;
 }
diff --git a/security/integrity/ima/ima_queue_keys.c b/security/integrity/ima/ima_queue_keys.c
index cb3e3f501593..e51d0eb08d8a 100644
--- a/security/integrity/ima/ima_queue_keys.c
+++ b/security/integrity/ima/ima_queue_keys.c
@@ -88,6 +88,8 @@ static struct ima_key_entry *ima_alloc_key_entry(struct key *keyring,
 
 out:
 	if (rc) {
+		pr_err("%s failed. keyring: %s, result: %d\n",
+		       __func__, keyring->description, rc);
 		ima_free_key_entry(entry);
 		entry = NULL;
 	}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-06-05 21:36 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07 19:53 [PATCH] IMA: Updated KBUILD_MODNAME for IMA files to ima Tushar Sugandhi
2020-02-07 19:53 ` [PATCH] IMA: Add log statements for failure conditions Tushar Sugandhi
2020-02-09 12:57   ` Mimi Zohar
2020-02-10  2:46     ` Joe Perches
2020-02-10 16:40       ` Lakshmi Ramasubramanian
2020-02-10 16:50         ` Joe Perches
2020-02-10 21:42           ` Tushar Sugandhi
     [not found]           ` <0c9099b5-da29-3e71-0933-123dfe08442c@linux.microsoft.com>
2020-02-10 21:46             ` Mimi Zohar
2020-02-10 22:19               ` Tushar Sugandhi
2020-06-04 16:32 Lakshmi Ramasubramanian
2020-06-05 18:46 ` Mimi Zohar
2020-06-05 19:37   ` Paul Moore
2020-06-05 19:54     ` Lakshmi Ramasubramanian
2020-06-05 20:49       ` Paul Moore
2020-06-05 21:09         ` Lakshmi Ramasubramanian
2020-06-05 21:34           ` Mimi Zohar
2020-06-05 21:36             ` Lakshmi Ramasubramanian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).