Re: [PATCH 2/2] integrity: Add errno field in audit message

From: Mimi Zohar
Date: Thu Jun 18 2020 - 14:10:17 EST


On Thu, 2020-06-18 at 11:05 -0700, Lakshmi Ramasubramanian wrote:
> On 6/18/20 10:41 AM, Mimi Zohar wrote:
>
> >
> > For the reasons that I mentioned previously, unless others are willing
> > to add their Reviewed-by tag not for the audit aspect in particular,
> > but IMA itself, I'm not comfortable making this change all at once.
> >
> > Previously I suggested making the existing integrity_audit_msg() a
> > wrapper for a new function with errno. ÂSteve said, "We normally do
> > not like to have fields that swing in and out ...", but said setting
> > errno to 0 is fine. ÂThe original integrity_audit_msg() function would
> > call the new function with errno set to 0.
>
> If the original integrity_audit_msg() always calls the new function with
> errno set to 0, there would be audit messages where "res" field is set
> to "0" (fail) because "result" was non-zero, but errno set to "0"
> (success). Wouldn't this be confusing?
>
> In PATCH 1/2 I've made changes to make the "result" parameter to
> integrity_audit_msg() consistent - i.e., it is always an error code (0
> for success and a negative value for error). Would that address your
> concerns?

You're overloading "res" to imply errno. ÂDefine a new parameter
specifically for errno.

Mimi