Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp542897pxf; Wed, 31 Mar 2021 09:36:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzp3VISvGa0rkTNelp+aNGdrg+A281RZw0Y43q/KsOUtwRY0x9sA8b0zQtTZFSKHwqMgLeQ X-Received: by 2002:a05:6402:180b:: with SMTP id g11mr4716692edy.195.1617208615644; Wed, 31 Mar 2021 09:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617208615; cv=none; d=google.com; s=arc-20160816; b=T/KVnb0moenL0xbt+6kRk9guVni3K1mupk7C8g892omIZ/Eq/WxJe/eRUqVxFsS74r Ao7De+3Y2h//dGE7BCzVGumlAmpT434aDR7RBWdKMQ2koZL/k4dCZfIayh0EcqWdG3I5 AAv0ZoIwryFzKB9dA6N1Z5ILtwsNzPxiUKOv8qn9nArBVSzPBR94TBKVkRFL38LQInrm IQfbX1WGiDNEmpcYw7gpe+imVo+rMw26Vya63Oo3BYC+P4zB9aCRK5DpMzmTmC/8mL8/ ZzjGGgdIVaN//1Ba2pR1XzprAHvEOgm8P9x9mEHf4T8GExut3u1hnlrU4Di+2AEpNzns gKNg== 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=VpJ7tCMO1qrKGccvB0qSbQ6uwpcBBCPxhLLAdf1l8MfDwA5etMhf9+KglFMG1pdlor DLzs2MZzLdOmELOV9y/KuF1H/Q7LFGcIUcy3iQ18Wm/x9amaPVgTkWyDwZEJ7ZNmmyXo lscncOBp3d3mmE2K4sBdAyKg7jwRgzmkEW9FrTJ9ywEJ1jNO3AjkIqSXh8dkoNA37l+5 fmRIN8JqaTF6lv0kcj3mMHBhWxTz/Mx8LWbNM5ylHjH6DduP3pSt1CAHun4ybSJonVey epkBIhI5WUoRiurw2+RtfnPanKRTP8678c/OADWvcuk5OrTIv2MaGRrQETe4obg8dgdT 8CdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mail.ustc.edu.cn header.s=dkim header.b=rEPMMiUz; 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 b6si2057293eju.321.2021.03.31.09.36.32; Wed, 31 Mar 2021 09:36:55 -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=rEPMMiUz; 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 S233610AbhCaQff (ORCPT + 99 others); Wed, 31 Mar 2021 12:35:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234400AbhCaQfC (ORCPT ); Wed, 31 Mar 2021 12:35:02 -0400 Received: from ustc.edu.cn (email6.ustc.edu.cn [IPv6:2001:da8:d800::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2C43DC061574; Wed, 31 Mar 2021 09:35:00 -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=rEPMMiUzL+HWH+kbAS0OkvcrqLRAUS2ByDImzgrCVoJ33uPQot Flu0VFv9hfmQDgn7sdVBA/5W1bnIAmCIYMPAV/QR4bEFLcnwYU2dClDuJsxCZ/o9 dEEvtEaRCB0MjE42Mpd4sVwkPl4HwHseN8ieqbaBDdWSYccwBa/hdTnPE= Received: from xhacker (unknown [101.86.19.180]) by newmailweb.ustc.edu.cn (Coremail) with SMTP id LkAmygBX+pimpGRg7b96AA--.53526S2; Thu, 01 Apr 2021 00:34:46 +0800 (CST) Date: Thu, 1 Apr 2021 00:29:49 +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 , 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 v2 9/9] riscv: Set ARCH_HAS_STRICT_MODULE_RWX if MMU Message-ID: <20210401002949.2d501560@xhacker> In-Reply-To: <20210401002442.2fe56b88@xhacker> References: <20210401002442.2fe56b88@xhacker> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CM-TRANSID: LkAmygBX+pimpGRg7b96AA--.53526S2 X-Coremail-Antispam: 1UD129KBjvdXoW7GFy3Cw48Cr4DZw4DKF13CFg_yoW3ZrX_Ja yxJF9xur1rJaykCFZ2gr4fZr1jv3y8WF18uF1Y9ryUZa42gw13X3Zxt3Z5ZF15Zw13WF4x Z3yIqF4UGr1UWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb4AYjsxI4VWxJwAYFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4 vEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40E FcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAFwI0_Gr 0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JM4IIrI8v6xkF7I0E8cxan2IY 04v7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI 0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVW8ZVWrXwCIc40Y 0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxV W8Jr0_Cr1UMIIF0xvE42xK8VAvwI8IcIk0rVW8JVW3JwCI42IY6I8E87Iv67AKxVWUJVW8 JwCI42IY6I8E87Iv6xkF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7IU8PEf7 UUUUU== 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