Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3793191pxf; Mon, 29 Mar 2021 11:32:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9s6b1QEx62TfWtoReofYX63GKbK1MDA3zjLCJPko6zETwz1XGIe73bhyTamtl3nJkMow0 X-Received: by 2002:a05:6402:510f:: with SMTP id m15mr30246325edd.328.1617042769716; Mon, 29 Mar 2021 11:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617042769; cv=none; d=google.com; s=arc-20160816; b=UPl33FR6AGPYA3KUxryW1nfBJCRqC9NC1BfZFo6cwNe6PbprBPv5mHNTjGQeJ+bYOR jTD3WWKA9QlMw4/10kvYUpnY6en6tDXYhstxbKLc3xgFFH9AW9zgwvDA1dP/LVOlUYQ0 CA/dXQOgoxVLl+71kGWeO8nM/Ui2T+w/8jxeM1fzBhq0gNNlkrcI44wL3zvdFU8qCXLw xtViCJ0uOVLRwPV85x1STwxdVOeY4vW4aiX9PW0VqOXY9sZQpMLAmzUKMZmP1Acv1aBt 5dwLHVT7pVXQopXP4eS9/Onmy3ERPGZi2FCzRc0R8H8H/heL9b0eAi2YEqFFYTH0Igac Abpg== 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=ik1VNJyYjBgUbqJ51FNWR51hX8kbricRWlnztP2ATL4=; b=oYlbhwj5KN6dszJ60YVbQucPepK7nRbbfKWsrJWwKaeik2sYl6tAPgmWFw00Cv4OYG 3R6hAzRroa28vcRgWeo84pydKp0XludWL/o8mx3Eiika23ezY3wtu+C7hC3nW80bVwzJ MTkxes35f9RBZDJr+QtE1GB2D7sh33CQCT4XMYIrV1Ke123atjwt2NVWoFinWWLKrqAj 9NdipsPdmqFFh7m9vnd/lsNvFthd8lywRy4t98ynbm3ZdButxEUyoj/0XanWtqrhJSXf 1CAwykMbkPX3uTo1uWhJu+0q/K2YEeqiYglxJePj2Xj75gyOWsJbPAALKjEyTEjtXgUg NaqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mail.ustc.edu.cn header.s=dkim header.b=gZBtfH2u; 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 u2si13737782ejg.288.2021.03.29.11.32.27; Mon, 29 Mar 2021 11:32:49 -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=gZBtfH2u; 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 S231758AbhC2SbY (ORCPT + 99 others); Mon, 29 Mar 2021 14:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231751AbhC2SbG (ORCPT ); Mon, 29 Mar 2021 14:31:06 -0400 Received: from ustc.edu.cn (email6.ustc.edu.cn [IPv6:2001:da8:d800::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CF1D3C061574; Mon, 29 Mar 2021 11:31:04 -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=ik1VNJyYjBgUbqJ51FNWR51hX8kbricRWl nztP2ATL4=; b=gZBtfH2uE3I3HFKUYWX6Eo6T+aZXHQWYoo1v5a4TA7E8tFYVdK vOJZ7UeU0ipuRGA959Foxy1Vr2xnCO5k/3H36LRqmxMzs4MkLsiHDzStqOlSTO5I ao/rfWoCN73FpdtnmnRb5mee6rNHc3WhYNGxqaxBNRAsOK/3erwNCZTCM= Received: from xhacker (unknown [101.86.19.180]) by newmailweb.ustc.edu.cn (Coremail) with SMTP id LkAmygB3fkrXHGJgyvdpAA--.50159S2; Tue, 30 Mar 2021 02:30:48 +0800 (CST) Date: Tue, 30 Mar 2021 02:25:51 +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 8/9] riscv: module: Create module allocations without exec permissions Message-ID: <20210330022551.58ce4ff4@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: LkAmygB3fkrXHGJgyvdpAA--.50159S2 X-Coremail-Antispam: 1UD129KBjvdXoW7GFyfWF4rGrWktry5Wr1xXwb_yoWfWrc_W3 WxJry3WryrKa1I9FZ3AanYvr4Iya4rGFZY9FyxZFy7Ga4DWrW7t3s8ta9xuFn8ZryfKrWf GFy3Jr9xuw42qjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb4kYjsxI4VWDJwAYFVCjjxCrM7AC8VAFwI0_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_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjxUciihUU UUU X-CM-SenderInfo: xmv2xttqjtqzxdloh3xvwfhvlgxou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jisheng Zhang The core code manages the executable permissions of code regions of modules explicitly, it is not necessary to create the module vmalloc regions with RWX permissions. Create them with RW- permissions instead. Signed-off-by: Jisheng Zhang --- arch/riscv/kernel/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c index 104fba889cf7..8997b9dbcb3d 100644 --- a/arch/riscv/kernel/module.c +++ b/arch/riscv/kernel/module.c @@ -414,7 +414,7 @@ void *module_alloc(unsigned long size) { return __vmalloc_node_range(size, 1, VMALLOC_MODULE_START, VMALLOC_END, GFP_KERNEL, - PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE, + PAGE_KERNEL, 0, NUMA_NO_NODE, __builtin_return_address(0)); } #endif -- 2.31.0