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,
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>
Subject: Re: [PATCH v4] RO/NX protection for loadable kernel modules
Date: Wed, 8 Jul 2009 18:31:59 -0400 [thread overview]
Message-ID: <817ecb6f0907081531u2f63c3c6y9b1cbc7bf8ff653@mail.gmail.com> (raw)
In-Reply-To: <20090707220640.5352ac94@infradead.org>
> I like it, you can already put
>
> Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Thanks, I will add this to V5.
...
>> + /*Set text RO if there are still pages between begin
>> and end*/
>> + if (end_addr > begin_addr) {
>> + pg_count = PFN_DOWN(end_addr - 1) -
>> + PFN_DOWN(begin_addr) + 1;
>> + DEBUGP(" RO: 0x%lx %lu\n", begin_addr,
>> pg_count);
>> + set_memory_ro(begin_addr, pg_count);
>> + } else {
...
> I *think* this can be done as
>
> begin_pfn = PFN_UP( (base);
> end_pfn = PFN_DOWN(base + ro_size);
>
> if (end_pfn > begin_pfn)
> set_memory_ro(begin_pfn >> PAGE_SHIFT, end_pfn - begin_pfn);
>
> (note that I think the +1 you have might be buggy)
The +1 is necessary because of (end_addr - 1). However, I like your
way better, so I will incorporate it in V5.
next prev parent reply other threads:[~2009-07-08 22:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-05 23:23 [PATCH v3] " Siarhei Liakh
2009-07-06 0:03 ` Arjan van de Ven
2009-07-06 1:13 ` Rusty Russell
2009-07-08 0:47 ` [PATCH v4] " Siarhei Liakh
2009-07-08 5:06 ` Arjan van de Ven
2009-07-08 22:31 ` Siarhei Liakh [this message]
2009-07-11 11:49 ` Rusty Russell
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=817ecb6f0907081531u2f63c3c6y9b1cbc7bf8ff653@mail.gmail.com \
--to=sliakh.lkml@gmail.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-security-module@vger.kernel.org \
--cc=mingo@elte.hu \
--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®