public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel•com>
To: Siarhei Liakh <sliakh.lkml@gmail•com>
Cc: "linux-kernel@vger•kernel.org" <linux-kernel@vger•kernel.org>,
	"linux-security-module@vger•kernel.org"
	<linux-security-module@vger•kernel.org>,
	"linux-next@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>,
	Dave Jones <davej@redhat•com>
Subject: Re: [PATCH 1/4] [tip:x86/mm] Correcting improper large page preservation
Date: Fri, 02 Apr 2010 23:43:20 -0700	[thread overview]
Message-ID: <1270277000.2686.20.camel@sbs-t61> (raw)
In-Reply-To: <v2o817ecb6f1003311859nb14bab83y80f743a0accc5028@mail.gmail.com>

On Wed, 2010-03-31 at 18:59 -0700, Siarhei Liakh wrote:
> +	/*
> +	 * .data and .bss should always be writable.
> +	 */
> +	if ((within(pfn, __pa((unsigned long)_sdata) >> PAGE_SHIFT,
> +		   __pa((unsigned long)_edata) >> PAGE_SHIFT)) ||
> +	    (within(pfn, __pa((unsigned long)__bss_start) >> PAGE_SHIFT,
> +		   __pa((unsigned long)__bss_stop) >> PAGE_SHIFT))) {
> +		pgprot_val(required) |= _PAGE_RW;
> +	}

I have reviewed this patch and the only comment I have is:

On 64bit kernels, kernel text/data mapping and kernel identity mappings
are different virtual addresses mapping to same pfn ranges. For the
data/bss pages, does it help (in identifying certain data corruptions
more easily) in making the kernel identity mapping to be set to
read-only and enforce the need of RW only for the kernel data mappings.

Or is there some obscure code that uses something like
__va(__pa(data_symbol)) and writes to it?

If not, we can remove the __pa() constructs above and use the addr for
comparisons.

Otherwise this patch looks good to me.

Reviewed-by: Suresh Siddha <suresh.b.siddha@intel•com>

  reply	other threads:[~2010-04-03  6:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-01  1:59 [PATCH 1/4] [tip:x86/mm] Correcting improper large page preservation Siarhei Liakh
2010-04-03  6:43 ` Suresh Siddha [this message]
2010-04-06 14:51   ` Siarhei Liakh
2010-05-05 18:14     ` Siarhei Liakh
     [not found]     ` <g2s817ecb6f1005051114kfbf4f33dwf473e0a30e00d614@mail.gmail.com>
2010-05-06  6:19       ` Ingo Molnar

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=1270277000.2686.20.camel@sbs-t61 \
    --to=suresh.b.siddha@intel$(echo .)com \
    --cc=ak@muc$(echo .)de \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=arjan@infradead$(echo .)org \
    --cc=davej@redhat$(echo .)com \
    --cc=hpa@zytor$(echo .)com \
    --cc=jmorris@namei$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=linux-security-module@vger$(echo .)kernel.org \
    --cc=mingo@elte$(echo .)hu \
    --cc=rusty@rustcorp$(echo .)com.au \
    --cc=sfr@canb$(echo .)auug.org.au \
    --cc=sliakh.lkml@gmail$(echo .)com \
    --cc=tglx@linutronix$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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