From: William Lee Irwin III <wli@holomorphy.com>
To: Andi Kleen <ak@muc.de>
Cc: akpm@digeo.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Use correct page protection for put_dirty_page
Date: Sun, 11 May 2003 01:30:35 -0700 [thread overview]
Message-ID: <20030511083035.GI8978@holomorphy.com> (raw)
In-Reply-To: <20030511080841.GA31266@averell>
On Sun, May 11, 2003 at 10:08:41AM +0200, Andi Kleen wrote:
> put_page_dirty must use the page protection of the stack VMA, not hardcoded
> PAGE_COPY. They can be different e.g. when the stack is set non executable
> via VM_STACK_FLAGS.
> I added an fallback path for now because I'm not sure if the stack VMA
> is always predowngrowed here, if the printk better it may be also needed
> to add an stack extension here.
We know which vma is involved at the callsite and what we just set its
vma->vm_page_prot to; I suggest this patch instead.
-- wli
diff -prauN linux-2.5.69-1/fs/exec.c exec-2.5.69-1/fs/exec.c
--- linux-2.5.69-1/fs/exec.c Wed Apr 16 15:34:51 2003
+++ exec-2.5.69-1/exec.c Sun May 11 01:27:47 2003
@@ -314,7 +314,7 @@
}
lru_cache_add_active(page);
flush_dcache_page(page);
- set_pte(pte, pte_mkdirty(pte_mkwrite(mk_pte(page, PAGE_COPY))));
+ set_pte(pte, pte_mkdirty(pte_mkwrite(mk_pte(page, protection_map[VM_STACK_FLAGS & 0x7]))));
pte_chain = page_add_rmap(page, pte, pte_chain);
pte_unmap(pte);
tsk->mm->rss++;
next prev parent reply other threads:[~2003-05-11 8:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-11 8:08 [PATCH] Use correct page protection for put_dirty_page Andi Kleen
2003-05-11 8:30 ` William Lee Irwin III [this message]
2003-05-11 8:36 ` Andi Kleen
2003-05-11 8:32 ` Andrew Morton
2003-05-11 8:37 ` Andi Kleen
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=20030511083035.GI8978@holomorphy.com \
--to=wli@holomorphy.com \
--cc=ak@muc.de \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
/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