From owner-cvs-all Fri Feb 5 12:39:44 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA26969 for cvs-all-outgoing; Fri, 5 Feb 1999 12:39:44 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA26956; Fri, 5 Feb 1999 12:39:41 -0800 (PST) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.1/8.9.1) with ESMTP id KAA01667; Fri, 5 Feb 1999 10:27:11 -0800 (PST) (envelope-from jdp@polstra.com) From: John Polstra Received: (from jdp@localhost) by vashon.polstra.com (8.9.1/8.9.1) id KAA22713; Fri, 5 Feb 1999 10:27:10 -0800 (PST) (envelope-from jdp@polstra.com) Date: Fri, 5 Feb 1999 10:27:10 -0800 (PST) Message-Id: <199902051827.KAA22713@vashon.polstra.com> To: dillon@FreeBSD.ORG Subject: Re: cvs commit: src/sys/vm vm_unix.c In-Reply-To: <199902050749.XAA35519@freefall.freebsd.org> Organization: Polstra & Co., Seattle, WA Cc: committers@FreeBSD.ORG Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk In article <199902050749.XAA35519@freefall.freebsd.org>, Matt Dillon wrote: > dillon 1999/02/04 23:49:29 PST > > Modified files: > sys/vm vm_unix.c > Log: > The elf loader sets the permissions on bss to VM_PROT_READ|VM_PROT_WRITE > rather then VM_PROT_ALL. obreak, on the otherhand, uses VM_PROT_ALL. > This prevents vm_map_insert() from being able to coalesce the heap and > creates an extra map entry. Since current architectures ignore > VM_PROT_EXECUTE anyway, and since not having VM_PROT_EXECUTE on data/bss > may provide protection in the future, obreak now uses read+write rather > then all (r+w+x). > > This is an optimization, not a bug fix. > > Submitted by: Alan Cox Wouldn't this change break things like just-in-time compilers, if it weren't for the quirk that our currently-supported architectures ignore VM_PROT_EXECUTE? I think it would be more correct to take the opposite approach and make the ELF loader use VM_PROT_ALL. That's what is done for a.out. I believe the stack already needs to be VM_PROT_ALL, because of the signal trampoline code. I think we should change the ELF loader and RTLD to grant execute permission whenever read permission is present. I'm willing to do the work if there's agreement. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Nobody ever went broke underestimating the taste of the American public." -- H. L. Mencken To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message