mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Siarhei Liakh <sliakh.lkml@gmail.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	Andi Kleen <andi@firstfloor.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Ingo Molnar <mingo@elte.hu>, 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>,
	linux-cris-kernel@axis.com, Roland Dreier <rdreier@cisco.com>
Subject: Re: [PATCH] x86: NX protection for kernel data
Date: Sun, 19 Jul 2009 20:15:07 -0400	[thread overview]
Message-ID: <817ecb6f0907191715v170416a8vad8bfa3b2c7f17b2@mail.gmail.com> (raw)
In-Reply-To: <20090719131808.77f986f3@infradead.org>

On Sun, Jul 19, 2009 at 4:18 PM, Arjan van de Ven<arjan@infradead.org> wrote:
> On Sun, 19 Jul 2009 15:43:06 -0400
> Siarhei Liakh <sliakh.lkml@gmail.com> wrote:
>
>> This patch expands functionality of CONFIG_DEBUG_RODATA to set main
>> (static) kernel data area as NX.
>> The following steps are taken to achieve this:
>> 1. Linker scripts are adjusted so .text always starts and end on a
>> page boundary 2. Linker scripts are adjusted so .rodata and .data
>> always starts and end on a page boundary
>> 3. void mark_nxdata_nx(void) added to arch/x86/mm/init_64.c and
>> arch/x86/mm/init_32.c with actual functionality: NX is set for all
>> pages from _etext through _edata
>> 4. mark_nxdata_nx() called from init_post(void) in init/main.c
>>
>> The patch have been developed for Linux 2.6.30 x86 by Siarhei Liakh
>> <sliakh.lkml@gmail.com> and Xuxian Jiang <jiang@cs.ncsu.edu>.
>
> I like the idea, and am happy to see the lack of ifdefs ;)

I was thinking about ifdefs, but could not find a place to put them in ;)

> I wonder if we should have a testcase for this though similar to
> how stackprotector and rodata get tested already....

We probably should. In addition, after looking at the code for a
while, it seems to me that the proper place to enable protection would
be kernel_physical_mapping_init(). This way the kernel could enjoy
protection from the very beginning of init, instead of turning it on
at the end.

  reply	other threads:[~2009-07-20  0:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-19 19:43 Siarhei Liakh
2009-07-19 20:13 ` Sam Ravnborg
2009-07-20  0:09   ` Siarhei Liakh
2009-07-20  7:10     ` Sam Ravnborg
2009-07-20 11:47       ` Ingo Molnar
2009-07-19 20:18 ` Arjan van de Ven
2009-07-20  0:15   ` Siarhei Liakh [this message]
2009-07-19 20:18 ` Thomas Gleixner
2009-07-20  0:09   ` 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=817ecb6f0907191715v170416a8vad8bfa3b2c7f17b2@mail.gmail.com \
    --to=sliakh.lkml@gmail.com \
    --cc=ak@muc.de \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=hpa@zytor.com \
    --cc=jmorris@namei.org \
    --cc=linux-cris-kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rdreier@cisco.com \
    --cc=rusty@rustcorp.com.au \
    --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

all inboxes | Powered by JetHome®