Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10433697ybi; Wed, 24 Jul 2019 23:08:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7XOXuEV4P5ADaP9k/8935AFTEkS9m/gJyrJEnW41uKlBqmPGStjee4Txgp9QFNw1H63Wa X-Received: by 2002:a63:608c:: with SMTP id u134mr85096389pgb.274.1564034885229; Wed, 24 Jul 2019 23:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034885; cv=none; d=google.com; s=arc-20160816; b=aaaBj/mKMucXQ/a6ZT965tlGXjN9NrcjsUN8IT0RSjETnW9qJff7f3+TS08XcAo2sA D1Bd1AbZ6r9tP8+UOxK8S08WeOuwvTDSLKMQQDtVhmgbqSMpHstDHFgCF+plgQij/fVC jAGLyyTcC7JSmueych1JxfcRzrINuKIdFqJfzyKftWreZl5SovxeXP9HKt1T909Mc72w 6G6np0lbWeLBihCRR8o25aYw0gNxUzZeXuqyPa9nTvxqwbAgxZavBIwliolFsijq9T4S DM+LiMMfWm8YVr83yDMJTvmBWqX0TGCV+YThdSYvJt2tUibqpm68ShSgKV3vY48fNu5K RCqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=hy5C7+tMYcPi6mDDZ2c8E8MjWGpi30cOGmtOOK8j0SQ=; b=YOlcvDt4MdBkp5Bs2Epza2IKYnn+Tpxq1q1ur5WNVBAKGukl4fFe3/OtXS+qma1mkK tviDBDPuR0UGasPTIv2GQti9dtDvJfJbt+2iwGg1uS7P58Lf1qqnCEzp8l5E2d7i3sky hLmT7kDJsvxn3VFz1WQbwFTVrIVES6dohR7aa4Ept1TRMCavi9SNRa6V0YN8Mbz7W5Zd Eu1zQO5HAg06F243t2jVFcG8pselG4SODUUc4aT9Y9jRtl9GvlcHJmHc4yFLRjIYWBMK NljL0H5ejXM2yG6OZxrI3moPlWurJKH+iEP8w2tcIjvk88BprhW8xHWDc1MuxnoCksE6 daNA== 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 v62si19966253pgv.126.2019.07.24.23.07.50; Wed, 24 Jul 2019 23:08:05 -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 S2391598AbfGYFsw (ORCPT + 99 others); Thu, 25 Jul 2019 01:48:52 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:58705 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726312AbfGYFsv (ORCPT ); Thu, 25 Jul 2019 01:48:51 -0400 X-Originating-IP: 81.250.144.103 Received: from [10.30.1.20] (lneuilly-657-1-5-103.w81-250.abo.wanadoo.fr [81.250.144.103]) (Authenticated sender: alex@ghiti.fr) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 83A0560002; Thu, 25 Jul 2019 05:48:44 +0000 (UTC) Subject: Re: [PATCH REBASE v4 05/14] arm64, mm: Make randomization selected by generic topdown mmap layout To: Luis Chamberlain Cc: Albert Ou , Kees Cook , Catalin Marinas , Palmer Dabbelt , Will Deacon , Russell King , Ralf Baechle , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Paul Burton , linux-riscv@lists.infradead.org, Alexander Viro , James Hogan , linux-fsdevel@vger.kernel.org, Andrew Morton , linux-mips@vger.kernel.org, Christoph Hellwig , linux-arm-kernel@lists.infradead.org References: <20190724055850.6232-1-alex@ghiti.fr> <20190724055850.6232-6-alex@ghiti.fr> <20190724171123.GV19023@42.do-not-panic.com> From: Alexandre Ghiti Message-ID: <8dd7b018-7f17-0018-0fcf-d0257976d275@ghiti.fr> Date: Thu, 25 Jul 2019 07:48:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190724171123.GV19023@42.do-not-panic.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: fr Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/24/19 7:11 PM, Luis Chamberlain wrote: > 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? > Yes, CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT selects CONFIG_ARCH_HAS_ELF_RANDOMIZE, that's what's new about v4: the generic functions proposed in this series come with elf randomization. Alex > Luis > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv