From: Tushar Sugandhi <tusharsu@linux.microsoft.com> To: Mimi Zohar <zohar@linux.ibm.com>, joe@perches.com, skhan@linuxfoundation.org, linux-integrity@vger.kernel.org Cc: sashal@kernel.org, nramas@linux.microsoft.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/3] IMA: Add log statements for failure conditions. Date: Wed, 12 Feb 2020 14:30:26 -0800 [thread overview] Message-ID: <ce89d382-8e8b-71d0-5271-4db83d324f94@linux.microsoft.com> (raw) In-Reply-To: <1581518823.8515.49.camel@linux.ibm.com> On 2020-02-12 6:47 a.m., Mimi Zohar wrote: > Hi Tushar, > > Please remove the period at the end of the Subject line. Thanks. I will fix it in the next iteration. > > On Tue, 2020-02-11 at 15:14 -0800, Tushar Sugandhi wrote: >> process_buffer_measurement() does not have log messages for failure >> conditions. >> >> This change adds a log statement in the above function. > > I agree some form of notification needs to be added. The question is > whether the failure should be audited or a kernel message emitted. > IMA emits audit messages (integrity_audit_msg) for a number of > reasons - on failure to calculate a file hash, invalid policy rules, > failure to communicate with the TPM, signature verification errors, > etc. I believe both IMA audit messages and kernel message should be emitted - for better discoverability and diagnosability. > >> >> Signed-off-by: Tushar Sugandhi <tusharsu@linux.microsoft.com> >> Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com> >> Suggested-by: Joe Perches <joe@perches.com> >> --- >> security/integrity/ima/ima_main.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c >> index 9fe949c6a530..6e1576d9eb48 100644 >> --- a/security/integrity/ima/ima_main.c >> +++ b/security/integrity/ima/ima_main.c >> @@ -757,6 +757,9 @@ void process_buffer_measurement(const void *buf, int size, >> ima_free_template_entry(entry); >> >> out: >> + if (ret < 0) >> + pr_err("%s: failed, result: %d\n", __func__, ret); >> + >> return; >> } >> > > With 3/3 "IMA: Add module name and base name prefix to log", the > resulting message will be "KBUILD_MODNAME: KBUILD_BASENAME: func:". > Isn't that a bit much? > For this specific message, it will look like below. "ima: ima_main: process_buffer_measurement: failed, result: %d" In general, adding KBUILD_BASENAME seems helpful to pinpoint the location of the issue. > Mimi >
next prev parent reply other threads:[~2020-02-12 22:30 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-02-11 23:14 [PATCH v3 0/3] IMA: improve log messages in IMA Tushar Sugandhi 2020-02-11 23:14 ` [PATCH v3 1/3] IMA: Update KBUILD_MODNAME for IMA files to ima Tushar Sugandhi 2020-02-12 14:49 ` Mimi Zohar 2020-02-12 22:25 ` Tushar Sugandhi 2020-02-11 23:14 ` [PATCH v3 2/3] IMA: Add log statements for failure conditions Tushar Sugandhi 2020-02-12 14:47 ` Mimi Zohar 2020-02-12 22:30 ` Tushar Sugandhi [this message] 2020-02-13 0:21 ` Mimi Zohar 2020-02-13 21:01 ` Tushar Sugandhi 2020-02-11 23:14 ` [PATCH v3 3/3] IMA: Add module name and base name prefix to log Tushar Sugandhi 2020-02-12 14:29 ` Mimi Zohar 2020-02-12 15:26 ` James Bottomley 2020-02-12 15:47 ` Joe Perches 2020-02-12 22:52 ` Shuah Khan 2020-02-13 0:38 ` Mimi Zohar 2020-02-13 0:56 ` Tushar Sugandhi 2020-02-12 15:23 ` [PATCH v3 0/3] IMA: improve log messages in IMA Mimi Zohar 2020-02-12 22:22 ` Tushar Sugandhi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=ce89d382-8e8b-71d0-5271-4db83d324f94@linux.microsoft.com \ --to=tusharsu@linux.microsoft.com \ --cc=joe@perches.com \ --cc=linux-integrity@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=nramas@linux.microsoft.com \ --cc=sashal@kernel.org \ --cc=skhan@linuxfoundation.org \ --cc=zohar@linux.ibm.com \ --subject='Re: [PATCH v3 2/3] IMA: Add log statements for failure conditions.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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).