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

Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm

Pull ARM updates from Russell King:

- decompressor updates

- prevention of out-of-bounds access while stacktracing

- fix a section mismatch warning with free_memmap()

- make kexec depend on MMU to avoid some build errors

- remove swapops stubs

* tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
ARM: 8954/1: NOMMU: remove stubs for swapops
ARM: 8952/1: Disable kmemleak on XIP kernels
ARM: 8951/1: Fix Kexec compilation issue.
ARM: 8949/1: mm: mark free_memmap as __init
ARM: 8948/1: Prevent OOB access in stacktrace
ARM: 8945/1: decompressor: use CONFIG option instead of cc-option
ARM: 8942/1: Revert "8857/1: efi: enable CP15 DMB instructions before cleaning the cache"
ARM: 8941/1: decompressor: enable CP15 barrier instructions in v7 cache setup code

+29 -32
+2 -2
arch/arm/Kconfig
··· 74 74 select HAVE_CONTEXT_TRACKING 75 75 select HAVE_COPY_THREAD_TLS 76 76 select HAVE_C_RECORDMCOUNT 77 - select HAVE_DEBUG_KMEMLEAK 77 + select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL 78 78 select HAVE_DMA_CONTIGUOUS if MMU 79 79 select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU 80 80 select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE ··· 1905 1905 config KEXEC 1906 1906 bool "Kexec system call (EXPERIMENTAL)" 1907 1907 depends on (!SMP || PM_SLEEP_SMP) 1908 - depends on !CPU_V7M 1908 + depends on MMU 1909 1909 select KEXEC_CORE 1910 1910 help 1911 1911 kexec is a system call that implements the ability to shutdown your
+6 -6
arch/arm/boot/compressed/Makefile
··· 110 110 111 111 # -fstack-protector-strong triggers protection checks in this code, 112 112 # but it is being used too early to link to meaningful stack_chk logic. 113 - nossp_flags := $(call cc-option, -fno-stack-protector) 114 - CFLAGS_atags_to_fdt.o := $(nossp_flags) 115 - CFLAGS_fdt.o := $(nossp_flags) 116 - CFLAGS_fdt_ro.o := $(nossp_flags) 117 - CFLAGS_fdt_rw.o := $(nossp_flags) 118 - CFLAGS_fdt_wip.o := $(nossp_flags) 113 + nossp-flags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) := -fno-stack-protector 114 + CFLAGS_atags_to_fdt.o := $(nossp-flags-y) 115 + CFLAGS_fdt.o := $(nossp-flags-y) 116 + CFLAGS_fdt_ro.o := $(nossp-flags-y) 117 + CFLAGS_fdt_rw.o := $(nossp-flags-y) 118 + CFLAGS_fdt_wip.o := $(nossp-flags-y) 119 119 120 120 ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin -I$(obj) 121 121 asflags-y := -DZIMAGE
+14 -15
arch/arm/boot/compressed/head.S
··· 140 140 #endif 141 141 .endm 142 142 143 + .macro enable_cp15_barriers, reg 144 + mrc p15, 0, \reg, c1, c0, 0 @ read SCTLR 145 + tst \reg, #(1 << 5) @ CP15BEN bit set? 146 + bne .L_\@ 147 + orr \reg, \reg, #(1 << 5) @ CP15 barrier instructions 148 + mcr p15, 0, \reg, c1, c0, 0 @ write SCTLR 149 + ARM( .inst 0xf57ff06f @ v7+ isb ) 150 + THUMB( isb ) 151 + .L_\@: 152 + .endm 153 + 143 154 .section ".start", "ax" 144 155 /* 145 156 * sort out different calling conventions ··· 831 820 mov pc, r12 832 821 833 822 __armv7_mmu_cache_on: 823 + enable_cp15_barriers r11 834 824 mov r12, lr 835 825 #ifdef CONFIG_MMU 836 826 mrc p15, 0, r11, c0, c1, 4 @ read ID_MMFR0 ··· 1221 1209 mov pc, lr 1222 1210 1223 1211 __armv7_mmu_cache_flush: 1212 + enable_cp15_barriers r10 1224 1213 tst r4, #1 1225 1214 bne iflush 1226 1215 mrc p15, 0, r10, c0, c1, 5 @ read ID_MMFR1 ··· 1460 1447 1461 1448 @ Preserve return value of efi_entry() in r4 1462 1449 mov r4, r0 1463 - 1464 - @ our cache maintenance code relies on CP15 barrier instructions 1465 - @ but since we arrived here with the MMU and caches configured 1466 - @ by UEFI, we must check that the CP15BEN bit is set in SCTLR. 1467 - @ Note that this bit is RAO/WI on v6 and earlier, so the ISB in 1468 - @ the enable path will be executed on v7+ only. 1469 - mrc p15, 0, r1, c1, c0, 0 @ read SCTLR 1470 - tst r1, #(1 << 5) @ CP15BEN bit set? 1471 - bne 0f 1472 - orr r1, r1, #(1 << 5) @ CP15 barrier instructions 1473 - mcr p15, 0, r1, c1, c0, 0 @ write SCTLR 1474 - ARM( .inst 0xf57ff06f @ v7+ isb ) 1475 - THUMB( isb ) 1476 - 1477 - 0: bl cache_clean_flush 1450 + bl cache_clean_flush 1478 1451 bl cache_off 1479 1452 1480 1453 @ Set parameters for booting zImage according to boot protocol
-6
arch/arm/include/asm/pgtable-nommu.h
··· 42 42 43 43 #define swapper_pg_dir ((pgd_t *) 0) 44 44 45 - #define __swp_type(x) (0) 46 - #define __swp_offset(x) (0) 47 - #define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) }) 48 - #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 49 - #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 50 - 51 45 52 46 typedef pte_t *pte_addr_t; 53 47
+2
arch/arm/kernel/stacktrace.c
··· 92 92 return 0; 93 93 94 94 regs = (struct pt_regs *)frame->sp; 95 + if ((unsigned long)&regs[1] > ALIGN(frame->sp, THREAD_SIZE)) 96 + return 0; 95 97 96 98 trace->entries[trace->nr_entries++] = regs->ARM_pc; 97 99
+4 -2
arch/arm/kernel/traps.c
··· 64 64 65 65 void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame) 66 66 { 67 + unsigned long end = frame + 4 + sizeof(struct pt_regs); 68 + 67 69 #ifdef CONFIG_KALLSYMS 68 70 printk("[<%08lx>] (%ps) from [<%08lx>] (%pS)\n", where, (void *)where, from, (void *)from); 69 71 #else 70 72 printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); 71 73 #endif 72 74 73 - if (in_entry_text(from)) 74 - dump_mem("", "Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs)); 75 + if (in_entry_text(from) && end <= ALIGN(frame, THREAD_SIZE)) 76 + dump_mem("", "Exception stack", frame + 4, end); 75 77 } 76 78 77 79 void dump_backtrace_stm(u32 *stack, u32 instruction)
+1 -1
arch/arm/mm/init.c
··· 324 324 *p++ = 0xe7fddef0; 325 325 } 326 326 327 - static inline void 327 + static inline void __init 328 328 free_memmap(unsigned long start_pfn, unsigned long end_pfn) 329 329 { 330 330 struct page *start_pg, *end_pg;