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-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon:
"Here are some more arm64 fixes for 4.5. This has mostly come from
Yang Shi, who saw some issues under -rt that also affect mainline.
The rest of it is pretty small, but still worth having.

We've got an old issue outstanding with valid_user_regs which will
likely wait until 4.6 (since it would really benefit from some time in
-next) and another issue with kasan and idle which should be fixed
next week.

Apart from that, pretty quiet here (and still no sign of the THP issue
reported on s390...)

Summary:

- Allow EFI stub to use strnlen(), which is required by recent libfdt

- Avoid smp_processor_id() in preempt context during unwinding

- Avoid false Kasan warnings during unwinding

- Ensure early devices are picked up by the IOMMU DMA ops

- Avoid rebuilding the kernel for the 'install' target

- Run fixup handlers for alignment faults on userspace access"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: mm: allow the kernel to handle alignment faults on user accesses
arm64: kbuild: make "make install" not depend on vmlinux
arm64: dma-mapping: fix handling of devices registered before arch_initcall
arm64/efi: Make strnlen() available to the EFI namespace
arm/arm64: crypto: assure that ECB modes don't require an IV
arm64: make irq_stack_ptr more robust
arm64: debug: re-enable irqs before sending breakpoint SIGTRAP
arm64: disable kasan when accessing frame->fp in unwind_frame

