Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1105978ybt; Wed, 8 Jul 2020 21:40:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCMj/r+JERbQ80JnIi/O8dBDAs0gCy+v3J6dH6neXhwaFXXyVvu+OMsWdqYbwzYZAwbkGQ X-Received: by 2002:a17:906:54a:: with SMTP id k10mr53431200eja.480.1594269608534; Wed, 08 Jul 2020 21:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594269608; cv=none; d=google.com; s=arc-20160816; b=fnTZUpGX9gmzW+QTrj2vfD0SRVkRFtUVXkni+wHGGIRYd3ExRu6h7DFYOn1nougfXD vM4TvSuGQ5RdDZ4zAr1UK1o7TYnLm5SWYSvau4cj0gk6D613uClGcalJ36Z/8BFH5nvo rCjy/mydP734gmukdc15yXeTSikAfYis8nw61x6WspkBI/JjScYmhtIo5YwXVuyqWuIO 6HpFK5n96CErUDykNaLivOQa8g6KevOiE6wHAf6Lzf3W9LjP9iNd8Gbv5B63J6sEOE7w KaISBRY00HVFPferEg/wCJL4rUPBECEy3ddQ6AYPRa9LugDgfENnAFJge5LjJMmHKyKQ kE/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=GsOVzpVZWNruKTSVT0pNiOQWs+xSCaJEYOz2vn3Qg1k=; b=UKHil6/6RHbYDqP1VoKLpKRXlSV9C/7zm+roidGtM7HLT8Xd7yqezm3RYsDxOj/qz1 BdgUWoRLr4Gk/5Vtn1hY+bhic4LFhitZPhYQtHHDO0Opj/hou2AzOgSS2e8BCaAXYUpm CQlKy4FVsHuBMcLWPpmhUgZHN5+ka6x5pcF1brDjKnekqgMdxqPCDqXvXa6j+TGmSgds lmONKRU+pZSXoirS5v2bY9EXanTS64SvLfOHJfu5ODCJXIjf0br+x10RSHPJyVABr2i1 yH8kschzTc6oZ4BgBaxHuY1+/B7ywnsD5tcQMGSQCsBjAY5Unkcl61B0wA7aVIDf+gm3 RwTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d8hxSgcP; 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 z5si1144268eje.126.2020.07.08.21.39.45; Wed, 08 Jul 2020 21:40:08 -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=d8hxSgcP; 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 S1726416AbgGIEja (ORCPT + 99 others); Thu, 9 Jul 2020 00:39:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:40266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbgGIEja (ORCPT ); Thu, 9 Jul 2020 00:39:30 -0400 Received: from localhost.localdomain (unknown [42.120.72.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2196D20674; Thu, 9 Jul 2020 04:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594269569; bh=EzEck5pK05sjzHneaktRgOUwg6NdvPNK4uNthDpoQk0=; h=From:To:Cc:Subject:Date:From; b=d8hxSgcPxbbd08TV7oJ+807uJ7gS/2ZfhyWs5TQWkLCFurJsAjhQnErf8p/c+BAB9 l7DJP93A6bvQWdYn9Z8p9ArLTP+BDu3z1K5ZQbRjcHB5Yb1z/aag2vWoxXOffgVblQ rHRj6EoSocX1nEDAGlV7FSo9+1v2YBoxx6m8c38k= From: guoren@kernel.org To: 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: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, guoren@kernel.org, Guo Ren , Greentime Hu Subject: [PATCH] riscv: Enable ELF-ASLR for riscv Date: Thu, 9 Jul 2020 04:38:30 +0000 Message-Id: <1594269511-13340-1-git-send-email-guoren@kernel.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.7.4