From owner-svn-src-head@freebsd.org Thu Jun 29 14:12:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD3CBD9E8E0 for ; Thu, 29 Jun 2017 14:12:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm10-vm2.bullet.mail.ne1.yahoo.com (nm10-vm2.bullet.mail.ne1.yahoo.com [98.138.90.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F3631703 for ; Thu, 29 Jun 2017 14:12:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1498745451; bh=dwNm/+TiWvAj71YkN0Qoss85L8jKou+EtKLSjXdXNVM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=jdSbfGvh5kmh0idwmBau5a6avlDeHelOB8m7zEmtmiqSTc+PvJPRnwfo7pErvb1fGQX3W6oH9Dp3Pf/926I8oWHd0ipU3BkvS7R+OMJu/9UI8NjUaYoNmsSq711Wuleo1vXF503fE+9sfQMaylCY2kzfHEGjs9nEr7X+5iOpxgtuRL8PJWCQNPmMQaMaurhbvX+fp1hk6RvXoIY7vYZYa//Uy5rF1mvOh/zFnjEH+33bmZRaYZnTZCqL82zirjqpe4oeckeXeO5GzHvAMkVBC338NC+c3L0qOu+OBWVVk+9ojl98GO3YTME8cdYNNMBLzhq2iDXMrWSPtTYT8kjgSA== Received: from [98.138.100.117] by nm10.bullet.mail.ne1.yahoo.com with NNFMP; 29 Jun 2017 14:10:51 -0000 Received: from [98.138.226.60] by tm108.bullet.mail.ne1.yahoo.com with NNFMP; 29 Jun 2017 14:10:51 -0000 Received: from [127.0.0.1] by smtp211.mail.ne1.yahoo.com with NNFMP; 29 Jun 2017 14:10:51 -0000 X-Yahoo-Newman-Id: 140486.90205.bm@smtp211.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: LlOpHmgVM1mt1iwnSvU8e653oPn7CnGHgJfgPJzObw2FOd6 KfZoKVMSemwQn5ntLDAG542kHNVQjxeCmb.M_VWwQBdhCF3WPvzStjIpy3xW uZEJeamYQF4pP3zQBHVmTinQURO1egVmcmmmJZlnm3F59Sbl1j5ddPflHJqV ce0AjArEAkS_OatHCBnN6DdrY.uwZt88BseYVrfZMNfuOTybkCml8Lpdrblg 3.ljmfF9T_lQQE1aNqcEzzDfA_yDxhLL9326gxqX8JPaD9IwWUmv.siQ8cTR WKZpaS1TwV2HfiCCR5LCFIl1pe7B9pUoDj4GYhdEtJeiKk775eYA._.kRviQ UtdgOJenoO8NvV2GDYyEYEyknkgadVSykWyxVafwL5S3YQaV0uSlzXXk6xM7 8g1mrRaZ2Aiw_NnZCLuGaCXHDrAmG18xeEVF8spewZwXh4A_WHRqcOc1nNAc 59w9BBz9yCh3OvH4kn3FIEctlKnUjaHdNKWT8A1eJW4eVYZeyfCyFxfmvlyY X8Mnk4o3yJfuIdiliPXs- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r320430 - head/sys/vm To: Shawn Webb Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706280402.v5S42bQx089187@repo.freebsd.org> <20170628223238.v456h4t4huwbqt6f@mutt-hbsd> <20170629132333.pl6nk5bsw3fkevdx@mutt-hbsd> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: Date: Thu, 29 Jun 2017 09:10:53 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170629132333.pl6nk5bsw3fkevdx@mutt-hbsd> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 14:12:40 -0000 Hello; On 6/29/2017 8:23 AM, Shawn Webb wrote: > On Wed, Jun 28, 2017 at 06:32:38PM -0400, Shawn Webb wrote: >> On Wed, Jun 28, 2017 at 04:02:37AM +0000, Konstantin Belousov wrote: >>> Author: kib >>> Date: Wed Jun 28 04:02:36 2017 >>> New Revision: 320430 >>> URL: https://svnweb.freebsd.org/changeset/base/320430 >>> >>> Log: >>> Treat the addr argument for mmap(2) request without MAP_FIXED flag as >>> a hint. >>> >>> Right now, for non-fixed mmap(2) calls, addr is de-facto interpreted >>> as the absolute minimal address of the range where the mapping is >>> created. The VA allocator only allocates in the range [addr, >>> VM_MAXUSER_ADDRESS]. This is too restrictive, the mmap(2) call might >>> unduly fail if there is no free addresses above addr but a lot of >>> usable space below it. >>> >>> Lift this implementation limitation by allocating VA in two passes. >>> First, try to allocate above addr, as before. If that fails, do the >>> second pass with less restrictive constraints for the start of >>> allocation by specifying minimal allocation address at the max bss >>> end, if this limit is less than addr. >>> >>> One important case where this change makes a difference is the >>> allocation of the stacks for new threads in libthr. Under some >>> configuration conditions, libthr tries to hint kernel to reuse the >>> main thread stack grow area for the new stacks. This cannot work by >>> design now after grow area is converted to stack, and there is no >>> unallocated VA above the main stack. Interpreting requested stack >>> base address as the hint provides compatibility with old libthr and >>> with (mis-)configured current libthr. >>> >>> Reviewed by: alc >>> Tested by: dim (previous version) >>> Sponsored by: The FreeBSD Foundation >>> MFC after: 1 week >>> >>> Modified: >>> head/sys/vm/vm_map.c >>> head/sys/vm/vm_map.h >>> head/sys/vm/vm_mmap.c >> Hey Kostik, >> >> This commit breaks both xorg and shutting down/rebooting. Reverting this >> commit makes my laptop happy again. > Thnking out loud: would these issues arise due to HardenedBSD using > SafeStack, which relies on libthr's stack code? I haven't been looking at SafeStack lately but unless HardenedBSD took the FreeBSD-specific code from EPFL and did some real work on it, there is little chance it does its work well. Pedro. ps. I would guess Oliver knows about the EPFL code since he did some review on github.