linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Guy Briggs <rgb@redhat.com>
To: Paul Moore <paul@paul-moore.com>
Cc: Linux-Audit Mailing List <linux-audit@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH ghak59 V3 2/4] audit: add syscall information to CONFIG_CHANGE records
Date: Tue, 15 Jan 2019 11:21:12 -0500	[thread overview]
Message-ID: <20190115162112.jq6m2j4wmyk4rq25@madcap2.tricolour.ca> (raw)
In-Reply-To: <CAHC9VhSaTvVgSWVWo42Ur2k6hVNJ1XBkLwrd-J4-SUuidwXUYg@mail.gmail.com>

On 2019-01-14 17:58, Paul Moore wrote:
> On Mon, Dec 10, 2018 at 5:18 PM Richard Guy Briggs <rgb@redhat.com> wrote:
> > Tie syscall information to all CONFIG_CHANGE calls since they are all a
> > result of user actions.
> >
> > Exclude user records from syscall context:
> > Since the function audit_log_common_recv_msg() is shared by a number of
> > AUDIT_CONFIG_CHANGE and the entire range of AUDIT_USER_* record types,
> > and since the AUDIT_CONFIG_CHANGE message type has been converted to a
> > syscall accompanied record type, special-case the AUDIT_USER_* range of
> > messages so they remain standalone records.
> >
> > See: https://github.com/linux-audit/audit-kernel/issues/59
> > See: https://github.com/linux-audit/audit-kernel/issues/50
> > Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> > ---
> >  kernel/audit.c          | 27 +++++++++++++++++++--------
> >  kernel/audit_fsnotify.c |  2 +-
> >  kernel/audit_tree.c     |  2 +-
> >  kernel/audit_watch.c    |  2 +-
> >  kernel/auditfilter.c    |  2 +-
> >  5 files changed, 23 insertions(+), 12 deletions(-)
> >
> > diff --git a/kernel/audit.c b/kernel/audit.c
> > index 0e8026423fbd..a321fea94cc6 100644
> > --- a/kernel/audit.c
> > +++ b/kernel/audit.c
> > @@ -1072,6 +1073,16 @@ static void audit_log_common_recv_msg(struct audit_buffer **ab, u16 msg_type)
> >         audit_log_task_context(*ab);
> >  }
> >
> > +static inline void audit_log_user_recv_msg(struct audit_buffer **ab, u16 msg_type)
> > +{
> > +       audit_log_common_recv_msg(NULL, ab, msg_type);
> > +}
> 
> This makes sense because this is used by "user" records ...
> 
> > +static inline void audit_log_config_change_alt(struct audit_buffer **ab)
> > +{
> > +       audit_log_common_recv_msg(audit_context(), ab, AUDIT_CONFIG_CHANGE);
> > +}
> 
> ... and I don't believe this makes sense because there is no real
> logical grouping with the callers like there is for
> audit_log_user_recv_msg().

I don't follow "logical grouping".  They are all CONFIG_CHANGE record
prefixes with the current context.

Can you suggest an alternate name or another way of sharing
audit_log_common_recv_msg() since the only differences between the two
are a NULL context vs current task's context and the message type.  I
wasn't particularly happy with this name either.  I'd really like to
refactor this with all the rest of the CONFIG_CHANGE records, but there
is too much of a format difference to make it work without reordering or
deleting useless fields.

I know you had suggested making two different functions, but I think
they are more similar than different and merit the common factored code.

> paul moore

- 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

  reply	other threads:[~2019-01-15 16:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 22:17 [PATCH ghak59 V3 0/4] audit: config_change normalizations and event record gathering Richard Guy Briggs
2018-12-10 22:17 ` [PATCH ghak59 V3 1/4] audit: give a clue what CONFIG_CHANGE op was involved Richard Guy Briggs
2019-01-14 22:10   ` Paul Moore
2018-12-10 22:17 ` [PATCH ghak59 V3 2/4] audit: add syscall information to CONFIG_CHANGE records Richard Guy Briggs
2019-01-14 22:58   ` Paul Moore
2019-01-15 16:21     ` Richard Guy Briggs [this message]
2019-01-16  0:23       ` Paul Moore
2019-01-17  9:32     ` Steve Grubb
2019-01-17 13:21       ` Paul Moore
2019-01-17 16:08         ` Steve Grubb
2019-01-17 17:36           ` Paul Moore
2019-01-17 19:26             ` Richard Guy Briggs
2019-01-17 19:32               ` Paul Moore
     [not found]         ` <20190117153430.olcpsdq67mozk35e@madcap2.tricolour.ca>
     [not found]           ` <CAHC9VhRBA0k9Mo2_GuscaxOGigbUhytepQ_3O1HQRvwZOwmt_A@mail.gmail.com>
2019-01-17 23:18             ` Richard Guy Briggs
2019-01-18  3:26               ` Paul Moore
2019-01-18 12:35                 ` Richard Guy Briggs
2019-01-17 15:05       ` Richard Guy Briggs
2018-12-10 22:17 ` [PATCH ghak59 V3 3/4] audit: hand taken context to audit_kill_trees for syscall logging Richard Guy Briggs
2019-01-14 23:06   ` Paul Moore
2018-12-10 22:17 ` [PATCH ghak59 V3 4/4] audit: extend config_change mark/watch/tree rule changes Richard Guy Briggs
2019-01-14 23:16   ` Paul Moore
2018-12-11 22:31 ` [PATCH ghak59 V3 0/4] audit: config_change normalizations and event record gathering Paul Moore
2018-12-11 22:41   ` Richard Guy Briggs
2018-12-11 23:26     ` Paul Moore
2018-12-12  2:45       ` Richard Guy Briggs
2018-12-12 12:57         ` Paul Moore

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=20190115162112.jq6m2j4wmyk4rq25@madcap2.tricolour.ca \
    --to=rgb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).