fixing linux mmap()
Marcin Cieslak
saper at SYSTEM.PL
Sat Sep 16 10:10:32 PDT 2006
Maxim Sobolev wrote:
> Actually it's confusion on your part. This code was there since version
> 1.1 and long before 1.31 (my change that touched this line):
Yes, the code is very old. However things has changed in the FreeBSD
mmap() in the meantime, but Linux emulator code was left as it was.
I just wondered if we need this PROT_READ thing at all.
amd64 code illustrates this confusion even better:
/sys/amd64/linux32/linux32_machdep.c
1.1 (tjr 16-Aug-04): /*
1.1 (tjr 16-Aug-04): * XXX i386 Linux always emulator forces
PROT_READ on (why?)
1.1 (tjr 16-Aug-04): * so we do the same. We add PROT_EXEC
to work around buggy
1.1 (tjr 16-Aug-04): * applications (e.g. Java) that take
advantage of the fact
1.1 (tjr 16-Aug-04): * that execute permissions are not
enforced by x86 CPUs.
1.1 (tjr 16-Aug-04): */
1.1 (tjr 16-Aug-04): bsd_args.prot = linux_args->prot |
PROT_EXEC | PROT_READ;
I *guess* adding PROT_READ is no longer necessary (at least since 1.333 version
of /sys/vm/vm_map.c). PROT_EXEC also wonders me, but I lack amd64 hardware and
mmap() clue to check this...
--
<< Marcin Cieslak // saper at system.pl >>
More information about the freebsd-emulation
mailing list