From: Richard Guy Briggs <rgb@redhat.com>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: Steve Grubb <sgrubb@redhat.com>, Paul Moore <paul@paul-moore.com>,
linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org,
Linux-Audit Mailing List <linux-audit@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
omosnace@redhat.com, Eric Paris <eparis@parisplace.org>,
Serge Hallyn <serge@hallyn.com>,
mjg59@google.com
Subject: Re: [PATCH ghak109 V1] audit: link integrity evm_write_xattrs record to syscall event
Date: Tue, 26 Mar 2019 13:42:52 -0400 [thread overview]
Message-ID: <20190326174252.irqrldtcy5bwho6k@madcap2.tricolour.ca> (raw)
In-Reply-To: <20190326161409.3wej7hcwnqalf4or@madcap2.tricolour.ca>
On 2019-03-26 12:14, Richard Guy Briggs wrote:
> On 2019-03-26 11:29, Mimi Zohar wrote:
> > On Tue, 2019-03-26 at 11:22 -0400, Steve Grubb wrote:
> >
> > > > > > --- a/security/integrity/evm/evm_secfs.c
> > > > > > +++ b/security/integrity/evm/evm_secfs.c
> > > > > > @@ -192,7 +192,8 @@ static ssize_t evm_write_xattrs(struct file *file,
> > > > > > const char __user *buf,> >
> > > > > > if (count > XATTR_NAME_MAX)
> > > > > >
> > > > > > return -E2BIG;
> > > > > >
> > > > > > - ab = audit_log_start(NULL, GFP_KERNEL,
> > > > > > AUDIT_INTEGRITY_EVM_XATTR);
> > > > > > + ab = audit_log_start(audit_context(), GFP_KERNEL,
> > > > > > + AUDIT_INTEGRITY_EVM_XATTR);
> > > > >
> > > > > This part is fine.
> > > > >
> > > > > > if (!ab)
> > > > > >
> > > > > > return -ENOMEM;
> > > > > >
> > > > > > @@ -222,7 +223,7 @@ static ssize_t evm_write_xattrs(struct file *file,
> > > > > > const char __user *buf,> >
> > > > > > inode_lock(inode);
> > > > > > err = simple_setattr(evm_xattrs, &newattrs);
> > > > > > inode_unlock(inode);
> > > > > >
> > > > > > - audit_log_format(ab, "locked");
> > > > > > + audit_log_format(ab, "xattr=(locked)");
> > > > >
> > > > > Two things come to mind:
> > > > >
> > > > > * While we can clearly trust the string above, should we be logging
> > > > > the xattr field value as an untrusted string so it is consistent with
> > > > > how we record other xattr names?
> > > >
> > > > That would be a question for Steve.
> > >
> > > All fields with the same name must be represented the same way. If one
> > > instance is untrusted, every instance of the same keyword must be untrusted.
> >
> > Normal case:
> > audit_log_format(ab, "xattr=");
> > audit_log_untrustedstring(ab, xattr->name);
> >
> > Ok, so the above audit_log_format() call should be replaced with
> > audit_log_untrustedstring().
>
> Ok, so I think we can agree on "audit_log_untrustedstring(ab,
> "xattr=.");" and simpler yet just print the contents regardless and not
> special case this print. V2 coming...
Ok, what I typed above wasn't quite what I intended... This is what I
meant:
audit_log_format(ab, "xattr=");
audit_log_untrustedstring(ab, ".");
But, I'll just move the normal case above the "." locking detection and
log all cases the same way.
> > Mimi
>
> - RGB
- RGB
--
Richard Guy Briggs <rgb@redhat.com>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635
next prev parent reply other threads:[~2019-03-26 17:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-16 12:10 [PATCH ghak109 V1] audit: link integrity evm_write_xattrs record to syscall event Richard Guy Briggs
2019-03-20 23:48 ` Paul Moore
2019-03-21 0:50 ` Richard Guy Briggs
2019-03-21 1:03 ` Paul Moore
2019-03-26 15:11 ` Mimi Zohar
2019-03-26 15:22 ` Steve Grubb
2019-03-26 15:29 ` Mimi Zohar
2019-03-26 16:14 ` Richard Guy Briggs
2019-03-26 17:42 ` Richard Guy Briggs [this message]
2019-03-26 17:55 ` Matthew Garrett
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=20190326174252.irqrldtcy5bwho6k@madcap2.tricolour.ca \
--to=rgb@redhat.com \
--cc=eparis@parisplace.org \
--cc=linux-audit@redhat.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mjg59@google.com \
--cc=omosnace@redhat.com \
--cc=paul@paul-moore.com \
--cc=serge@hallyn.com \
--cc=sgrubb@redhat.com \
--cc=zohar@linux.ibm.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).