From owner-freebsd-emulation@FreeBSD.ORG Sat Sep 16 14:37:24 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 B8B3716A407 for ; Sat, 16 Sep 2006 14:37:24 +0000 (UTC) (envelope-from saper@SYSTEM.PL) Received: from mail01.ish.de (pip251.ish.de [80.69.98.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A74943D5C for ; Sat, 16 Sep 2006 14:37:23 +0000 (GMT) (envelope-from saper@SYSTEM.PL) Received: from [81.210.201.87] (account saper@iesy.net HELO saperski.saper.info) by mail-fe-01.mail01.ish.de (CommuniGate Pro SMTP 5.0.6) with ESMTPSA id 75975032 for emulation@freebsd.org; Sat, 16 Sep 2006 16:37:19 +0200 Received: from [127.0.0.1] (saperski.saper.info [127.0.0.1]) by saperski.saper.info (8.13.8/8.13.8) with ESMTP id k8GEb3US007094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sat, 16 Sep 2006 16:37:14 +0200 (CEST) (envelope-from saper@SYSTEM.PL) Message-ID: <450C0C0E.8060402@SYSTEM.PL> Date: Sat, 16 Sep 2006 16:37:02 +0200 From: Marcin Cieslak User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.0.6) Gecko/20060912 SeaMonkey/1.0.4 MIME-Version: 1.0 To: emulation@freebsd.org Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: 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 14:37:24 -0000 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: --- /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. This fixes access03, chdir04, chmod06, chown04, chroot03 and many others. -- << Marcin Cieslak // saper@system.pl >>