All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Morris <jmorris@namei.org>
To: linux-security-module@vger.kernel.org
Cc: kernel-hardening@lists.openwall.com
Subject: [kernel-hardening] [RFC PATCH 2/4] security: mark nf ops in SELinux and Smack as __ro_after_init
Date: Mon, 13 Feb 2017 16:33:13 +1100 (AEDT)	[thread overview]
Message-ID: <alpine.LRH.2.20.1702131632340.8914@namei.org> (raw)

Both SELinux and Smack register Netfilter operations during init,
which then don't change.  Mark these ops as __ro_after_init.

Signed-off-by: James Morris <james.l.morris@oracle.com>
---
 security/selinux/hooks.c         |    2 +-
 security/smack/smack_netfilter.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 9599e97..37a7866 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -6379,7 +6379,7 @@ void selinux_complete_init(void)
 
 #if defined(CONFIG_NETFILTER)
 
-static struct nf_hook_ops selinux_nf_ops[] = {
+static struct nf_hook_ops selinux_nf_ops[] __ro_after_init = {
 	{
 		.hook =		selinux_ipv4_postroute,
 		.pf =		NFPROTO_IPV4,
diff --git a/security/smack/smack_netfilter.c b/security/smack/smack_netfilter.c
index 205b785..b945f2c 100644
--- a/security/smack/smack_netfilter.c
+++ b/security/smack/smack_netfilter.c
@@ -57,7 +57,7 @@ static unsigned int smack_ipv4_output(void *priv,
 	return NF_ACCEPT;
 }
 
-static struct nf_hook_ops smack_nf_ops[] = {
+static struct nf_hook_ops smack_nf_ops[] __ro_after_init = {
 	{
 		.hook =		smack_ipv4_output,
 		.pf =		NFPROTO_IPV4,
-- 
1.7.1

             reply	other threads:[~2017-02-13  5:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13  5:33 James Morris [this message]
2017-02-13 11:29 ` [kernel-hardening] Re: [RFC PATCH 2/4] security: mark nf ops in SELinux and Smack as __ro_after_init Tetsuo Handa
2017-02-13 17:29   ` Kees Cook
2017-02-13 21:03     ` Stephen Smalley
2017-02-13 21:32       ` Casey Schaufler
2017-02-13 21:49         ` Kees Cook
2017-02-13 22:01           ` Casey Schaufler
2017-02-13 22:05           ` [kernel-hardening] Re: [RFC PATCH 2/4] security: mark nf ops inSELinux " Tetsuo Handa
2017-02-13 22:09             ` Kees Cook
2017-02-13 22:15               ` [kernel-hardening] Re: [RFC PATCH 2/4] security: mark nf ops in SELinux " Tetsuo Handa
2017-02-13 22:26         ` James Morris
2017-02-14  1:58           ` Casey Schaufler
2017-02-14  2:46             ` James Morris

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=alpine.LRH.2.20.1702131632340.8914@namei.org \
    --to=jmorris@namei.org \
    --cc=kernel-hardening@lists.openwall.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.