From owner-svn-src-head@freebsd.org Thu Jun 29 18:07:30 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 EF0A0DA246B for ; Thu, 29 Jun 2017 18:07:30 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x233.google.com (mail-qk0-x233.google.com [IPv6:2607:f8b0:400d:c09::233]) (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 A3F8B6A0C5 for ; Thu, 29 Jun 2017 18:07:30 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x233.google.com with SMTP id r62so83036523qkf.0 for ; Thu, 29 Jun 2017 11:07:30 -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=wk0rctZMqLhkJ+mUne/WOS00rU5rAAFd9dmIRVmdOqI=; b=UUKXdBImqyPCYEUnzwK6Pfx2mK9TxvY7N748fAOmm/Kw0Sdm8JQliFl5Dr4vVb/sus 4LUDjknHL1ebc54Fd7EdoqHzm8XcEyQHdX/u39peBtGc6RvZDAXt3o6zqgVvbIUpcYdm gnw7fP/OqfqXWnanmih0Sxu/tCf7Kmk1zwdfF9yVZCLbXm6XGbCorWoa7NAWJ8a98xYb M8UFXb8rgB/z0JwPL7CDWiYrhOY+DoPaX+Crq188VcBDnL/pZV4VVp/lhWFFCasQ3om4 0kWLa20UTUtjdrUPoiVBuY2In4ZXxzb3rTu1bIMzpQoqy5dChYkkqXl4wrwCwfW4DnB9 35WA== 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=wk0rctZMqLhkJ+mUne/WOS00rU5rAAFd9dmIRVmdOqI=; b=AYCgP7y26R3868gY3R14sUihp5654ivy7m9V01p5B2anLi0tZ1DC+MhUTcE0O9WUns pGa3XwGV3aAGbpn6Q5z7rUGvOlaTj8rNstrADn4OybXbeAO86g5Odl/tplmdJTfCGCF/ //0DLicPQFtNpWSU6ndbmDngfgS1JPrAMParFxWjeWkHDFlLuc3tlZ2Q6CrsxLVPthgu ARZGVO/TrmcBnE5NvwOL/ils3y6Ha7CKAk0qZnUojkqqgtbcluQ1CoHUu2omg0YYmjan aQUmo2qGNh+2OzjLhlMcH8+mtQvU3jUbFyp6T+cPUBVRU2wUjO/BtBWESulHYTC6Mvbn UMKQ== X-Gm-Message-State: AKS2vOwEKfub6BrV/ufG4F7HoTsTuUlVlr2OX6snnHg6f4i0GePhdwc1 k3zF98FosdZq153Q X-Received: by 10.55.26.104 with SMTP id a101mr21458227qka.202.1498759649729; Thu, 29 Jun 2017 11:07:29 -0700 (PDT) Received: from mutt-hbsd ([63.88.83.66]) by smtp.gmail.com with ESMTPSA id k33sm3335589qta.0.2017.06.29.11.07.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jun 2017 11:07:28 -0700 (PDT) Date: Thu, 29 Jun 2017 14:07:28 -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: <20170629180728.hqmguafgy4kbrwmq@mutt-hbsd> References: <201706280402.v5S42bQx089187@repo.freebsd.org> <20170628223238.v456h4t4huwbqt6f@mutt-hbsd> <20170629132333.pl6nk5bsw3fkevdx@mutt-hbsd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="25tzry76bqduxqao" Content-Disposition: inline In-Reply-To: <20170629132333.pl6nk5bsw3fkevdx@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 18:07:31 -0000 --25tzry76bqduxqao Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 29, 2017 at 09:23:33AM -0400, 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 > > >=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 mig= ht > > > 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. >=20 > Thnking out loud: would these issues arise due to HardenedBSD using > SafeStack, which relies on libthr's stack code? Here's a somewhat crude and possibly improper fix that makes my laptop happy: http://ix.io/y6z I'm not sure, though, that really fixes the problem or just dances around it. 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 --25tzry76bqduxqao Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAllVQd0ACgkQaoRlj1JF bu5MgQ/+KmNU5UBxoFLtr4PIN6FvUFy2qvbOWUqTMyChyOI5q5qjiwlGw9tq1l5e OqfyJMnVNBSxGR7JCWhoQ5PFZtgJ0LWpWk3rWlAnu6GBNy6jpZfG1YkUi9ChVNcR /ZzTAsMs8qb4w8MuZTLJSZ0JfcX7mieZ4S8BBMV69PVZQwxJVf8WaGiWh0r+lGhj dc4f8okGuFDLmD8hepaj9IsM6fT1P6yALMrmJBU9yLa9t7MRZ+jdnlv3FJAxaWKh 8PwV19OQaTmWP+MR/Ng31QBl20zuHaTRewgph0SvwWiHcPPRtvzxYNO1MJfUYvTD GIDWwRcOOmPSW4sDEcqnmB1TJRaQJW+rPX56eJg/EaOJCKcleM3tJyATn1y6xmDF Sefd9EwKY2Lo9pTCchKZqQFIBGBy4U3DRKUK5PZBQPsqoA9OG5b84VXeHkR3eEMm 2EO1Kyu8x5I16GKuFaWcL6XJ4934HZ9qcYSEHpW1fpZhEvU7Ta3XGYaQugik/hsJ iqELtqEXi14fEIY9feca80lMho2yJqOlNTiAOp3v5OdXppGib//dbIsveRYbU9rd khno0Rj+3q7yebPOAAIVwIWbV5Botn9BCxiprwQpxq9FT8KEQnLGqvtFrXo2M7cm ziW06Qdn7jQOmZ3bkd/zI+tgSU7tkahhhLGzuQeX53cidZryvxE= =pM5M -----END PGP SIGNATURE----- --25tzry76bqduxqao--