Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1130900ybt; Wed, 8 Jul 2020 22:33:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2eh4Y08k8XLn09A+3/w5pQ+Zsj35qGJ3l7+DJHkzQhC/9C14nxGAFGo5Nii0IvWRkBS+f X-Received: by 2002:a17:906:c201:: with SMTP id d1mr48110909ejz.40.1594272802809; Wed, 08 Jul 2020 22:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594272802; cv=none; d=google.com; s=arc-20160816; b=WrTSDj6FTHxWWF0bQylf/LEnZo5yZuJoHxwtRKzUhULrfgcPnjuP+J24TeENNpf0HG g+gdy6l8JrONvd/OD7v+NybVbyE5u8f/XdT9GKjoNae0ZJtZgM1TkXL+kc/39lp5ak0N 1346ju+jF0Br23wX0wxfF0PZyDWeIEVlfIBiemCVaBGhc6itWyLI5x/yvPW5Rswy9GdG /kyR1jfKog6DMRKmb2dJKCw5qQDeU3o1e9VIn6sMXFmWshGm0LpFndhiTsvzlWcmMU4c +nNSOPekILP56NuiMsBoLlwoRdLAl58Fzw4me/Ev+4pROefsoc6FRWxjjeFJLvqmHMJF QfRA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=8oNrVBpNBfqBfqpId9YAKxTMooNk/6cj/xBLUuNnh+Q=; b=ke0NLqjBSoyaCfjR8TV0HzPPgFxwfktcc67MZn8U4VmwK3U1haUZsJy/hQnADt+dBU MWSCSsPtapTl5DZFIV8b9kYbUDwGUvQFCeV3DeOHsklE6+2laAfmf7tv1sLtDZpLNtc8 E0+Vfbcq+GGBNV2F/K2Zj8TDutxV474X0jXQviQwYcRX5gJ1nUuTG8iE92SMt9YmktZ3 ACAoFFlefbbxrfIavQ+eiIvq/aiepyGrCfoEVHcDGPaZe3zpnLWs2vbD0jUlGvMGqNIc ddaAZoZ9rETWo3f9JbuYp8QFZ3aLwj8LJPZmeIqDy9Jm3ZOwpbSZ0f3vMfqMwEW2UuWQ iCMw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm17si1487045ejc.707.2020.07.08.22.33.00; Wed, 08 Jul 2020 22:33:22 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726519AbgGIFcQ (ORCPT + 99 others); Thu, 9 Jul 2020 01:32:16 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:53513 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726091AbgGIFcP (ORCPT ); Thu, 9 Jul 2020 01:32:15 -0400 X-Originating-IP: 90.112.45.105 Received: from [192.168.1.11] (lfbn-gre-1-325-105.w90-112.abo.wanadoo.fr [90.112.45.105]) (Authenticated sender: alex@ghiti.fr) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 6345740007; Thu, 9 Jul 2020 05:32:06 +0000 (UTC) Subject: Re: [PATCH] riscv: Enable ELF-ASLR for riscv To: guoren@kernel.org, palmerdabbelt@google.com, paul.walmsley@sifive.com, anup@brainfault.org, greentime.hu@sifive.com, zong.li@sifive.com, me@packi.ch, bjorn.topel@gmail.com, atish.patra@wdc.com Cc: Guo Ren , linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, Greentime Hu , linux-riscv@lists.infradead.org References: <1594269511-13340-1-git-send-email-guoren@kernel.org> From: Alex Ghiti Message-ID: <5c7e9eb0-d811-2e08-87c4-12de9b869b79@ghiti.fr> Date: Thu, 9 Jul 2020 01:32:06 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1594269511-13340-1-git-send-email-guoren@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Guo, Le 7/9/20 ? 12:38 AM, guoren@kernel.org a ?crit?: > 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. Thanks, Alex