History

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux

Pull arm updates from Russell King: "Updates for 7.3: - add module description for kprobes testing module - remove references to CONFIG_CPU_ARM92x_CPU_IDLE options - expand comment in ARM's __switch_to() Also a number of fixes that missed 7.2: - disable broken eBPF on RiscPC - more BKPT fixes (guys, it's a *very* bad idea when everyone uses the BKPT instruction for their own differing purposes) - another preempt-rt fix, this time for siglock / CPU timers - fix another path where we try to send signals to processes with interrupts disabled - acquire mmap write lock for show_pte() with user faults" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rmk/linux: ARM: 9480/1: entry: expand comment in __switch_to ARM: 9478/1: Remove references to removed CONFIG_CPU_ARM92x_CPU_IDLE options ARM: 9485/1: mm: acquire mmap write lock around show_pte() for user faults ARM: 9484/1: enable interrupts when unhandled user faults are triggered ARM: 9483/1: select HAVE_POSIX_CPU_TIMERS_TASK_WORK ARM: 9481/2: breakpoint: CFI breakpoints only on demand ARM: 9477/1: Disable broken eBPF JIT on the Risc PC ARM: 9473/1: kprobes: test: add MODULE_DESCRIPTION

Linus Torvalds committed 2 months ago

Commit 0fe792f2 parents fb5b59a 1a89abc9 files · +41 −30Browse files

Unified · Split

9 files
  1. arch/arm/Kconfig +2 −1
  2. arch/arm/kernel/entry-armv.S +10 −3
  3. arch/arm/kernel/hw_breakpoint.c +6 −5
  4. arch/arm/mm/fault.c +20 −2
  5. arch/arm/mm/proc-arm920.S +0 −2
  6. arch/arm/mm/proc-arm922.S +0 −2
  7. arch/arm/mm/proc-arm925.S +0 −2
  8. arch/arm/mm/proc-arm926.S +0 −2
  9. arch/arm/probes/kprobes/test-core.c +3 −11
