From owner-svn-src-head@freebsd.org Thu Jun 29 13:23:36 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 C3C81D9D828 for ; Thu, 29 Jun 2017 13:23:36 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7790B8466F for ; Thu, 29 Jun 2017 13:23:36 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x22a.google.com with SMTP id i2so73978192qta.3 for ; Thu, 29 Jun 2017 06:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FFsUDnouX7hRQVrXhKKp1Fu1y6+7ho0mNE1rbq11LRs=; b=V5JXnVfRtpf9bx0NvtqG3xc1kvgpebFIIDFj5PykRksLkY72IRliRDEGF6qB1PY8u2 TimPA24if1QSkv3VguOq+uAY6jDAOqWX9jzZbmPlqx15KyNo7VS5EBawQLmIaocNFtEz eb0JqoFJXqS5cYZaRm15fr94f5iVxHvX/ffQcGUNS8HpP5nzF/rC/RUf9A260icixh7g 0dyvqVeiemRxsf7sLu65DxvnmL8iNIZfXS+u+30cBVIFFOytbK6QkhQG3nci65AP+awc sff1+PT1ka5dBLiJveu2s5584rWFwjTMyiaIkuImT6eXEOKirELXK4LnQwgBgz2ARX/K IzJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FFsUDnouX7hRQVrXhKKp1Fu1y6+7ho0mNE1rbq11LRs=; b=Y7iMlwrFhUgcskCcZ331QWFpp2y7oeEru0Y6qU81tgaqcHa8Tp2YL+7N5zf3HR70hA BAEI/WEPRZvrDoYHOZua7ufWWqxI94cz65izFsT888veT9ZMqeNjSV92gwehnnOrRf9+ tJ6wJ+K1rxIgEyz7PX+PPxxYUvsQcjD6QgH2Pq8U92+Va0Ne5vJwrRb7X9xoSx1aFsdr kKlQtB2YGzIVvxZy1w7CFIKIQyWKjhjWm7o8XYUI6uCDyXOKY+Ep1FQwu1f6Xndn0Y3E /wmDPnNrWDFdCyW+6YtsJAtHjCrgmh63LQQNuqi11F61l6nMVGKgaqxhgaI9N7ryZr5w axNQ== X-Gm-Message-State: AKS2vOyFXaKFZv/svoUXgrQ+aTK8yl0ySoYngFu4V7FKPPFwub6RP/26 s1giTraNbHE64DCvUsWbnQ== X-Received: by 10.237.32.202 with SMTP id 68mr20616641qtb.128.1498742615382; Thu, 29 Jun 2017 06:23:35 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id r33sm4246691qtc.43.2017.06.29.06.23.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jun 2017 06:23:33 -0700 (PDT) Date: Thu, 29 Jun 2017 09:23:33 -0400 From: Shawn Webb To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r320430 - head/sys/vm Message-ID: <20170629132333.pl6nk5bsw3fkevdx@mutt-hbsd> References: <201706280402.v5S42bQx089187@repo.freebsd.org> <20170628223238.v456h4t4huwbqt6f@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zdzlncmx3plci7qg" Content-Disposition: inline In-Reply-To: <20170628223238.v456h4t4huwbqt6f@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20170609 (1.8.3) 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 13:23:36 -0000 --zdzlncmx3plci7qg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 > >=20 > > Log: > > Treat the addr argument for mmap(2) request without MAP_FIXED flag as > > a hint. > > =20 > > 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. > > =20 > > 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. > > =20 > > 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. > > =20 > > Reviewed by: alc > > Tested by: dim (previous version) > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > >=20 > > Modified: > > head/sys/vm/vm_map.c > > head/sys/vm/vm_map.h > > head/sys/vm/vm_mmap.c >=20 > Hey Kostik, >=20 > 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? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --zdzlncmx3plci7qg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAllU/1MACgkQaoRlj1JF bu4QVRAAjR20fRt6KlzxDIDzGILImR2JxX0lrX/Cl7tccUcIigJNWlYnYmYm2UyH qgILf4NELCJoLZ2b1wA54DXu5T+h9DeXHpL5UTPWwWnqK4PJHuOmrk0wMOjGA09q V6vx9a7HmJ2jdpzk0pgH8Ed1XR5z6EBIcJIkuuRV1sUbc9mzQpRKU3Ot961b00vX 8SkavhWIvU2iTU4jVjj+GpUQTgWUG/5vA/KUMLJibelKu5PIvmd8nCY8b7UYt7Qw IWvijRly5nrcjmuimq/zC9DOz9dJtjFZV85o/2CRAg3LZoKT0BL2YqDQ95ZaSdgL Drn9YhnvBgFS/C9f7kGq9afjJXjozItq+bFH2Fe3PzOxZkYuOlnwz5D7QW93diVu pMKqQZbyFjBOvziPrK74aKZNOqJrIoiczTI+AYuZc/VkKV2a+S6ylEy9a9jjUS5q p//Eohs3kJ2x/D/vQbP0nax/6zvQNBIcxezxazBcMzJ2f6fvIScpmasisfHBNdsB Pk5R8aK6lp5WMVdqs6nSjv2yUyYn65NJwAyqXU2VqA/GsQ3DeMtrce42zzWZeoZm oOal0UnombPF/3QGfAKSBnSjYt7jMu40bUSUvgw71/PFUTBemEOpdf/Uc6jtdKQb CJvTeO9UBBZAZpB6F96EZ4Ge6N/2Ho08R+AquA3q+lG5OaJzfEE= =BGoy -----END PGP SIGNATURE----- --zdzlncmx3plci7qg--