arm64: bpf: do not allocate executable memory
authorArd Biesheuvel <ard.biesheuvel@arm.com>
Thu, 23 May 2019 10:22:56 +0000 (11:22 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 24 Jun 2019 17:10:39 +0000 (18:10 +0100)
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.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/net/bpf_jit_comp.c

index df845cee438eb3478895d51e0cb29c75e41b2f2f..aef4ff467222c883cd8eea01f88bc020f2544909 100644 (file)
@@ -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));
 }