Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9807803ybi; Wed, 24 Jul 2019 10:16:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxV29M/zjGQkEIXhjOIAdhTpP1VIrpAP5miltPmCX0reIsWtvSVSleNi+vH6yDbGQChGRzx X-Received: by 2002:a17:902:ab83:: with SMTP id f3mr86774396plr.122.1563988608664; Wed, 24 Jul 2019 10:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563988608; cv=none; d=google.com; s=arc-20160816; b=mDMKPmTVwv45Vu2HLiMuR4DLw05lkQQlUaZKzJezmWkPdtsANSe+7bQZZAaOEBArsO 7CiITixBvFOVPHbj5OKyMMtNxFpIV2n8Fkf6oOBi4OVP6hopMG0Xm8wG4CHO7niNCjIi aV9a/9ermqRzAWrKZxHEowNMIzaaCrVXfS5/5qz9yMr5vLdpHYzXR4smmPrvC2CwwObz su6RoVveKX93JsyPUsJekwI6qjUogQyOfLb/EfC/b5vwlsB+YFWXIGihJiwNkDBeakY7 uueGpYOhe374w89y1eWR0Z3EyBxqrtTvNZkl/g1cxgvVoqyaUQPoOINSASLfoS8kDftW VM9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ITF8T/T4IRmGXwtRff4SYZQW9zAOexuz5C2yXEWqdiw=; b=vEDk7YTxCC5w5Mr627QrA4bA9PvlPZy8t7mwOrL0FHOcWbC+W4o51Vi9cCCERhAjwC Q4wPObY7cEjz6AZF9enCHfXqxHVZsbX0UWK2S1e44GZ+lHz3DqbUsWSgIWnrNINBdBp7 3uDDczuCGd6OaJFgmRPirxyYESbn4DxV9IzNG830FkP6hjOpQowfFg1lGSUUEOfuyVO5 uECTqFjcUfUvdst1POluxliLb9Ybgysko5QIt+i+lh+A+IwQDda1K7mBb+lsQz9c5Ic9 S1vk7QqyFuJdh8Gf15NuR5GPb/egDpHaqMloEQFkpOUmhI0wiU5kXQb7VYAB73wJM44V bssw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si17832805pjk.57.2019.07.24.10.16.33; Wed, 24 Jul 2019 10:16:48 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728376AbfGXRL1 (ORCPT + 99 others); Wed, 24 Jul 2019 13:11:27 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:34556 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726666AbfGXRL0 (ORCPT ); Wed, 24 Jul 2019 13:11:26 -0400 Received: by mail-pl1-f195.google.com with SMTP id i2so22274095plt.1; Wed, 24 Jul 2019 10:11:26 -0700 (PDT) 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=ITF8T/T4IRmGXwtRff4SYZQW9zAOexuz5C2yXEWqdiw=; b=pSA4u0tyJ7JlLMIahu8xE9Nv7IG7n0au5XkeRxFr+NCHw4jU0Me7rb4bQT8OKzrOj4 jfYPpkmVo5uvTdZklKuAlIDAIXF6xHGnuqCRpmXBsOmHnmEUz6GOln3ay0DWT71Od+LS J94HHs1uvvW7DdKiWv8Qiv0wIfSfzfF0nRp4V2XrlKWcX4Mvz1J4oUkupSF8V9JKFqdS JyYDdG80MN2yuy4YR3u4/h81tngGYS4153ToixySf4i8oU6nenBeLsFgMAqWK8RyvNLY VZMSn0ruAb03gZIi1fuHPxlOc9nkUKcS+NGxVGRkhJx6SQD1ii3+PfQGraq7HV3hPQ2w 77Sg== X-Gm-Message-State: APjAAAXMtgnHqGJAXMDOOtWIEhfbovxmleDJf7DbZraBwazyEXDjsi8p U4VK76CVy+8ht+8EUea8Ayg= X-Received: by 2002:a17:902:7488:: with SMTP id h8mr12079513pll.168.1563988285727; Wed, 24 Jul 2019 10:11:25 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id h16sm51887353pfo.34.2019.07.24.10.11.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 10:11:24 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id BEECC402A1; Wed, 24 Jul 2019 17:11:23 +0000 (UTC) Date: Wed, 24 Jul 2019 17:11:23 +0000 From: Luis Chamberlain To: Alexandre Ghiti Cc: Andrew Morton , Christoph Hellwig , Russell King , Catalin Marinas , Will Deacon , Ralf Baechle , Paul Burton , James Hogan , Palmer Dabbelt , Albert Ou , Alexander Viro , Kees Cook , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH REBASE v4 05/14] arm64, mm: Make randomization selected by generic topdown mmap layout Message-ID: <20190724171123.GV19023@42.do-not-panic.com> References: <20190724055850.6232-1-alex@ghiti.fr> <20190724055850.6232-6-alex@ghiti.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190724055850.6232-6-alex@ghiti.fr> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 24, 2019 at 01:58:41AM -0400, Alexandre Ghiti wrote: > diff --git a/mm/util.c b/mm/util.c > index 0781e5575cb3..16f1e56e2996 100644 > --- a/mm/util.c > +++ b/mm/util.c > @@ -321,7 +321,15 @@ unsigned long randomize_stack_top(unsigned long stack_top) > } > > #ifdef CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT > -#ifdef CONFIG_ARCH_HAS_ELF_RANDOMIZE > +unsigned long arch_randomize_brk(struct mm_struct *mm) > +{ > + /* Is the current task 32bit ? */ > + if (!IS_ENABLED(CONFIG_64BIT) || is_compat_task()) > + return randomize_page(mm->brk, SZ_32M); > + > + return randomize_page(mm->brk, SZ_1G); > +} > + > unsigned long arch_mmap_rnd(void) > { > unsigned long rnd; > @@ -335,7 +343,6 @@ unsigned long arch_mmap_rnd(void) > > return rnd << PAGE_SHIFT; > } So arch_randomize_brk is no longer ifdef'd around CONFIG_ARCH_HAS_ELF_RANDOMIZE either and yet the header still has it. Is that intentional? Luis