+75 -45
+2 -2
arch/arm/crypto/aes-ce-glue.c
··· 364 364 .cra_blkcipher = { 365 365 .min_keysize = AES_MIN_KEY_SIZE, 366 366 .max_keysize = AES_MAX_KEY_SIZE, 367 - .ivsize = AES_BLOCK_SIZE, 367 + .ivsize = 0, 368 368 .setkey = ce_aes_setkey, 369 369 .encrypt = ecb_encrypt, 370 370 .decrypt = ecb_decrypt, ··· 441 441 .cra_ablkcipher = { 442 442 .min_keysize = AES_MIN_KEY_SIZE, 443 443 .max_keysize = AES_MAX_KEY_SIZE, 444 - .ivsize = AES_BLOCK_SIZE, 444 + .ivsize = 0, 445 445 .setkey = ablk_set_key, 446 446 .encrypt = ablk_encrypt, 447 447 .decrypt = ablk_decrypt,
+1 -1
arch/arm64/Makefile
··· 88 88 Image.%: vmlinux 89 89 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 90 90 91 - zinstall install: vmlinux 91 + zinstall install: 92 92 $(Q)$(MAKE) $(build)=$(boot) $@ 93 93 94 94 %.dtb: scripts
+2 -2
arch/arm64/boot/Makefile
··· 34 34 $(obj)/Image.lzo: $(obj)/Image FORCE 35 35 $(call if_changed,lzo) 36 36 37 - install: $(obj)/Image 37 + install: 38 38 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ 39 39 $(obj)/Image System.map "$(INSTALL_PATH)" 40 40 41 - zinstall: $(obj)/Image.gz 41 + zinstall: 42 42 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ 43 43 $(obj)/Image.gz System.map "$(INSTALL_PATH)"
+14
arch/arm64/boot/install.sh
··· 20 20 # $4 - default install path (blank if root directory) 21 21 # 22 22 23 + verify () { 24 + if [ ! -f "$1" ]; then 25 + echo "" 1>&2 26 + echo " *** Missing file: $1" 1>&2 27 + echo ' *** You need to run "make" before "make install".' 1>&2 28 + echo "" 1>&2 29 + exit 1 30 + fi 31 + } 32 + 33 + # Make sure the files actually exist 34 + verify "$2" 35 + verify "$3" 36 + 23 37 # User may have a custom install script 24 38 if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi 25 39 if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
+2 -2
arch/arm64/crypto/aes-glue.c
··· 294 294 .cra_blkcipher = { 295 295 .min_keysize = AES_MIN_KEY_SIZE, 296 296 .max_keysize = AES_MAX_KEY_SIZE, 297 - .ivsize = AES_BLOCK_SIZE, 297 + .ivsize = 0, 298 298 .setkey = aes_setkey, 299 299 .encrypt = ecb_encrypt, 300 300 .decrypt = ecb_decrypt, ··· 371 371 .cra_ablkcipher = { 372 372 .min_keysize = AES_MIN_KEY_SIZE, 373 373 .max_keysize = AES_MAX_KEY_SIZE, 374 - .ivsize = AES_BLOCK_SIZE, 374 + .ivsize = 0, 375 375 .setkey = ablk_set_key, 376 376 .encrypt = ablk_encrypt, 377 377 .decrypt = ablk_decrypt,
+22 -26
arch/arm64/kernel/debug-monitors.c
··· 226 226 return retval; 227 227 } 228 228 229 + static void send_user_sigtrap(int si_code) 230 + { 231 + struct pt_regs *regs = current_pt_regs(); 232 + siginfo_t info = { 233 + .si_signo = SIGTRAP, 234 + .si_errno = 0, 235 + .si_code = si_code, 236 + .si_addr = (void __user *)instruction_pointer(regs), 237 + }; 238 + 239 + if (WARN_ON(!user_mode(regs))) 240 + return; 241 + 242 + if (interrupts_enabled(regs)) 243 + local_irq_enable(); 244 + 245 + force_sig_info(SIGTRAP, &info, current); 246 + } 247 + 229 248 static int single_step_handler(unsigned long addr, unsigned int esr, 230 249 struct pt_regs *regs) 231 250 { 232 - siginfo_t info; 233 - 234 251 /* 235 252 * If we are stepping a pending breakpoint, call the hw_breakpoint 236 253 * handler first. ··· 256 239 return 0; 257 240 258 241 if (user_mode(regs)) { 259 - info.si_signo = SIGTRAP; 260 - info.si_errno = 0; 261 - info.si_code = TRAP_HWBKPT; 262 - info.si_addr = (void __user *)instruction_pointer(regs); 263 - force_sig_info(SIGTRAP, &info, current); 242 + send_user_sigtrap(TRAP_HWBKPT); 264 243 265 244 /* 266 245 * ptrace will disable single step unless explicitly ··· 320 307 static int brk_handler(unsigned long addr, unsigned int esr, 321 308 struct pt_regs *regs) 322 309 { 323 - siginfo_t info; 324 - 325 310 if (user_mode(regs)) { 326 - info = (siginfo_t) { 327 - .si_signo = SIGTRAP, 328 - .si_errno = 0, 329 - .si_code = TRAP_BRKPT, 330 - .si_addr = (void __user *)instruction_pointer(regs), 331 - }; 332 - 333 - force_sig_info(SIGTRAP, &info, current); 311 + send_user_sigtrap(TRAP_BRKPT); 334 312 } else if (call_break_hook(regs, esr) != DBG_HOOK_HANDLED) { 335 313 pr_warning("Unexpected kernel BRK exception at EL1\n"); 336 314 return -EFAULT; ··· 332 328 333 329 int aarch32_break_handler(struct pt_regs *regs) 334 330 { 335 - siginfo_t info; 336 331 u32 arm_instr; 337 332 u16 thumb_instr; 338 333 bool bp = false; ··· 362 359 if (!bp) 363 360 return -EFAULT; 364 361 365 - info = (siginfo_t) { 366 - .si_signo = SIGTRAP, 367 - .si_errno = 0, 368 - .si_code = TRAP_BRKPT, 369 - .si_addr = pc, 370 - }; 371 - 372 - force_sig_info(SIGTRAP, &info, current); 362 + send_user_sigtrap(TRAP_BRKPT); 373 363 return 0; 374 364 } 375 365
+1
arch/arm64/kernel/image.h
··· 89 89 __efistub_memmove = KALLSYMS_HIDE(__pi_memmove); 90 90 __efistub_memset = KALLSYMS_HIDE(__pi_memset); 91 91 __efistub_strlen = KALLSYMS_HIDE(__pi_strlen); 92 + __efistub_strnlen = KALLSYMS_HIDE(__pi_strnlen); 92 93 __efistub_strcmp = KALLSYMS_HIDE(__pi_strcmp); 93 94 __efistub_strncmp = KALLSYMS_HIDE(__pi_strncmp); 94 95 __efistub___flush_dcache_area = KALLSYMS_HIDE(__pi___flush_dcache_area);
+8 -9
arch/arm64/kernel/stacktrace.c
··· 44 44 unsigned long irq_stack_ptr; 45 45 46 46 /* 47 - * Use raw_smp_processor_id() to avoid false-positives from 48 - * CONFIG_DEBUG_PREEMPT. get_wchan() calls unwind_frame() on sleeping 49 - * task stacks, we can be pre-empted in this case, so 50 - * {raw_,}smp_processor_id() may give us the wrong value. Sleeping 51 - * tasks can't ever be on an interrupt stack, so regardless of cpu, 52 - * the checks will always fail. 47 + * Switching between stacks is valid when tracing current and in 48 + * non-preemptible context. 53 49 */ 54 - irq_stack_ptr = IRQ_STACK_PTR(raw_smp_processor_id()); 50 + if (tsk == current && !preemptible()) 51 + irq_stack_ptr = IRQ_STACK_PTR(smp_processor_id()); 52 + else 53 + irq_stack_ptr = 0; 55 54 56 55 low = frame->sp; 57 56 /* irq stacks are not THREAD_SIZE aligned */ ··· 63 64 return -EINVAL; 64 65 65 66 frame->sp = fp + 0x10; 66 - frame->fp = *(unsigned long *)(fp); 67 - frame->pc = *(unsigned long *)(fp + 8); 67 + frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp)); 68 + frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 8)); 68 69 69 70 #ifdef CONFIG_FUNCTION_GRAPH_TRACER 70 71 if (tsk && tsk->ret_stack &&
+10 -1
arch/arm64/kernel/traps.c
··· 146 146 static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk) 147 147 { 148 148 struct stackframe frame; 149 - unsigned long irq_stack_ptr = IRQ_STACK_PTR(smp_processor_id()); 149 + unsigned long irq_stack_ptr; 150 150 int skip; 151 + 152 + /* 153 + * Switching between stacks is valid when tracing current and in 154 + * non-preemptible context. 155 + */ 156 + if (tsk == current && !preemptible()) 157 + irq_stack_ptr = IRQ_STACK_PTR(smp_processor_id()); 158 + else 159 + irq_stack_ptr = 0; 151 160 152 161 pr_debug("%s(regs = %p tsk = %p)\n", __func__, regs, tsk); 153 162
+1 -1
arch/arm64/lib/strnlen.S
··· 168 168 .Lhit_limit: 169 169 mov len, limit 170 170 ret 171 - ENDPROC(strnlen) 171 + ENDPIPROC(strnlen)
+4
arch/arm64/mm/dma-mapping.c
··· 933 933 ret = register_iommu_dma_ops_notifier(&platform_bus_type); 934 934 if (!ret) 935 935 ret = register_iommu_dma_ops_notifier(&amba_bustype); 936 + 937 + /* handle devices queued before this arch_initcall */ 938 + if (!ret) 939 + __iommu_attach_notifier(NULL, BUS_NOTIFY_ADD_DEVICE, NULL); 936 940 return ret; 937 941 } 938 942 arch_initcall(__iommu_dma_init);
+8 -1
arch/arm64/mm/fault.c
··· 371 371 return 0; 372 372 } 373 373 374 + static int do_alignment_fault(unsigned long addr, unsigned int esr, 375 + struct pt_regs *regs) 376 + { 377 + do_bad_area(addr, esr, regs); 378 + return 0; 379 + } 380 + 374 381 /* 375 382 * This abort handler always returns "fault". 376 383 */ ··· 425 418 { do_bad, SIGBUS, 0, "synchronous parity error (translation table walk)" }, 426 419 { do_bad, SIGBUS, 0, "synchronous parity error (translation table walk)" }, 427 420 { do_bad, SIGBUS, 0, "unknown 32" }, 428 - { do_bad, SIGBUS, BUS_ADRALN, "alignment fault" }, 421 + { do_alignment_fault, SIGBUS, BUS_ADRALN, "alignment fault" }, 429 422 { do_bad, SIGBUS, 0, "unknown 34" }, 430 423 { do_bad, SIGBUS, 0, "unknown 35" }, 431 424 { do_bad, SIGBUS, 0, "unknown 36" },