Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jul 2009 18:55:38 +0300
From:      Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
To:        Andrew Brampton <brampton+freebsd-hackers@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: vm_map_protect / pmap_protect Can't lower protection
Message-ID:  <20090728155538.GA77306@pm513-1.comsys.ntu-kpi.kiev.ua>
In-Reply-To: <d41814900907200814w4371871cp3529a1e97239e1b9@mail.gmail.com>
References:  <d41814900907200814w4371871cp3529a1e97239e1b9@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello Andrew,

On Mon, Jul 20, 2009 at 04:14:02PM +0100, Andrew Brampton wrote:

> However, memguard_unguard doesn't work correctly. It first calls
> vm_map_protect with a read-write flag.
> vm_map_protect correctly updates the vm_map_entry, and then calls
> pmap_protect to set the actual pte.
> pmap_protect is lazy and notices that we are reducing the protection
> on the page and therefore does nothing. It assumes that later that a
> page fault will occur, call vm_fault, and then fix up the pte then.

As I remember, pmap_protect() is used for removing permissions, it
cannot be used (even in initial versions of pmap code) for lowering
permissions.  pmap_enter() can be used to lower permissions, this
is even written in its comments.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090728155538.GA77306>