mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: wzt wzt <wzt.wzt@gmail.com>
Cc: linux-kernel@vger.kernel.org, jmorris@namei.org,
	eparis@parisplace.org,
	lsm <linux-security-module@vger.kernel.org>,
	Greg Kroah-Hartman <greg@kroah.com>
Subject: Re: [PATCH] LSM: add static to security_ops variable
Date: Fri, 19 Feb 2010 08:47:46 -0500	[thread overview]
Message-ID: <1266587266.32011.6.camel@moss-pluto.epoch.ncsc.mil> (raw)
In-Reply-To: <628d1651002190340o59305986h738aec31ec5e6a84@mail.gmail.com>

On Fri, 2010-02-19 at 19:40 +0800, wzt wzt wrote:
> I rewrite the patch, thx.

Patch description needs to be descriptive, e.g.:
"Enhance the security framework to support resetting the active security
module.  This eliminates the need for direct use of the security_ops
variable outside of security.c, so make security_ops static."

Subject line could be more descriptive too, and likely just use
security: as the prefix.

You also need a Signed-off-by line, with a real name.

Also, see the comments below.

> ---
>  include/linux/security.h |    2 ++
>  security/security.c      |    7 ++++++-
>  security/selinux/hooks.c |   14 ++------------
>  3 files changed, 10 insertions(+), 13 deletions(-)
> 

> diff --git a/security/security.c b/security/security.c
> index 122b748..3e4c4bc 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -26,7 +26,7 @@ static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] =
>  extern struct security_operations default_security_ops;
>  extern void security_fixup_ops(struct security_operations *ops);
> 
> -struct security_operations *security_ops;      /* Initialized to NULL */
> +static struct security_operations *security_ops;       /* Initialized
> to NULL */

You can drop the /* Initialized to NULL */ comment since it is now
static.

> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 9a2ee84..e9599fd 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -93,6 +93,7 @@
> 
>  extern int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm);
>  extern struct security_operations *security_ops;
> +extern struct security_operations default_security_ops;

We don't need this extern declaration.

The next obvious cleanup would be to make default_security_ops static.
That will require some code reorganization though - it is presently
defined in capability.c and manipulated by security.c.

-- 
Stephen Smalley
National Security Agency


  reply	other threads:[~2010-02-19 13:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-07 11:24 wzt wzt
2010-02-07 14:14 ` Greg KH
2010-02-16 14:57 ` Stephen Smalley
2010-02-19 11:40   ` wzt wzt
2010-02-19 13:47     ` Stephen Smalley [this message]
2010-02-19 11:44 ` Alexey Dobriyan
2010-02-19 11:57   ` wzt wzt
2010-02-19 12:02     ` Alexey Dobriyan
2010-02-19 12:23       ` wzt wzt
2010-02-19 12:27         ` Alexey Dobriyan
2010-02-19 13:14           ` wzt wzt
2010-02-19 13:12         ` Bernd Petrovitsch

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=1266587266.32011.6.camel@moss-pluto.epoch.ncsc.mil \
    --to=sds@tycho.nsa.gov \
    --cc=eparis@parisplace.org \
    --cc=greg@kroah.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=wzt.wzt@gmail.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

all inboxes | Powered by JetHome®