Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp698558img; Thu, 21 Mar 2019 07:11:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7NpH5x2ZrtLnojVbuvp6HsDmpuyJ/Q7C43Tpft/RK4RfkhVXbI5Tk2hLG8/LDmYwT/Wfx X-Received: by 2002:a17:902:d24:: with SMTP id 33mr3774783plu.246.1553177476833; Thu, 21 Mar 2019 07:11:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553177476; cv=none; d=google.com; s=arc-20160816; b=lecarIGnW4MGhFz29+fRRUkwUrjn9RGT/S2J8zrfGjPQZ1driAcY9aFWKz7dP6/GI6 E/I9216uHVAO4GPOalMDJi6xKyJVzIz1LK7xYjtmlYmbl4De08ZyTCSDqeTlPUgZ+ySf 4R4cxtqIrYG6No3L5HAHjRbfkNXDz/Yc+sUrwGtFo9yDxRxKBPLHWw+dkRAr0G6eEvuH OEcCfCHb4G6WdLoKSvRhwnYrwCppXfdyiCZgHqJaDTPLe81WEibpZxwbEIIm0cnVDqIx 0/WV9V7qk76WyiqDh05C++9p/lL8uT/+sk4aMJn5MfkVDNhczX6+z7sCON9TZi4T5ZPg 5fZQ== 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=/5+qhbk5TUJBayIIDE7abxNl8J4hJbp8aTRU+uBn3wc=; b=v5igYP54QSvGJheMi531C6dk3r08QRLaIQ1QV7K41Cdhvyo0EFc4DRxmlLOmag1kS4 cVKqIeRHNDQs/3P1zk2jeTScVw5YFa6W+ByUZIbwg3dtg0PkbQ4XygPFTXvzoCI7LSRj wRrANBPqTfjnIsMZic0j39j6ZXc10b5cwMF7wruVryhaeHhU8H/FEbzXQL0o6gVjTha7 PKgIHKJtkegYBFpQJLA9p24Fn7yVuB20U+5jPD5aFIaJLVyE6uorjNDB64l2a6VZFbQO 1AvHA1d/6NHJ09jPhj8hllsbp8AUnms17FHSVOn0pDJXafEIUG1kKbb9hmAGFjvIVJWh 64oQ== 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 j22si4149049pfn.284.2019.03.21.07.11.00; Thu, 21 Mar 2019 07:11:16 -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 S1728309AbfCUOKG (ORCPT + 99 others); Thu, 21 Mar 2019 10:10:06 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:38233 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727823AbfCUOKF (ORCPT ); Thu, 21 Mar 2019 10:10:05 -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 1h6yOM-0005eL-PN; Thu, 21 Mar 2019 15:09:59 +0100 Date: Thu, 21 Mar 2019 15:09:53 +0100 (CET) From: Thomas Gleixner To: Ali Saidi cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, "H. Peter Anvin" , Andrew Morton , Kees Cook , Borislav Petkov , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Dave Hansen , Will Deacon , Catalin Marinas , David Woodhouse , Anthony Liguori Subject: Re: [PATCH 2/2] x86/mmap: handle worst-case heap randomization in mmap_base In-Reply-To: <20190312173248.13490-3-alisaidi@amazon.com> Message-ID: References: <20190312173248.13490-1-alisaidi@amazon.com> <20190312173248.13490-3-alisaidi@amazon.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-783148278-1553177398=:1784" 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-783148278-1553177398=:1784 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT 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? Thanks, tglx --8323329-783148278-1553177398=:1784--