linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Siarhei Liakh <sliakh.lkml@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-next@vger.kernel.org,
	Arjan van de Ven <arjan@infradead.org>,
	James Morris <jmorris@namei.org>,
	Andrew Morton <akpm@linux-foundation.org>, Andi Kleen <ak@muc.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH v6] RO/NX protection for loadable kernel modules
Date: Mon, 21 Sep 2009 17:40:47 -0400	[thread overview]
Message-ID: <20090921214046.GA17243@redhat.com> (raw)
In-Reply-To: <817ecb6f0909101950v2fc6dc6u5cbc40cd9a9dde77@mail.gmail.com>

On Thu, Sep 10, 2009 at 10:50:47PM -0400, Siarhei Liakh wrote:
 > This patch is a logical extension of the protection provided by
 > CONFIG_DEBUG_RODATA to LKMs. The protection is provided by splitting
 > module_core and module_init into three logical parts each and setting
 > appropriate page access permissions for each individual section:
 > 
 >  1. Code: RO+X
 >  2. RO data: RO+NX
 >  3. RW data: RW+NX

Hi Siarhei,
 I tried out this patch on 2.6.31, and got the following trace during bootup..

------------[ cut here ]------------
WARNING: at kernel/trace/ftrace.c:1003 ftrace_bug+0x198/0x27e() (Not tainted)
Hardware name: VGN-Z540N
Modules linked in: output(+)
Pid: 115, comm: modprobe Not tainted 2.6.31-23.fc12.x86_64 #1
Call Trace:
 [<ffffffff81064244>] warn_slowpath_common+0x95/0xc3
 [<ffffffffa0000193>] ? video_output_register+0x11/0x10a [output]
 [<ffffffff81064299>] warn_slowpath_null+0x27/0x3d
 [<ffffffff810d4a0e>] ftrace_bug+0x198/0x27e
 [<ffffffffa0000193>] ? video_output_register+0x11/0x10a [output]
 [<ffffffff810d5c66>] ftrace_convert_nops+0x201/0x2b9
 [<ffffffffa0000193>] ? video_output_register+0x11/0x10a [output]
 [<ffffffff810d5d6a>] ftrace_module_notify+0x4c/0x7f
 [<ffffffff815099c5>] notifier_call_chain+0x72/0xba
 [<ffffffff81086db1>] ? __blocking_notifier_call_chain+0x4c/0x8e
 [<ffffffff81086dc8>] __blocking_notifier_call_chain+0x63/0x8e
 [<ffffffff81086e1a>] blocking_notifier_call_chain+0x27/0x3d
 [<ffffffff810a466a>] sys_init_module+0xb7/0x249
 [<ffffffff81011f42>] system_call_fastpath+0x16/0x1b
---[ end trace 95b33ebf87286ae6 ]---
ftrace faulted on writing [<ffffffffa0000193>] video_output_register+0x11/0x10a [output]


I guess ftrace is trying to NOP out something in the modules which
are marked read-only ?

	Dave

  reply	other threads:[~2009-09-21 21:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11  2:50 [PATCH v6] RO/NX protection for loadable kernel modules Siarhei Liakh
2009-09-21 21:40 ` Dave Jones [this message]
2009-09-22 15:49   ` Siarhei Liakh
2009-10-05 11:57     ` Siarhei Liakh
2009-09-21 23:59 ` Rusty Russell
2009-09-22 15:50   ` Siarhei Liakh

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=20090921214046.GA17243@redhat.com \
    --to=davej@redhat.com \
    --cc=ak@muc.de \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=hpa@zytor.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=sfr@canb.auug.org.au \
    --cc=sliakh.lkml@gmail.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).