Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4046172img; Tue, 26 Mar 2019 01:44:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZfbQkMIMvHCy1t9Uu7qP0tXqBZROMkC35/nvT27Xy50NkNMFqna+ZaX/G2jVRUAoPOEdf X-Received: by 2002:a62:209c:: with SMTP id m28mr15690696pfj.94.1553589890044; Tue, 26 Mar 2019 01:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553589890; cv=none; d=google.com; s=arc-20160816; b=FSRojVYtbHm9E5qjwyevYg2jAHAqltf1HV3rHFnqwDMgyeQC1pKohcVQZk8fMm7X1d 65ClTSYP1+/r8ziB9L10qLm+kswEStXiatMOzVCtU6r2+j2GNfDRQUiASQSNbLALY1xV QfBswpcYzg3DBkOjJvjNdf/t5Kkt97S0KfNXovYgbcvXArS3zNAIzEpYXgRSZ5eqjFyE 4px7/nqiTEWp9OeBsug0SDDBJKTSCoWE1508qCDdhr8HjIZExXIJkyQ3KfOc3/Twwq77 zMhmwyYDCwuAQA+6ZBAtsVgN6bkoxMXnF3Zrr7Y3pN8hL0IE97G6c/lOZnaZPQr/idDf oOqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=JBzEHo7t6JOR8Y8Z/y/B4G+A2N/NK/4Z2CW/QrTkX0w=; b=acLnXOXuEpMftxLwXafIFyxA2WAgNXnQFAOU8R0d8dkPDy7w2jsnziXq1Vo34IhQkU 2JdVoXGsjhonQxi7WVVBDhaaE7w9+c7aWmG2jyJsZIsPqPsDwoA6T6sDIWPc9nJIcykC RviVHcA8P0+OvLDbKLQxaU3U1yYSx+Z1LXu/dI7irdC37sHU1zXZoOxZIclfFhYZHhpA iVFO4vQCniJlcO/4TrY6x3iQtFvE8GfOm6UyEzdj7Tn/wkJaNO8nkuXlnBOX+rb+8APm B3UPmNnjZOzRy687qyFVUrWU32r2gyy2weco9to4DYb9kiMbTMK2vsg4oHtZs3dcv6Eq fZqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si16232642plf.300.2019.03.26.01.44.34; Tue, 26 Mar 2019 01:44:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731351AbfCZInr (ORCPT + 99 others); Tue, 26 Mar 2019 04:43:47 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:47630 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730795AbfCZInq (ORCPT ); Tue, 26 Mar 2019 04:43:46 -0400 Received: from p5492e2fc.dip0.t-ipconnect.de ([84.146.226.252] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1h8hgH-0000K7-T3; Tue, 26 Mar 2019 09:43:38 +0100 Date: Tue, 26 Mar 2019 09:43:36 +0100 (CET) From: Thomas Gleixner To: "Saidi, Ali" cc: Dave Hansen , Kees Cook , Peter Zijlstra , Catalin Marinas , "x86@kernel.org" , Will Deacon , "linux-kernel@vger.kernel.org" , Ingo Molnar , Borislav Petkov , "Woodhouse, David" , Andy Lutomirski , "H. Peter Anvin" , Andrew Morton , "linux-arm-kernel@lists.infradead.org" , "Liguori, Anthony" Subject: Re: [PATCH 2/2] x86/mmap: handle worst-case heap randomization in mmap_base In-Reply-To: <037ACE94-A408-4CB0-BCA5-3FF9041E43B0@amazon.com> Message-ID: References: <20190312173248.13490-1-alisaidi@amazon.com> <20190312173248.13490-3-alisaidi@amazon.com> <037ACE94-A408-4CB0-BCA5-3FF9041E43B0@amazon.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1317506103-1553589817=:1789" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1317506103-1553589817=:1789 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Tue, 26 Mar 2019, Saidi, Ali wrote: > On 3/21/19, 9:11 AM, "linux-arm-kernel on behalf of Thomas Gleixner" wrote: > > On Tue, 12 Mar 2019, Ali Saidi wrote: > > > Increase mmap_base by the worst-case brk randomization so that > > the stack and heap remain apart. > > > > In Linux 4.13 a change was committed that special cased the kernel ELF > > loader when the loader is invoked directly (eab09532d400; binfmt_elf: use > > ELF_ET_DYN_BASE only for PIE). Generally, the loader isn’t invoked > > directly and this issue is limited to cases where it is, (e.g to set a > > non-inheritable LD_LIBRARY_PATH, testing new versions of the loader). In > > those rare cases, the loader doesn't take into account the amount of brk > > randomization that will be applied by arch_randomize_brk(). This can > > lead to the stack and heap being arbitrarily close to each other. > > That explains not why you need this change. What's the consequence of them > being close to each other? > > The process doesn't get it's requested stack size and stack allocations > could end up scribbling on the heap. And exactly that information wants to be in the changelog. Thanks, tglx --8323329-1317506103-1553589817=:1789--