From owner-freebsd-emulation@FreeBSD.ORG Sat Sep 16 15:18:25 2006 Return-Path: X-Original-To: emulation@freebsd.org Delivered-To: freebsd-emulation@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F0A516A407; Sat, 16 Sep 2006 15:18:25 +0000 (UTC) (envelope-from Alexander@Leidinger.net) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7BE043D53; Sat, 16 Sep 2006 15:18:16 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from Andro-Beta.Leidinger.net (p54A5ECD7.dip.t-dialin.net [84.165.236.215]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.6/8.13.6) with ESMTP id k8GEtaJH027794; Sat, 16 Sep 2006 16:55:36 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from Magellan.Leidinger.net (Magellan.Leidinger.net [192.168.1.1]) by Andro-Beta.Leidinger.net (8.13.4/8.13.3) with ESMTP id k8GFIBRj082146; Sat, 16 Sep 2006 17:18:12 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Date: Sat, 16 Sep 2006 17:18:40 +0200 From: Alexander Leidinger To: Marcin Cieslak Message-ID: <20060916171840.5dd744b7@Magellan.Leidinger.net> In-Reply-To: <450C0C0E.8060402@SYSTEM.PL> References: <450C0C0E.8060402@SYSTEM.PL> X-Mailer: Sylpheed-Claws 2.4.0 (GTK+ 2.8.20; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new Cc: emulation@freebsd.org, sobomax@freebsd.org Subject: Re: Fix for errno 2 - expected 14 (EFAULT) problems X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2006 15:18:25 -0000 Quoting Marcin Cieslak (Sat, 16 Sep 2006 16:37:02 +0200): I CCed sobomax@, he committed the code in question. Maxim, do you remember why it is always required as the comment suggests? > > LTP tests illegal memory by mmaping one-byte area region with PROT_NONE. > Old FreeBSD (before 1.333 version of /sys/vm/vm_map.c) always silently allowed > reada access - see http://www.freebsd.org/cgi/query-pr.cgi?pr=64573. > Linux emulation (initial version of linux_machdep.c) always added PROT_READ > to match FreeBSD behaviour, I think this is no longer necessary. > > The fix for i386 is easy: Maxim, Marcin noticed it isn't... some other ones (mmap and writev related) fail now. But at least we have an idea now where to look for the error. > --- /usr/home/saper/b/src/sys/i386/linux/linux_machdep.c Fri Aug 5 > 01:25:32 2005 > +++ /sys/i386/linux/linux_machdep.c Sat Sep 16 15:13:47 2006 > @@ -549,7 +549,7 @@ > bsd_args.len = linux_args->len; > } > > - bsd_args.prot = linux_args->prot | PROT_READ; /* always required */ > + bsd_args.prot = linux_args->prot; > if (linux_args->flags & LINUX_MAP_ANON) > bsd_args.fd = -1; > else > > However comment in the amd64 file indicates that for some Java applications > PROT_EXEC should be added as well. I think we can remove PROT_READ also from > amd64 part anyway. Anyone with an amd64 system out there and willing to test this (with the LTP testsuite as described on http://wiki.freebsd.org/linux-kernel)? Because this doesn't seems to be the final fix, it isn't necessary to test this particular patch, but it would be nice to know if there are some differences between the results on i386 (as can be seen in the wiki) and amd64. > This fixes access03, chdir04, chmod06, chown04, chroot03 and many others. Bye, Alexander. -- Over quota? "du -s * | sort -n " will give you a sorted list of your directory sizes. -- David Scheidt http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137