Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3794058pxf; Mon, 29 Mar 2021 11:34:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5ClrUSLcmCEoqbKBDYGZAEdOzO/mT2TbsbLCTDMtjhoGKg8T5vDhJx1sllMwM2GSSKA2U X-Received: by 2002:a05:6402:5244:: with SMTP id t4mr29895788edd.87.1617042871847; Mon, 29 Mar 2021 11:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617042871; cv=none; d=google.com; s=arc-20160816; b=t4mZgkzWfYrioZchEPOBP5vcgLV/6ZW2fiGwcxuzSjTMKmBz9tEUXWsYDrPEL183vo fj9lmtc8qrMoAFODfgnYsx7faCe6pnXyQnWq6NBBGYmR+Nht5tt8bSjH42Ry3w0YJ+pp DhmpWhtxKkOuKEsVHOxutRFtX7FJEJ1tlkDnouTD+YO+zqNAZsJfEHyEKGqy6QO7mhPa +v/HCELSAWoMZ4ew6xxMqEcYmtWWA/IK9HVeKoTpxLZe28WWWsaB2DbItzHvAsrelRQx awhAkZFd9x+mOhKX5RmysPWQPmp7kYd3KacLm79SpKFpDQZgXNL/AY1p2RCdWX/sgYUU LcAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9CYVVSdbdIN1CqoSzahmxkYgo2mgL2GjKI5zP4cVXEs=; b=Jx9+EjvDtBIcFUG9azXSdTDlDMgxgdEN4AtYxEJ1fO2FOAkTdV0qRyTDJDe3j9Zz/g Xdj5Bh3Yb+WGHCH1SGpNCYI5pcZhtVgHBEQc2mTxl8BljBD76U5Zdh+rqYrYQuwxL7UM N1k2m545r3Mr4nKslFJA+AdIO4XpRRI5Rq3wvtVfiCZmDLaQnGGkNO8cdLVsCRrf4cex M/ALx+N1E5fTLZT1BScQdopCNJUv9HQc7Jf6s2Na3+w5gZZIdTQDtQukeslaqklWyRU5 +Ixthn6wm/Pgs8aikyPnzEtbrfEa02Gbl+VeU1hypFq+fE0c0Lb2D1+vP1jUFbhTS04W mzRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mail.ustc.edu.cn header.s=dkim header.b="KJWdSb/T"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mail.ustc.edu.cn Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 28si14244174edw.302.2021.03.29.11.34.09; Mon, 29 Mar 2021 11:34:31 -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=@mail.ustc.edu.cn header.s=dkim header.b="KJWdSb/T"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mail.ustc.edu.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231743AbhC2Sbw (ORCPT + 99 others); Mon, 29 Mar 2021 14:31:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231524AbhC2Sba (ORCPT ); Mon, 29 Mar 2021 14:31:30 -0400 Received: from ustc.edu.cn (email6.ustc.edu.cn [IPv6:2001:da8:d800::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E6327C061574; Mon, 29 Mar 2021 11:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ustc.edu.cn; s=dkim; h=Received:Date:From:To:Cc:Subject: Message-ID:In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=9CYVVSdbdIN1CqoSzahmxkYgo2mgL2GjKI 5zP4cVXEs=; b=KJWdSb/TJcKR5yNesAvzq5MBEond1rkkI7McqDa7koDle4b1SC akS/DCnzY9OQ6K7j58zz8D+PrTcm56+GgQGVtpJwwDBH/9DjFLl/crGebyHlwXFO ACxxwNl+/TSZa7C6DPttQ2jeas3KWDgYxcJrQ6EHjpxWpxGK28Id9Bwl8= Received: from xhacker (unknown [101.86.19.180]) by newmailweb.ustc.edu.cn (Coremail) with SMTP id LkAmygBnuJrxHGJgRPhpAA--.5621S2; Tue, 30 Mar 2021 02:31:14 +0800 (CST) Date: Tue, 30 Mar 2021 02:26:17 +0800 From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , " =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?=" , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Luke Nelson , Xi Wang Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH 9/9] riscv: Set ARCH_HAS_STRICT_MODULE_RWX if MMU Message-ID: <20210330022617.525104ce@xhacker> In-Reply-To: <20210330022144.150edc6e@xhacker> References: <20210330022144.150edc6e@xhacker> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CM-TRANSID: LkAmygBnuJrxHGJgRPhpAA--.5621S2 X-Coremail-Antispam: 1UD129KBjvdXoW7GFy3Cw48Cr4DZw4DKF13CFg_yoW3ZrX_Ja yxJF9xur1rJaykCFZ2gr4fZr1jv3y8WF18uF1Y9ryUZa42gw13X3Zxt3Z5ZF15Zw13WF4x Z3yIqF4UGr1UWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb4kYjsxI4VWxJwAYFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4 vEx4A2jsIEc7CjxVAFwI0_Cr1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVAC Y4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E87Iv67AKxVW8JV WxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkI wI1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxV WUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a6rW5MIIYrxkI 7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r 4UJVWxJr1lIxAIcVCF04k26cxKx2IYs7xG6r4j6FyUMIIF0xvEx4A2jsIE14v26r4j6F4U MIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjxUcyCGUU UUU X-CM-SenderInfo: xmv2xttqjtqzxdloh3xvwfhvlgxou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jisheng Zhang Now we can set ARCH_HAS_STRICT_MODULE_RWX for MMU riscv platforms, this is good from security perspective. Signed-off-by: Jisheng Zhang --- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 87d7b52f278f..9716be3674a2 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -28,6 +28,7 @@ config RISCV select ARCH_HAS_SET_DIRECT_MAP select ARCH_HAS_SET_MEMORY select ARCH_HAS_STRICT_KERNEL_RWX if MMU + select ARCH_HAS_STRICT_MODULE_RWX if MMU select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU -- 2.31.0