All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for matthieu castet <castet.matthieu@free.fr>
To: linux-tip-commits@vger.kernel.org
Cc: sliakh.lkml@gmail.com, mingo@redhat.com,
	torvalds@linux-foundation.org, rusty@rustcorp.com.au,
	a.p.zijlstra@chello.nl, jiang@cs.ncsu.edu, fweisbec@gmail.com,
	akpm@linux-foundation.org, rostedt@goodmis.org,
	kees.cook@canonical.com, tglx@linutronix.de, jbaron@redhat.com,
	xtfeng@gmail.com, linux-kernel@vger.kernel.org, hpa@zytor.com,
	jmorris@namei.org, arjan@linux.intel.com, davej@redhat.com,
	castet.matthieu@free.fr, mingo@elte.hu
Subject: [tip:x86/urgent] x86: Fix jump label with RO/NX module protection crash
Date: Sun, 23 Jan 2011 18:03:25 GMT	[thread overview]
Message-ID: <tip-8969691343354bdd80eff5405a0f879edbf013d6@git.kernel.org> (raw)
In-Reply-To: <4D3C3F20.7030203@free.fr>

Commit-ID:  8969691343354bdd80eff5405a0f879edbf013d6
Gitweb:     http://git.kernel.org/tip/8969691343354bdd80eff5405a0f879edbf013d6
Author:     matthieu castet <castet.matthieu@free.fr>
AuthorDate: Sun, 23 Jan 2011 15:45:52 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 23 Jan 2011 16:12:45 +0100

x86: Fix jump label with RO/NX module protection crash

If we use jump table in module init, there are marked
as removed in __jump_table section after init is done.

But we already applied ro permissions on the module, so
we can't modify a read only section (crash in
remove_jump_label_module_init).

Make the __jump_table section rw.

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Cc: Xiaotian Feng <xtfeng@gmail.com>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Siarhei Liakh <sliakh.lkml@gmail.com>
Cc: Xuxian Jiang <jiang@cs.ncsu.edu>
Cc: James Morris <jmorris@namei.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Dave Jones <davej@redhat.com>
Cc: Kees Cook <kees.cook@canonical.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <4D3C3F20.7030203@free.fr>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/include/asm/jump_label.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h
index f52d42e..574dbc2 100644
--- a/arch/x86/include/asm/jump_label.h
+++ b/arch/x86/include/asm/jump_label.h
@@ -14,7 +14,7 @@
 	do {							\
 		asm goto("1:"					\
 			JUMP_LABEL_INITIAL_NOP			\
-			".pushsection __jump_table,  \"a\" \n\t"\
+			".pushsection __jump_table,  \"aw\" \n\t"\
 			_ASM_PTR "1b, %l[" #label "], %c0 \n\t" \
 			".popsection \n\t"			\
 			: :  "i" (key) :  : label);		\

      reply	other threads:[~2011-01-23 18:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-23 14:45 [PATCH] Fix jump label with RO/NX module protection matthieu castet
2011-01-23 18:03 ` tip-bot for matthieu castet [this message]

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=tip-8969691343354bdd80eff5405a0f879edbf013d6@git.kernel.org \
    --to=castet.matthieu@free.fr \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=davej@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jbaron@redhat.com \
    --cc=jiang@cs.ncsu.edu \
    --cc=jmorris@namei.org \
    --cc=kees.cook@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    --cc=sliakh.lkml@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=xtfeng@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 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.