All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kyle McMartin <kyle@redhat.com>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] arm/Kconfig.debug: CONFIG_DEBUG_SET_MODULE_RONX and insn patching are mutually exclusive
Date: Thu, 20 Feb 2014 12:44:23 -0500	[thread overview]
Message-ID: <20140220174422.GA27412@redacted.bos.redhat.com> (raw)

With both options set, we're seeing an Oops while loading bridge.ko, as
netfilter is trying to use jump labels on the module .text after it's
been marked read-only. I'll cook up a patch to do what X86 does and
remap the page read-write while it's being patched, but for 3.14, we
should mark them as exclusive so others don't hit this crash.

Signed-off-by: Kyle McMartin <kyle@redhat.com>

--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -1197,7 +1197,7 @@ config PID_IN_CONTEXTIDR
 
 config DEBUG_SET_MODULE_RONX
 	bool "Set loadable kernel module data as NX and text as RO"
-	depends on MODULES
+	depends on MODULES && !(JUMP_LABEL || KPROBES)
 	---help---
 	  This option helps catch unintended modifications to loadable
 	  kernel module's text and read-only data. It also prevents execution

WARNING: multiple messages have this Message-ID (diff)
From: kyle@redhat.com (Kyle McMartin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm/Kconfig.debug: CONFIG_DEBUG_SET_MODULE_RONX and insn patching are mutually exclusive
Date: Thu, 20 Feb 2014 12:44:23 -0500	[thread overview]
Message-ID: <20140220174422.GA27412@redacted.bos.redhat.com> (raw)

With both options set, we're seeing an Oops while loading bridge.ko, as
netfilter is trying to use jump labels on the module .text after it's
been marked read-only. I'll cook up a patch to do what X86 does and
remap the page read-write while it's being patched, but for 3.14, we
should mark them as exclusive so others don't hit this crash.

Signed-off-by: Kyle McMartin <kyle@redhat.com>

--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -1197,7 +1197,7 @@ config PID_IN_CONTEXTIDR
 
 config DEBUG_SET_MODULE_RONX
 	bool "Set loadable kernel module data as NX and text as RO"
-	depends on MODULES
+	depends on MODULES && !(JUMP_LABEL || KPROBES)
 	---help---
 	  This option helps catch unintended modifications to loadable
 	  kernel module's text and read-only data. It also prevents execution

             reply	other threads:[~2014-02-20 17:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 17:44 Kyle McMartin [this message]
2014-02-20 17:44 ` [PATCH] arm/Kconfig.debug: CONFIG_DEBUG_SET_MODULE_RONX and insn patching are mutually exclusive Kyle McMartin

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=20140220174422.GA27412@redacted.bos.redhat.com \
    --to=kyle@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --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.