]> Git Repo - linux.git/commitdiff
Merge tag 'perf-urgent-2022-08-06' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <[email protected]>
Sun, 7 Aug 2022 00:28:12 +0000 (17:28 -0700)
committerLinus Torvalds <[email protected]>
Sun, 7 Aug 2022 00:28:12 +0000 (17:28 -0700)
Pull perf fixes from Ingo Molnar:
 "Misc fixes to kprobes and the faddr2line script, plus a cleanup"

* tag 'perf-urgent-2022-08-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/core: Fix ';;' typo
  scripts/faddr2line: Add CONFIG_DEBUG_INFO check
  scripts/faddr2line: Fix vmlinux detection on arm64
  x86/kprobes: Update kcb status flag after singlestepping
  kprobes: Forbid probing on trampoline and BPF code areas

1  2 
kernel/events/core.c

diff --combined kernel/events/core.c
index 4e718b93442bde593e4bad863a9385e991876360,bd23f3e9bdae3911f79f078c0416d1a9086c7cba..2621fd24ad260b891d5ef2ed1571eacb30e5e5ef
@@@ -4457,7 -4457,7 +4457,7 @@@ int perf_event_read_local(struct perf_e
  
        *value = local64_read(&event->count);
        if (enabled || running) {
-               u64 __enabled, __running, __now;;
+               u64 __enabled, __running, __now;
  
                calc_timer_values(event, &__now, &__enabled, &__running);
                if (enabled)
@@@ -10083,30 -10083,26 +10083,30 @@@ static inline bool perf_event_is_tracin
  int perf_event_set_bpf_prog(struct perf_event *event, struct bpf_prog *prog,
                            u64 bpf_cookie)
  {
 -      bool is_kprobe, is_tracepoint, is_syscall_tp;
 +      bool is_kprobe, is_uprobe, is_tracepoint, is_syscall_tp;
  
        if (!perf_event_is_tracing(event))
                return perf_event_set_bpf_handler(event, prog, bpf_cookie);
  
 -      is_kprobe = event->tp_event->flags & TRACE_EVENT_FL_UKPROBE;
 +      is_kprobe = event->tp_event->flags & TRACE_EVENT_FL_KPROBE;
 +      is_uprobe = event->tp_event->flags & TRACE_EVENT_FL_UPROBE;
        is_tracepoint = event->tp_event->flags & TRACE_EVENT_FL_TRACEPOINT;
        is_syscall_tp = is_syscall_trace_event(event->tp_event);
 -      if (!is_kprobe && !is_tracepoint && !is_syscall_tp)
 +      if (!is_kprobe && !is_uprobe && !is_tracepoint && !is_syscall_tp)
                /* bpf programs can only be attached to u/kprobe or tracepoint */
                return -EINVAL;
  
 -      if ((is_kprobe && prog->type != BPF_PROG_TYPE_KPROBE) ||
 +      if (((is_kprobe || is_uprobe) && prog->type != BPF_PROG_TYPE_KPROBE) ||
            (is_tracepoint && prog->type != BPF_PROG_TYPE_TRACEPOINT) ||
            (is_syscall_tp && prog->type != BPF_PROG_TYPE_TRACEPOINT))
                return -EINVAL;
  
 +      if (prog->type == BPF_PROG_TYPE_KPROBE && prog->aux->sleepable && !is_uprobe)
 +              /* only uprobe programs are allowed to be sleepable */
 +              return -EINVAL;
 +
        /* Kprobe override only works for kprobes, not uprobes. */
 -      if (prog->kprobe_override &&
 -          !(event->tp_event->flags & TRACE_EVENT_FL_KPROBE))
 +      if (prog->kprobe_override && !is_kprobe)
                return -EINVAL;
  
        if (is_tracepoint || is_syscall_tp) {
This page took 0.096414 seconds and 4 git commands to generate.