From: Zoltan Menyhart <Zoltan.Menyhart@bull.net>
To: "Seth, Rohit" <rohit.seth@intel.com>
Cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
davidm@hpl.hp.com
Subject: Re: Mprotect needs arch hook for updated PTE settings
Date: Wed, 16 Mar 2005 13:58:04 +0100 [thread overview]
Message-ID: <42382D5C.1030104@bull.net> (raw)
In-Reply-To: <01EF044AAEE12F4BAAD955CB75064943032C6020@scsmsx401.amr.corp.intel.com>
An application should not change the protection of its _own_ text region
without knowing well the requirements of the given architecture.
I do not think we should add anything into the kernel for this case.
I did see /lib/ld-linux-ia64.so.* changing the protection of the text
segment of the _victim_ application, when it linked the library references.
ld-linux-ia64.so.* changes the protection for the whole text segment
(otherwise, as the protection is per VMA, it would result in a VMA
fragmentation).
The text segment can be huge. There is no reason to flush all the text
segment every time when ld-linux-ia64.so.* patches an instruction and
changes the protection.
I think the solution should consist of these two measures:
1. Let's say that if an VMA is "executable", then it remains "executable"
for ever, i.e. the mprotect() keeps the PROT_EXEC bit.
As a result, if a page is faulted in for this VMA in the mean time, the
old good mechanism makes sure that the I-caches are flushed.
2. Let's modify ld-linux-<arch>.so.*: having patched an instruction, it
should take the appropriate, architecture dependent measure, e.g. for
ia64, it should issue an "fc" instruction.
(Who cares for a debugger ? It should know what it does ;-).)
I think there is no need for any extra flushes.
Thanks,
Zoltan Menyhart
next prev parent reply other threads:[~2005-03-16 12:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-15 17:43 Mprotect needs arch hook for updated PTE settings Seth, Rohit
2005-03-16 12:58 ` Zoltan Menyhart [this message]
2005-03-16 17:51 ` David Mosberger
-- strict thread matches above, loose matches on Subject: below --
2005-03-16 19:15 Seth, Rohit
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=42382D5C.1030104@bull.net \
--to=zoltan.menyhart@bull.net \
--cc=davidm@hpl.hp.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rohit.seth@intel.com \
/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