The patch titled Subject: arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page has been added to the -mm tree. Its filename is arm64-use-page_kernel_rox-directly-in-alloc_insn_page.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/arm64-use-page_kernel_rox-directly-in-alloc_insn_page.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/arm64-use-page_kernel_rox-directly-in-alloc_insn_page.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Christoph Hellwig <hch@xxxxxx> Subject: arm64: use PAGE_KERNEL_ROX directly in alloc_insn_page Use PAGE_KERNEL_ROX directly instead of allocating RWX and setting the page read-only just after the allocation. Link: http://lkml.kernel.org/r/20200618064307.32739-3-hch@xxxxxx Signed-off-by: Christoph Hellwig <hch@xxxxxx> Acked-by: David Hildenbrand <david@xxxxxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Dexuan Cui <decui@xxxxxxxxxxxxx> Cc: Jessica Yu <jeyu@xxxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx> Cc: Wei Liu <wei.liu@xxxxxxxxxx> Cc: Will Deacon <will@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/arm64/kernel/probes/kprobes.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) --- a/arch/arm64/kernel/probes/kprobes.c~arm64-use-page_kernel_rox-directly-in-alloc_insn_page +++ a/arch/arm64/kernel/probes/kprobes.c @@ -120,15 +120,9 @@ int __kprobes arch_prepare_kprobe(struct void *alloc_insn_page(void) { - void *page; - - page = vmalloc_exec(PAGE_SIZE); - if (page) { - set_memory_ro((unsigned long)page, 1); - set_vm_flush_reset_perms(page); - } - - return page; + return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END, + GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS, + NUMA_NO_NODE, __func__); } /* arm kprobe: install breakpoint in text */ _ Patches currently in -mm which might be from hch@xxxxxx are x86-hyperv-allocate-the-hypercall-page-with-only-read-and-execute-bits.patch arm64-use-page_kernel_rox-directly-in-alloc_insn_page.patch mm-remove-vmalloc_exec.patch