Subject: Re: uvm_mmap.c 1.47
To: Charles M. Hannum <root@ihack.net>
From: Jason R Thorpe <thorpej@zembu.com>
List: tech-kern
Date: 01/07/2001 08:07:09
On Sun, Jan 07, 2001 at 07:06:22AM +0000, Charles M. Hannum wrote:
> > Only include PROT_EXEC in maxprot if the user specified PROT_EXEC
> > in the mmap() call. maxprot is used to create device mappings,
> > and always including PROT_EXEC causes the mapping to fail on the Alpha
> > when mapping a non-RAM offset of /dev/mem (which may be sparse, so
> > instruction fetch from there is disallowed).
>
> I believe this change is VERY, VERY WRONG, as it specifically breaks
> valid usage of mprotect(2). I wouldn't be at all surprised to find
> out that it actually breaks some software that does dynamic code
> compilation.
Also, you should take a look at the actual change (I'm not sure that
you actually did!). It's a one-liner, in the ((flags & MAP_ANON) == 0)
case of sys_mmap(). Anonymous mappings still get VM_PROT_ALL as the
maxprot. I should have been more clear about this in my commit message.
--
-- Jason R. Thorpe <thorpej@zembu.com>