History

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

Pull ARM fixes from Russell King: - avoid invoking overflow handler for uaccess watchpoints - fix incorrect clock_gettime64 availability - fix EFI crash in create_mapping_late() * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 8988/1: mmu: fix crash in EFI calls due to p4d typo in create_mapping_late() ARM: 8987/1: VDSO: Fix incorrect clock_gettime64 ARM: 8986/1: hw_breakpoint: Don't invoke overflow handler on uaccess watchpoints

Linus Torvalds committed 6 years ago

Commit c1954ca2 parents ae2911d 5c6360e3 files · +24 −6Browse files

Unified · Split

3 files
  1. arch/arm/kernel/hw_breakpoint.c +22 −5
  2. arch/arm/kernel/vdso.c +1 −0
  3. arch/arm/mm/mmu.c +1 −1
arch/arm/kernel/hw_breakpoint.c+22−5
@@ -683,6 +683,12 @@ static void disable_single_step(struct perf_event *bp) · 682 unmodified lines
683 arch_install_hw_breakpoint(bp);683 arch_install_hw_breakpoint(bp);
684}684}
685 685
686static int watchpoint_fault_on_uaccess(struct pt_regs *regs,
687 struct arch_hw_breakpoint *info)
688{
689 return !user_mode(regs) && info->ctrl.privilege == ARM_BREAKPOINT_USER;
690}
691
686static void watchpoint_handler(unsigned long addr, unsigned int fsr,692static void watchpoint_handler(unsigned long addr, unsigned int fsr,
687 struct pt_regs *regs)693 struct pt_regs *regs)
688{694{
@@ -742,16 +748,27 @@ static void watchpoint_handler(unsigned long addr, unsigned int fsr, · 53 unmodified lines
742 }748 }
743 749
744 pr_debug("watchpoint fired: address = 0x%x\n", info->trigger);750 pr_debug("watchpoint fired: address = 0x%x\n", info->trigger);
751
752 /*
753 * If we triggered a user watchpoint from a uaccess routine,
754 * then handle the stepping ourselves since userspace really
755 * can't help us with this.
756 */
757 if (watchpoint_fault_on_uaccess(regs, info))
758 goto step;
759
745 perf_bp_event(wp, regs);760 perf_bp_event(wp, regs);
746 761
747 /*762 /*
748 * If no overflow handler is present, insert a temporary763 * Defer stepping to the overflow handler if one is installed.
749 * mismatch breakpoint so we can single-step over the764 * Otherwise, insert a temporary mismatch breakpoint so that
750 * watchpoint trigger.765 * we can single-step over the watchpoint trigger.
751 */766 */
752 if (is_default_overflow_handler(wp))767 if (!is_default_overflow_handler(wp))
753 enable_single_step(wp, instruction_pointer(regs));768 goto unlock;
754 769
770step:
771 enable_single_step(wp, instruction_pointer(regs));
755unlock:772unlock:
756 rcu_read_unlock();773 rcu_read_unlock();
757 }774 }
arch/arm/kernel/vdso.c+1−0
@@ -184,6 +184,7 @@ static void __init patch_vdso(void *ehdr) · 183 unmodified lines
184 if (!cntvct_ok) {184 if (!cntvct_ok) {
185 vdso_nullpatch_one(&einfo, "__vdso_gettimeofday");185 vdso_nullpatch_one(&einfo, "__vdso_gettimeofday");
186 vdso_nullpatch_one(&einfo, "__vdso_clock_gettime");186 vdso_nullpatch_one(&einfo, "__vdso_clock_gettime");
187 vdso_nullpatch_one(&einfo, "__vdso_clock_gettime64");
187 }188 }
188}189}
189 190
arch/arm/mm/mmu.c+1−1
@@ -966,7 +966,7 @@ void __init create_mapping_late(struct mm_struct *mm, struct map_desc *md, · 965 unmodified lines
966 pud_t *pud;966 pud_t *pud;
967 967
968 p4d = p4d_alloc(mm, pgd_offset(mm, md->virtual), md->virtual);968 p4d = p4d_alloc(mm, pgd_offset(mm, md->virtual), md->virtual);
969 if (!WARN_ON(!p4d))969 if (WARN_ON(!p4d))
970 return;970 return;
971 pud = pud_alloc(mm, p4d, md->virtual);971 pud = pud_alloc(mm, p4d, md->virtual);
972 if (WARN_ON(!pud))972 if (WARN_ON(!pud))