public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: gaowanlong@cn.fujitsu.com
Cc: linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, eparis@parisplace.org,
	James Morris <jmorris@namei.org>
Subject: Re: [PATCH] selinux: init target class when add avc callback
Date: Tue, 6 Mar 2012 16:15:43 -0800	[thread overview]
Message-ID: <20120306161543.63c3fc54.akpm@linux-foundation.org> (raw)
In-Reply-To: <4F56A4E2.5050001@cn.fujitsu.com>

On Wed, 07 Mar 2012 07:59:30 +0800
Wanlong Gao <gaowanlong@cn.fujitsu.com> wrote:

> On 02/05/2012 09:53 AM, Wanlong Gao wrote:
> 
> > Target security class should be initialized when add avc callback.
> > Although tclass is userless in callbacks now, but it may be used
> > in the future .
> > 
> > Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> > ---
> >  security/selinux/avc.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/security/selinux/avc.c b/security/selinux/avc.c
> > index dca1c22..27495e6 100644
> > --- a/security/selinux/avc.c
> > +++ b/security/selinux/avc.c
> > @@ -576,6 +576,7 @@ int avc_add_callback(int (*callback)(u32 event, u32 ssid, u32 tsid,
> >  	c->events = events;
> >  	c->ssid = ssid;
> >  	c->tsid = tsid;
> > +	c->tclass = tclass;
> >  	c->perms = perms;
> >  	c->next = avc_callbacks;
> >  	avc_callbacks = c;

Perhaps James can take a look at this?

avc_add_callback() looks a bit odd.  It uses GFP_ATOMIC, but that is
unnecessary because avc_add_callback() is only ever called from
module_init() code.  And if it isn't only ever called from
module_init() code then it needs some locking for that list.

  reply	other threads:[~2012-03-07  0:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05  1:53 [PATCH] selinux: init target class when add avc callback Wanlong Gao
2012-03-06 23:59 ` Wanlong Gao
2012-03-07  0:15   ` Andrew Morton [this message]
2012-03-07  0:41     ` Eric Paris
2012-03-07  0:48       ` Wanlong Gao
2012-03-07  0:49       ` Andrew Morton
2012-03-07 13:27       ` Stephen Smalley

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=20120306161543.63c3fc54.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=eparis@parisplace.org \
    --cc=gaowanlong@cn.fujitsu.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    /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