Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1576006ybm; Thu, 23 May 2019 03:27:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2Sy+0D80GuL+xcr6Y3EncLVXnLUg5cLnTOh8sacPFx3swxz7/zoAXHRQMAhH+TnyStFT7 X-Received: by 2002:a65:52c8:: with SMTP id z8mr27328361pgp.10.1558607258621; Thu, 23 May 2019 03:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607258; cv=none; d=google.com; s=arc-20160816; b=Mb8KI5h0hZK3V7vMDXn3QhvLd7CBZQYWhe41xV4rtHnbh3Vq0yYDiNDBno8bwcI1GI iXhh4IADG8q318D2cnmumHbWEcI8JS0XktpF2sPInowIK2hTlXHkpTxo8rijHxmmYaO4 eUyfDFmzw8YNoNvuSQ/9BsgnzVKOIQs+YGv+XmRI6L+NHSm87S2uvU1VUUrt+cgj1PbW RiDzDrReoa9ZXXIl2XnMwDSsJ6YvXp6YCYRW9oQnQMdAF43j1pvZLjAwR9cXWOKfa6iA 2zNgkvFUEs2PQ5/ffahty30sOZYZcCxLKqeW+QGeEyjc/kmkTmqKKUx47MS1wpCd0t+V wGOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=CgVRI7La6azGi+8bpjMOEinvODC0idZKqtOplB5om6c=; b=ZGLwnOMOP8EUfVBkpOxOySGSoluCeEcOW4zBDfnDqZT05CoCzWcLKp4pLbcTXJj19k +w1vO0qNtuBnsxCD6KJKKp0us49QYtdqT5ERAPNy/JzQIdRzn97AQfwXvEV36t0v5E+a BDss07K4sG5ozLUnjRHcOC/sdfvIpGTD+TKPfPAviXdvmTg58sEsqNRT6RyKDoaw9v+Q H69x/aDI6CuM7XcBJLunYgLuth5/Rb8fPWUbK04/qQPIbtnd8rc3ZPK36KhtKe/ObmtX GW5AMNj6FPEOvjjigDwos2Pff8tHV3+6BZo94A5jKPAotMhCjRODc1SJP9esUH6K5IBF /KKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e123si28033136pgc.24.2019.05.23.03.27.23; Thu, 23 May 2019 03:27:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730534AbfEWKYj (ORCPT + 99 others); Thu, 23 May 2019 06:24:39 -0400 Received: from foss.arm.com ([217.140.101.70]:42706 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727434AbfEWKYi (ORCPT ); Thu, 23 May 2019 06:24:38 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7582D15AB; Thu, 23 May 2019 03:24:38 -0700 (PDT) Received: from e111045-lin.cambridge.arm.com (unknown [10.1.39.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5623A3F718; Thu, 23 May 2019 03:24:36 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: marc.zyngier@arm.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, Ard Biesheuvel , Nadav Amit , Rick Edgecombe , Peter Zijlstra , Andrew Morton , Will Deacon , Masami Hiramatsu , James Morse Subject: [PATCH 4/4] arm64: bpf: do not allocate executable memory Date: Thu, 23 May 2019 11:22:56 +0100 Message-Id: <20190523102256.29168-5-ard.biesheuvel@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190523102256.29168-1-ard.biesheuvel@arm.com> References: <20190523102256.29168-1-ard.biesheuvel@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The BPF code now takes care of mapping the code pages executable after mapping them read-only, to ensure that no RWX mapped regions are needed, even transiently. This means we can drop the executable permissions from the mapping at allocation time. Signed-off-by: Ard Biesheuvel --- arch/arm64/net/bpf_jit_comp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index df845cee438e..aef4ff467222 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -981,7 +981,7 @@ void *bpf_jit_alloc_exec(unsigned long size) { return __vmalloc_node_range(size, PAGE_SIZE, BPF_JIT_REGION_START, BPF_JIT_REGION_END, GFP_KERNEL, - PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE, + PAGE_KERNEL, 0, NUMA_NO_NODE, __builtin_return_address(0)); } -- 2.17.1