Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1203385ybt; Thu, 9 Jul 2020 01:00:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLXTLUBK8ItQW/+SNGRk5octmKfTgbBRMjcsGZcYKS8pO0V2kjywfBmh20V0bOtNKdNBjG X-Received: by 2002:a17:907:42d0:: with SMTP id nz24mr58684158ejb.135.1594281643066; Thu, 09 Jul 2020 01:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594281643; cv=none; d=google.com; s=arc-20160816; b=QE8LB/qbN7LEr5VgnVCeorO525bJHlSl4+cyCUhVFswX+2kdXkQMcwAubN72GfX/cM PE/sUsidySkRlZ4NIdn110PsYjyNJxcjfVHWHdKefEHDIE9enUJ0fbE3Aavp9hsDqt/4 Of+uMLklGC4OQIg9oAEIDZ8irLu3NZUMTT51Hs4FAnyBSb79+1O1uwHzAGKyMutm8dma SXathqlfhElL1k5SNPrUqcENaISJq8XKwmqkIUpXBFgdALc1/WJy8OkdbEIumsLKwq1E kmekYrDGBzEquW957Q9TM2sciBt6RObNGtIaqZfHRPIv77lId/AYW02a+konCmSJB+JB 7TlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Wt1QDD794R7hmrD3hp3wD1teVxEdC9M39HE4DQEegZ8=; b=oq3Y8/obi+nwRFYDbQo3+KWiPoWeOgz5D0zLXO26Rpg9fmGZpBpBUKJ8RP0sGjDafC gFpNKouSchUWe2NaCHLiHDftRJuJ8mvzOrsFQBjiwLerm77JmGFWSQrutVrwXDz/ODC3 35kLPPVcTiPGT8ubrYrb7Gn2NB6H3we6bT1wolEB7jLxjy1YVcY6bLJoAFkCaINx5T+Q KvBgMoU/VZmZdKNf1RenBh6QXP0Rej24217lA3Ave/9c9tc1Y1Ew/eo0XoEot5E1nAVY hcqt8seka5k55cmaCvabwQhOYQTrgldXHMKoIQH4B5BdSaJ4rfOss64f2SAqsQ5sGSMK 5fxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZtCT+Ofj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n26si1456309ejz.133.2020.07.09.01.00.19; Thu, 09 Jul 2020 01:00:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZtCT+Ofj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726268AbgGIH7v (ORCPT + 99 others); Thu, 9 Jul 2020 03:59:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:55424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbgGIH7u (ORCPT ); Thu, 9 Jul 2020 03:59:50 -0400 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DE07C2073A; Thu, 9 Jul 2020 07:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594281590; bh=n8KuoxvesWiAIY+opfod/4XWjPg+flAzBwzo6WbZ1nU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZtCT+Ofj8X751NtW4t93j95+HisHO+Zg6Cayf2kjUr3HAhz7wQB5t2WMZkwMra5mX hOgOPsCmW1ujWjt8/3MKy7jH/DdJ6ZraVCcoovUUOJKhzwSnCmyGXZxlItqdRbnrDw +k+UuTbdwNDMJy+TQRgWE/r2k4cA5YSmy9Cfd3WQ= Received: by mail-lj1-f176.google.com with SMTP id e4so1339982ljn.4; Thu, 09 Jul 2020 00:59:49 -0700 (PDT) X-Gm-Message-State: AOAM532yX1AP50yZLGWv0OeyQff+KQY4i0JgVN88GHwcVpMrI3b8rrtR +x5oLrcAEhvt05zAUDcBcIHVwG0R/QqhRZqCJ28= X-Received: by 2002:a2e:959a:: with SMTP id w26mr4755601ljh.79.1594281588092; Thu, 09 Jul 2020 00:59:48 -0700 (PDT) MIME-Version: 1.0 References: <1594269511-13340-1-git-send-email-guoren@kernel.org> <5c7e9eb0-d811-2e08-87c4-12de9b869b79@ghiti.fr> In-Reply-To: <5c7e9eb0-d811-2e08-87c4-12de9b869b79@ghiti.fr> From: Guo Ren Date: Thu, 9 Jul 2020 15:59:36 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] riscv: Enable ELF-ASLR for riscv To: Alex Ghiti Cc: Palmer Dabbelt , Paul Walmsley , Anup Patel , Greentime Hu , Zong Li , =?UTF-8?Q?Patrick_St=C3=A4hlin?= , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Atish Patra , Guo Ren , Linux Kernel Mailing List , linux-csky@vger.kernel.org, Greentime Hu , linux-riscv Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 9, 2020 at 1:32 PM Alex Ghiti wrote: > > Hi Guo, > > Le 7/9/20 =C3=A0 12:38 AM, guoren@kernel.org a =C3=A9crit : > > From: Guo Ren > > > > Let riscv enable randomizes the stack, heap and binary images of > > ELF binaries. Seems it's ok at all after qemu & chip test and > > there is no founded side effect. > > > > So just simply select ARCH_HAS_ELF_RANDOMIZE :) > > > > Signed-off-by: Guo Ren > > Cc: Palmer Dabbelt > > Cc: Paul Walmsley > > Cc: Zong Li > > Cc: Greentime Hu > > --- > > arch/riscv/Kconfig | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > > index 91bfc6c..eed6647 100644 > > --- a/arch/riscv/Kconfig > > +++ b/arch/riscv/Kconfig > > @@ -20,6 +20,7 @@ config RISCV > > select ARCH_HAS_GIGANTIC_PAGE > > select ARCH_HAS_MMIOWB > > select ARCH_HAS_PTE_SPECIAL > > + select ARCH_HAS_ELF_RANDOMIZE > > select ARCH_HAS_SET_DIRECT_MAP > > select ARCH_HAS_SET_MEMORY > > select ARCH_HAS_STRICT_KERNEL_RWX if MMU > > > > Actually it is already the case: ARCH_HAS_ELF_RANDOMIZE is already > selected by ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT. Oops :P, Thx for correcting, abandon the patch. --=20 Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/