mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Guy Briggs <rgb@redhat.com>
To: Eric Paris <eparis@redhat.com>
Cc: netdev@oss.sgi.com, davem@davemloft.net, linux-audit@redhat.com,
	linux-kernel@vger.kernel.org, Steve Grubb <sgrubb@redhat.com>
Subject: Re: [PATCH 3/5] audit: add netlink audit protocol bind to check capabilities on multicast join
Date: Wed, 19 Feb 2014 14:41:31 -0500	[thread overview]
Message-ID: <20140219194131.GQ16640@madcap2.tricolour.ca> (raw)
In-Reply-To: <1392837336.2165.51.camel@flatline.rdu.redhat.com>

On 14/02/19, Eric Paris wrote:
> On Wed, 2014-02-19 at 13:08 -0500, Richard Guy Briggs wrote:
> > Register a netlink per-protocol bind fuction for audit to check userspace
> > process capabilities before allowing a multicast group connection.
> > 
> > Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> > ---
> >  kernel/audit.c |   10 ++++++++++
> >  1 files changed, 10 insertions(+), 0 deletions(-)
> > 
> > diff --git a/kernel/audit.c b/kernel/audit.c
> > index b5b2f72..f2d2d61 100644
> > --- a/kernel/audit.c
> > +++ b/kernel/audit.c
> > @@ -1050,10 +1050,20 @@ static void audit_receive(struct sk_buff  *skb)
> >  	mutex_unlock(&audit_cmd_mutex);
> >  }
> >  
> > +/* Run custom bind function on netlink socket group connect or bind requests. */
> > +static int audit_bind(int group)
> > +{
> > +	if (!capable(CAP_AUDIT_READ))
> 
> Not a great idea to use CAP_AUDIT_READ before you define it in patch4

<blush>

> > +		return -EPERM;
> > +
> > +	return 0;
> > +}
> > +
> >  static int __net_init audit_net_init(struct net *net)
> >  {
> >  	struct netlink_kernel_cfg cfg = {
> >  		.input	= audit_receive,
> > +		.bind	= audit_bind,
> >  	};
> >  
> >  	struct audit_net *aunet = net_generic(net, audit_net_id);

- RGB

--
Richard Guy Briggs <rbriggs@redhat.com>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat
Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

  reply	other threads:[~2014-02-19 19:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19 18:08 [PATCH 0/5] audit: add restricted capability read-only netlink multicast socket Richard Guy Briggs
2014-02-19 18:08 ` [PATCH 1/5] audit: move kaudit thread start from auditd registration to kaudit init Richard Guy Briggs
2014-02-19 18:08 ` [PATCH 2/5] netlink: have netlink per-protocol bind function return an error code Richard Guy Briggs
2014-02-19 18:08 ` [PATCH 3/5] audit: add netlink audit protocol bind to check capabilities on multicast join Richard Guy Briggs
2014-02-19 19:15   ` Eric Paris
2014-02-19 19:41     ` Richard Guy Briggs [this message]
2014-02-19 18:08 ` [PATCH 4/5] audit: add netlink multicast group for log read Richard Guy Briggs
2014-02-19 18:08 ` [PATCH 5/5] audit: send multicast messages only if there are listeners Richard Guy Briggs

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=20140219194131.GQ16640@madcap2.tricolour.ca \
    --to=rgb@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eparis@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=sgrubb@redhat.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

Powered by JetHome