arch/arm/Kconfig+2−1
@@ -99,7 +99,7 @@ config ARM · 98 unmodified lines
9999 select HAVE_ARCH_TRACEHOOK
100100 select HAVE_ARCH_TRANSPARENT_HUGEPAGE if ARM_LPAE
101101 select HAVE_ARM_SMCCC if CPU_V7
102− select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
102+ select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32 && !CPU_32v3
103103 select HAVE_CONTEXT_TRACKING_USER
104104 select HAVE_C_RECORDMCOUNT
105105 select HAVE_BUILDTIME_MCOUNT_SORT
@@ -134,6 +134,7 @@ config ARM · 28 unmodified lines
134134 select HAVE_PERF_EVENTS
135135 select HAVE_PERF_REGS
136136 select HAVE_PERF_USER_STACK_DUMP
137+ select HAVE_POSIX_CPU_TIMERS_TASK_WORK
137138 select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE
138139 select HAVE_REGS_AND_STACK_ACCESS_API
139140 select HAVE_RSEQ
arch/arm/kernel/entry-armv.S+10−3
@@ -557,9 +557,16 @@ ENTRY(__switch_to) · 556 unmodified lines
557557 ldmia r4, {r4 - sl, fp, ip, lr} @ Load all regs saved previously
558558 #ifdef CONFIG_VMAP_STACK
559559 @
560− @ Do a dummy read from the new stack while running from the old one so
561− @ that we can rely on do_translation_fault() to fix up any stale PMD
562− @ entries covering the vmalloc region.
560+ @ For a non-lazy mm switch, check_vmalloc_seq() has ensured that
561+ @ that the active mm's page tables have mappings for the prev
562+ @ task's stack and the next task's stack.
563+ @
564+ @ For a lazy mm switch the active mm's page tables have mappings
565+ @ for the prev task's stack but might not have mappings for the
566+ @ new task's stack. Do a dummy read from the new stack while
567+ @ running from the old stack so that we can rely on
568+ @ do_translation_fault() to populate missing PMD entries covering the
569+ @ new task's stack in the old task's page tables.
563570 @
564571 ldr r2, [ip]
565572 #ifdef CONFIG_KASAN_VMALLOC
arch/arm/kernel/hw_breakpoint.c+6−5
@@ -929,10 +929,6 @@ static void hw_breakpoint_cfi_handler(struct pt_regs *regs) · 928 unmodified lines
929929 break;
930930 }
931931 }
932−#else
933−static void hw_breakpoint_cfi_handler(struct pt_regs *regs)
934−{
935−}
936932 #endif
937933
938934 /*
@@ -964,9 +960,14 @@ static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr, · 25 unmodified lines
964960 case ARM_ENTRY_SYNC_WATCHPOINT:
965961 watchpoint_handler(addr, fsr, regs);
966962 break;
963+#ifdef CONFIG_CFI
967964 case ARM_ENTRY_CFI_BREAKPOINT:
968− hw_breakpoint_cfi_handler(regs);
965+ if (user_mode(regs))
966+ ret = 1; /* Don't handle userspace BKPT */
967+ else
968+ hw_breakpoint_cfi_handler(regs);
969969 break;
970+#endif
970971 default:
971972 ret = 1; /* Unhandled fault. */
972973 }
arch/arm/mm/fault.c+20−2
@@ -181,7 +181,11 @@ __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig, · 180 unmodified lines
181181 pr_err("8<--- cut here ---\n");
182182 pr_err("%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n",
183183 tsk->comm, sig, addr, fsr);
184− show_pte(KERN_ERR, tsk->mm, addr);
184+ if (likely(addr < TASK_SIZE)) {
185+ mmap_write_lock(tsk->mm);
186+ show_pte(KERN_ERR, tsk->mm, addr);
187+ mmap_write_unlock(tsk->mm);
188+ }
185189 show_regs(regs);
186190 }
187191 #endif
@@ -633,10 +637,21 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) · 445 unmodified lines
633637 if (!inf->fn(addr, fsr & ~FSR_LNX_PF, regs))
634638 return;
635639
640+ if (likely(user_mode(regs)))
641+ local_irq_enable();
642+
636643 pr_alert("8<--- cut here ---\n");
637644 pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n",
638645 inf->name, fsr, addr);
639− show_pte(KERN_ALERT, current->mm, addr);
646+ if (likely(user_mode(regs))) {
647+ if (addr < TASK_SIZE) {
648+ mmap_write_lock(current->mm);
649+ show_pte(KERN_ALERT, current->mm, addr);
650+ mmap_write_unlock(current->mm);
651+ }
652+ } else {
653+ show_pte(KERN_ALERT, current->mm, addr);
654+ }
640655
641656 arm_notify_die("", regs, inf->sig, inf->code, (void __user *)addr,
642657 fsr, 0);
@@ -663,6 +678,9 @@ do_PrefetchAbort(unsigned long addr, unsigned int ifsr, struct pt_regs *regs) · 20 unmodified lines
663678 if (!inf->fn(addr, ifsr | FSR_LNX_PF, regs))
664679 return;
665680
681+ if (likely(user_mode(regs)))
682+ local_irq_enable();
683+
666684 pr_alert("8<--- cut here ---\n");
667685 pr_alert("Unhandled prefetch abort: %s (0x%03x) at 0x%08lx\n",
668686 inf->name, ifsr, addr);
arch/arm/mm/proc-arm920.S+0−2
@@ -8,8 +8,6 @@ · 7 unmodified lines
88 *
99 * These are the low level assembler for performing cache and TLB
1010 * functions on the arm920.
11− *
12− * CONFIG_CPU_ARM920_CPU_IDLE -> nohlt
1311 */
1412 #include <linux/linkage.h>
1513 #include <linux/init.h>
arch/arm/mm/proc-arm922.S+0−2
@@ -9,8 +9,6 @@ · 8 unmodified lines
99 *
1010 * These are the low level assembler for performing cache and TLB
1111 * functions on the arm922.
12− *
13− * CONFIG_CPU_ARM922_CPU_IDLE -> nohlt
1412 */
1513 #include <linux/linkage.h>
1614 #include <linux/init.h>
arch/arm/mm/proc-arm925.S+0−2
@@ -15,8 +15,6 @@ · 14 unmodified lines
1515 * These are the low level assembler for performing cache and TLB
1616 * functions on the arm925.
1717 *
18− * CONFIG_CPU_ARM925_CPU_IDLE -> nohlt
19− *
2018 * Some additional notes based on deciphering the TI TRM on OMAP-5910:
2119 *
2220 * NOTE1: The TI925T Configuration Register bit "D-cache clean and flush
arch/arm/mm/proc-arm926.S+0−2
@@ -8,8 +8,6 @@ · 7 unmodified lines
88 *
99 * These are the low level assembler for performing cache and TLB
1010 * functions on the arm926.
11− *
12− * CONFIG_CPU_ARM926_CPU_IDLE -> nohlt
1311 */
1412 #include <linux/linkage.h>
1513 #include <linux/init.h>
arch/arm/probes/kprobes/test-core.c+3−11
@@ -1649,24 +1649,16 @@ out: · 1648 unmodified lines
16491649
16501650 return ret;
16511651 }
1652−
1652+late_initcall(run_all_tests);
16531653
16541654 /*
16551655 * Module setup
16561656 */
16571657
1658−#ifdef MODULE
1659−
16601658 static void __exit kprobe_test_exit(void)
16611659 {
16621660 }
1663−
1664−module_init(run_all_tests)
16651661 module_exit(kprobe_test_exit)
1666−MODULE_LICENSE("GPL");
16671662
1668−#else /* !MODULE */
1669−
1670−late_initcall(run_all_tests);
1671−
1672−#endif
1663+MODULE_DESCRIPTION("Test code for ARM kprobes");
1664+MODULE_LICENSE("GPL");