Date: Sat, 16 Sep 2006 19:10:19 +0200 From: Marcin Cieslak <saper@SYSTEM.PL> To: Maxim Sobolev <sobomax@FreeBSD.org>, Marcel Moolenaar <marcel@FreeBSD.org> Cc: emulation@FreeBSD.org, Alexander Leidinger <Alexander@Leidinger.net>, Tim Robins <tjr@FreeBSD.org> Subject: Re: fixing linux mmap() Message-ID: <450C2FFB.3050209@SYSTEM.PL> In-Reply-To: <450C2A46.9010609@FreeBSD.org> References: <450C0C0E.8060402@SYSTEM.PL> <20060916171840.5dd744b7@Magellan.Leidinger.net> <450C2A46.9010609@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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@system.pl >>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?450C2FFB.3050209>