Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull more arm64 updates from Catalin Marinas:

- fix W+X page (mark RO) allocated by the arm64 kprobes code

- Makefile fix for .i files in out of tree modules

* tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: kprobe: make page to RO mode when allocate it
arm64: kdump: fix small typo
arm64: makefile fix build of .i file in external module case

+23 -8
+2
arch/arm64/Makefile
··· 134 134 archclean: 135 135 $(Q)$(MAKE) $(clean)=$(boot) 136 136 137 + ifeq ($(KBUILD_EXTMOD),) 137 138 # We need to generate vdso-offsets.h before compiling certain files in kernel/. 138 139 # In order to do that, we should use the archprepare target, but we can't since 139 140 # asm-offsets.h is included in some files used to generate vdso-offsets.h, and ··· 144 143 prepare: vdso_prepare 145 144 vdso_prepare: prepare0 146 145 $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso include/generated/vdso-offsets.h 146 + endif 147 147 148 148 define archhelp 149 149 echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)'
+1 -1
arch/arm64/kernel/crash_dump.c
··· 58 58 /** 59 59 * elfcorehdr_read - read from ELF core header 60 60 * @buf: buffer where the data is placed 61 - * @csize: number of bytes to read 61 + * @count: number of bytes to read 62 62 * @ppos: address in the memory 63 63 * 64 64 * This function reads @count bytes from elf core header which exists
+20 -7
arch/arm64/kernel/probes/kprobes.c
··· 23 23 #include <linux/slab.h> 24 24 #include <linux/stop_machine.h> 25 25 #include <linux/sched/debug.h> 26 + #include <linux/set_memory.h> 26 27 #include <linux/stringify.h> 28 + #include <linux/vmalloc.h> 27 29 #include <asm/traps.h> 28 30 #include <asm/ptrace.h> 29 31 #include <asm/cacheflush.h> ··· 44 42 static void __kprobes 45 43 post_kprobe_handler(struct kprobe_ctlblk *, struct pt_regs *); 46 44 45 + static int __kprobes patch_text(kprobe_opcode_t *addr, u32 opcode) 46 + { 47 + void *addrs[1]; 48 + u32 insns[1]; 49 + 50 + addrs[0] = addr; 51 + insns[0] = opcode; 52 + 53 + return aarch64_insn_patch_text(addrs, insns, 1); 54 + } 55 + 47 56 static void __kprobes arch_prepare_ss_slot(struct kprobe *p) 48 57 { 49 58 /* prepare insn slot */ 50 - p->ainsn.api.insn[0] = cpu_to_le32(p->opcode); 59 + patch_text(p->ainsn.api.insn, p->opcode); 51 60 52 61 flush_icache_range((uintptr_t) (p->ainsn.api.insn), 53 62 (uintptr_t) (p->ainsn.api.insn) + ··· 131 118 return 0; 132 119 } 133 120 134 - static int __kprobes patch_text(kprobe_opcode_t *addr, u32 opcode) 121 + void *alloc_insn_page(void) 135 122 { 136 - void *addrs[1]; 137 - u32 insns[1]; 123 + void *page; 138 124 139 - addrs[0] = (void *)addr; 140 - insns[0] = (u32)opcode; 125 + page = vmalloc_exec(PAGE_SIZE); 126 + if (page) 127 + set_memory_ro((unsigned long)page, 1); 141 128 142 - return aarch64_insn_patch_text(addrs, insns, 1); 129 + return page; 143 130 } 144 131 145 132 /* arm kprobe: install breakpoint in text */