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: <ada7292a-7585-af86-dae0-320b1f9f6f61@iogearbox.net>
Date:   Mon, 11 Dec 2017 14:15:55 +0100
From:   Daniel Borkmann <daniel@...earbox.net>
To:     Yonghong Song <yhs@...com>, peterz@...radead.org,
        rostedt@...dmis.org, ast@...com, kafai@...com,
        netdev@...r.kernel.org
Cc:     kernel-team@...com
Subject: Re: [PATCH net-next v3 0/2] bpf/tracing: allow user space to query
 prog array on the same tp

Hey Yonghong,

On 12/06/2017 11:07 PM, Yonghong Song wrote:
> Commit e87c6bc3852b ("bpf: permit multiple bpf attachments
> for a single perf event") added support to attach multiple
> bpf programs to a single perf event. Given a perf event
> (kprobe, uprobe, or kernel tracepoint), the perf ioctl interface
> is used to query bpf programs attached to the same trace event.
> 
> There already exists a BPF_PROG_QUERY command for introspection
> currently used by cgroup+bpf. We did have an implementation for
> querying tracepoint+bpf through the same interface. However, it
> looks cleaner to use ioctl() style of api here, since attaching
> bpf prog to tracepoint/kuprobe is also done via ioctl.
> 
> Patch #1 had the core implementation and patch #2 added
> a test case in tools bpf selftests suite.
> 
> Changelogs:
> v2 -> v3:
>   - Change uapi structure perf_event_query_bpf to be more
>     clearer based on Peter's suggestion, and adjust
>     other codes accordingly.
> v1 -> v2:
>   - Rebase on top of net-next.
>   - Use existing bpf_prog_array_length function instead of
>     implementing the same functionality in function
>     bpf_prog_array_copy_info.
> 
> Yonghong Song (2):
>   bpf/tracing: allow user space to query prog array on the same tp
>   bpf/tracing: add a bpf test for new ioctl query interface

v3 doesn't build cleanly, could you take a look & fix?

Thanks,
Daniel

$ make -j4 kernel/trace/
  CHK     include/config/kernel.release
  HOSTCC  scripts/basic/fixdep
  CHK     include/generated/uapi/linux/version.h
  DESCEND  objtool
  CHK     include/generated/utsrelease.h
  HOSTCC   /home/darkstar/trees/bpf-next/tools/objtool/fixdep.o
  HOSTCC  scripts/basic/bin2c
  HOSTLD   /home/darkstar/trees/bpf-next/tools/objtool/fixdep-in.o
  LINK     /home/darkstar/trees/bpf-next/tools/objtool/fixdep
  CC       /home/darkstar/trees/bpf-next/tools/objtool/builtin-check.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/arch/x86/decode.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/builtin-orc.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/exec-cmd.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/help.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/pager.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/parse-options.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/run-command.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/sigchain.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/subcmd-config.o
  LD       /home/darkstar/trees/bpf-next/tools/objtool/arch/x86/objtool-in.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/check.o
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/orc_gen.o
  HOSTCC  arch/x86/tools/relocs_common.o
  LD       /home/darkstar/trees/bpf-next/tools/objtool/libsubcmd-in.o
  AR       /home/darkstar/trees/bpf-next/tools/objtool/libsubcmd.a
  HOSTLD  arch/x86/tools/relocs
  CC       /home/darkstar/trees/bpf-next/tools/objtool/orc_dump.o
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  CC      arch/x86/purgatory/purgatory.o
  AS      arch/x86/purgatory/stack.o
  CC      scripts/mod/devicetable-offsets.s
  AS      arch/x86/purgatory/setup-x86_64.o
  HOSTCC  scripts/kallsyms
  CC      arch/x86/purgatory/sha256.o
  MKELF   scripts/mod/elfconfig.h
  CHK     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/sumversion.o
  HOSTCC  scripts/pnmtologo
  HOSTCC  scripts/mod/modpost.o
  AS      arch/x86/purgatory/entry64.o
  CC      arch/x86/purgatory/string.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/elf.o
  LD      arch/x86/purgatory/purgatory.ro
  HOSTCC  scripts/conmakehash
  BIN2C   arch/x86/purgatory/kexec-purgatory.c
  CC      kernel/bounds.s
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CC      arch/x86/kernel/asm-offsets.s
  HOSTCC  scripts/recordmcount
  CC       /home/darkstar/trees/bpf-next/tools/objtool/special.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/objtool.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/libstring.o
  CC       /home/darkstar/trees/bpf-next/tools/objtool/str_error_r.o
  LD       /home/darkstar/trees/bpf-next/tools/objtool/objtool-in.o
  HOSTCC  scripts/mod/file2alias.o
Warning: synced file at 'tools/objtool/arch/x86/lib/x86-opcode-map.txt' differs from latest kernel version at 'arch/x86/lib/x86-opcode-map.txt'
  LINK     /home/darkstar/trees/bpf-next/tools/objtool/objtool
  HOSTCC  scripts/sortextable
  CHK     include/generated/asm-offsets.h
  HOSTCC  scripts/asn1_compiler
  CALL    scripts/checksyscalls.sh
  HOSTCC  scripts/sign-file
  HOSTCC  scripts/extract-cert
  HOSTLD  scripts/mod/modpost
  CC      kernel/trace/trace_clock.o
  CC      kernel/trace/ftrace.o
  CC      kernel/trace/ring_buffer.o
  CC      kernel/trace/trace.o
  CC      kernel/trace/trace_output.o
  CC      kernel/trace/trace_seq.o
  CC      kernel/trace/trace_stat.o
  CC      kernel/trace/trace_printk.o
  CC      kernel/trace/trace_sched_switch.o
  CC      kernel/trace/trace_functions.o
  CC      kernel/trace/trace_nop.o
  CC      kernel/trace/trace_functions_graph.o
  CC      kernel/trace/blktrace.o
  CC      kernel/trace/trace_events.o
  CC      kernel/trace/trace_export.o
  CC      kernel/trace/trace_syscalls.o
  CC      kernel/trace/trace_event_perf.o
  CC      kernel/trace/trace_events_filter.o
  CC      kernel/trace/trace_events_trigger.o
  CC      kernel/trace/bpf_trace.o
  CC      kernel/trace/trace_kprobe.o
kernel/trace/bpf_trace.c: In function ‘bpf_event_query_prog_array’:
kernel/trace/bpf_trace.c:839:12: error: passing argument 2 of ‘bpf_prog_array_copy_info’ from incompatible pointer type [-Werror=incompatible-pointer-types]
            &uquery->ids,
            ^
In file included from kernel/trace/bpf_trace.c:11:0:
./include/linux/bpf.h:289:5: note: expected ‘__u32 * {aka unsigned int *}’ but argument is of type ‘__u32 (*)[]’
 int bpf_prog_array_copy_info(struct bpf_prog_array __rcu *array,
     ^~~~~~~~~~~~~~~~~~~~~~~~
  CC      kernel/trace/power-traces.o
  CC      kernel/trace/rpm-traces.o
cc1: some warnings being treated as errors
scripts/Makefile.build:310: recipe for target 'kernel/trace/bpf_trace.o' failed
make[1]: *** [kernel/trace/bpf_trace.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:1674: recipe for target 'kernel/trace/' failed
make: *** [kernel/trace/] Error 2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