lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <F0C47A6A-F8D2-4976-A646-28C148274440@fb.com>
Date:   Mon, 13 Nov 2017 22:52:49 +0000
From:   Song Liu <songliubraving@...com>
To:     "peterz@...radead.org" <peterz@...radead.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        David Miller <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "ast@...nel.org" <ast@...nel.org>,
        "daniel@...earbox.net" <daniel@...earbox.net>
CC:     Kernel Team <Kernel-team@...com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC v2 0/6] enable creating [k,u]probe with perf_event_open


> On Nov 12, 2017, at 3:40 PM, Song Liu <songliubraving@...com> wrote:
> 
> Changes v1 to v2:
>  Fix build issue reported by kbuild test bot by adding ifdef of
>  CONFIG_KPROBE_EVENTS, and CONFIG_UPROBE_EVENTS.
> 
> v1 cover letter:
> 
> This is to follow up the discussion over "new kprobe api" at Linux
> Plumbers 2017:
> 
> https://www.linuxplumbersconf.org/2017/ocw/proposals/4808
> 
> With current kernel, user space tools can only create/destroy [k,u]probes
> with a text-based API (kprobe_events and uprobe_events in tracefs). This
> approach relies on user space to clean up the [k,u]probe after using them.
> However, this is not easy for user space to clean up properly.
> 
> To solve this problem, we introduce a file descriptor based API.
> Specifically, we extended perf_event_open to create [k,u]probe, and attach
> this [k,u]probe to the file descriptor created by perf_event_open. These
> [k,u]probe are associated with this file descriptor, so they are not
> available in tracefs.
> 
> We reuse large portion of existing trace_kprobe and trace_uprobe code.
> Currently, the file descriptor API does not support arguments as the
> text-based API does. This should not be a problem, as user of the file
> decriptor based API read data through other methods (bpf, etc.).
> 
> I also include a patch to to bcc, and a patch to man-page perf_even_open.
> Please see the list below. A fork of bcc with this patch is also available
> on github:
> 
>  https://github.com/liu-song-6/bcc/tree/new_perf_event_opn
> 
> Thanks,
> Song
> 
> man-pages patch:
>  perf_event_open.2: add new type PERF_TYPE_PROBE
> 
> bcc patch:
>  bcc: Try use new API to create [k,u]probe with perf_event_open
> 
> kernel patches:
> 
> Song Liu (6):
>  perf: Add new type PERF_TYPE_PROBE
>  perf: copy new perf_event.h to tools/include/uapi
>  perf: implement kprobe support to PERF_TYPE_PROBE
>  perf: implement uprobe support to PERF_TYPE_PROBE
>  bpf: add option for bpf_load.c to use PERF_TYPE_PROBE
>  bpf: add new test test_many_kprobe
> 
> include/linux/trace_events.h          |   2 +
> include/uapi/linux/perf_event.h       |  35 ++++++-
> kernel/events/core.c                  |  39 ++++++-
> kernel/trace/trace_event_perf.c       | 127 +++++++++++++++++++++++
> kernel/trace/trace_kprobe.c           |  91 +++++++++++++++--
> kernel/trace/trace_probe.h            |  11 ++
> kernel/trace/trace_uprobe.c           |  90 +++++++++++++++--
> samples/bpf/Makefile                  |   3 +
> samples/bpf/bpf_load.c                |  61 ++++++-----
> samples/bpf/bpf_load.h                |  12 +++
> samples/bpf/test_many_kprobe_user.c   | 184 ++++++++++++++++++++++++++++++++++
> tools/include/uapi/linux/perf_event.h |  35 ++++++-
> 12 files changed, 643 insertions(+), 47 deletions(-)
> create mode 100644 samples/bpf/test_many_kprobe_user.c
> 
> --
> 2.9.5

Dear Peter, 

Could you please share feedback about this set? 

Thanks and Best Regards,
Song

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