All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: kernel-hardening@lists.openwall.com
Cc: keescook@chromium.org, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, labbott@redhat.com
Subject: [RFC PATCH 3/4] module: Use linux/set_memory.h
Date: Thu, 29 Jun 2017 16:29:40 +1000	[thread overview]
Message-ID: <1498717781-29151-3-git-send-email-mpe@ellerman.id.au> (raw)
In-Reply-To: <1498717781-29151-1-git-send-email-mpe@ellerman.id.au>

This header always exists, so doesn't require an ifdef around its
inclusion. When CONFIG_ARCH_HAS_SET_MEMORY=y it includes the asm header,
otherwise it provides empty versions of the set_memory_xx() routines.

The usages of set_memory_xx() are still guarded by CONFIG_STRICT_MODULE_RWX.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 kernel/module.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index d0a723ebe75c..e7696b25db30 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -49,9 +49,7 @@
 #include <linux/rculist.h>
 #include <linux/uaccess.h>
 #include <asm/cacheflush.h>
-#ifdef CONFIG_STRICT_MODULE_RWX
-#include <asm/set_memory.h>
-#endif
+#include <linux/set_memory.h>
 #include <asm/mmu_context.h>
 #include <linux/license.h>
 #include <asm/sections.h>
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au>
To: kernel-hardening@lists.openwall.com
Cc: keescook@chromium.org, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, labbott@redhat.com
Subject: [kernel-hardening] [RFC PATCH 3/4] module: Use linux/set_memory.h
Date: Thu, 29 Jun 2017 16:29:40 +1000	[thread overview]
Message-ID: <1498717781-29151-3-git-send-email-mpe@ellerman.id.au> (raw)
In-Reply-To: <1498717781-29151-1-git-send-email-mpe@ellerman.id.au>

This header always exists, so doesn't require an ifdef around its
inclusion. When CONFIG_ARCH_HAS_SET_MEMORY=y it includes the asm header,
otherwise it provides empty versions of the set_memory_xx() routines.

The usages of set_memory_xx() are still guarded by CONFIG_STRICT_MODULE_RWX.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 kernel/module.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index d0a723ebe75c..e7696b25db30 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -49,9 +49,7 @@
 #include <linux/rculist.h>
 #include <linux/uaccess.h>
 #include <asm/cacheflush.h>
-#ifdef CONFIG_STRICT_MODULE_RWX
-#include <asm/set_memory.h>
-#endif
+#include <linux/set_memory.h>
 #include <asm/mmu_context.h>
 #include <linux/license.h>
 #include <asm/sections.h>
-- 
2.7.4

  parent reply	other threads:[~2017-06-29  6:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  6:29 [RFC PATCH 1/4] Provide linux/set_memory.h Michael Ellerman
2017-06-29  6:29 ` [kernel-hardening] " Michael Ellerman
2017-06-29  6:29 ` [RFC PATCH 2/4] PM / hibernate: Use linux/set_memory.h Michael Ellerman
2017-06-29  6:29   ` [kernel-hardening] " Michael Ellerman
2017-06-29  6:29 ` Michael Ellerman [this message]
2017-06-29  6:29   ` [kernel-hardening] [RFC PATCH 3/4] module: " Michael Ellerman
2017-06-29  6:29 ` [RFC PATCH 4/4] bpf: " Michael Ellerman
2017-06-29  6:29   ` [kernel-hardening] " Michael Ellerman
2017-06-29  8:57   ` Daniel Borkmann
2017-06-29  9:03 ` [kernel-hardening] [RFC PATCH 1/4] Provide linux/set_memory.h Daniel Borkmann
2017-06-29 16:11   ` Kees Cook
2017-06-29 16:11     ` Kees Cook
2017-06-30  1:43     ` Michael Ellerman
2017-06-30  1:43       ` Michael Ellerman
2017-06-29 16:45 ` Laura Abbott
2017-06-29 16:45   ` [kernel-hardening] " Laura Abbott

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=1498717781-29151-3-git-send-email-mpe@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@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.