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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151023165840.GI27006@kernel.org>
Date:	Fri, 23 Oct 2015 13:58:40 -0300
From:	Arnaldo Carvalho de Melo <acme@...nel.org>
To:	Wang Nan <wangnan0@...wei.com>
Cc:	ast@...mgrid.com, brendan.d.gregg@...il.com,
	a.p.zijlstra@...llo.nl, daniel@...earbox.net, dsahern@...il.com,
	hekuang@...wei.com, jolsa@...nel.org, lizefan@...wei.com,
	masami.hiramatsu.pt@...achi.com, namhyung@...nel.org,
	paulus@...ba.org, linux-kernel@...r.kernel.org, pi3orama@....com,
	xiakaixu@...wei.com
Subject: Re: [PATCH 05/31] perf record: Load eBPF object into kernel

Em Wed, Oct 14, 2015 at 12:41:16PM +0000, Wang Nan escreveu:
> This patch utilizes bpf_object__load() provided by libbpf to load all
> objects into kernel.

So, testing this, using that other proggie, I get;

  # perf record --event /tmp/foo.o sleep 1
  libbpf: load bpf program failed: Invalid argument
  libbpf: -- BEGIN DUMP LOG ---
  libbpf: 

  libbpf: -- END LOG --
  libbpf: failed to load program 'fork=_do_fork'
  libbpf: failed to load object '/tmp/foo.o'
  event syntax error: '/tmp/foo.o'
                       \___ Invalid argument: Are you root and runing a CONFIG_BPF_SYSCALL kernel?

  (add -v to see detail)
  Run 'perf list' for a list of valid events

   Usage: perf record [<options>] [<command>]
      or: perf record [<options>] -- <command> [<options>]

      -e, --event <event>   event selector. use 'perf list' to list available events

But:

[root@...icio ~]# grep -i bpf /proc/kallsyms  | wc -l
117
[root@...icio ~]# grep -i sys_bpf /proc/kallsyms 
ffffffff811829d0 T SyS_bpf
ffffffff811829d0 T sys_bpf
[root@...icio ~]# uname -a
Linux felicio.ghostprotocols.net 4.2.0 #1 SMP Mon Aug 31 12:25:38 BRT
2015 x86_64 x86_64 x86_64 GNU/Linux
[root@...icio ~]# 


I'll try updating it to torvalds/master...

For reference, that foo.o eBPF proggie was built with:

[acme@...icio linux]$ cat ~/bin/hello-ebpf 
# Taken from 'perf test LLVM'
# Thu Oct 22 12:07:26 BRT 2015

export KERNEL_INC_OPTIONS="-nostdinc -isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include
-I/home/acme/git/linux/arch/x86/include
-Iarch/x86/include/generated/uapi -Iarch/x86/include/generated
-I/home/acme/git/linux/include -Iinclude
-I/home/acme/git/linux/arch/x86/include/uapi
-Iarch/x86/include/generated/uapi -I/home/acme/git/linux/include/uapi
-Iinclude/generated/uapi -include
/home/acme/git/linux/include/linux/kconfig.h"
export WORKING_DIR=/lib/modules/4.2.0/build
export CLANG_SOURCE=-
export CLANG_OPTIONS=-xc

OBJ=/tmp/foo.o
rm -f $OBJ
echo '__attribute__((section("fork=_do_fork"), used)) int fork(void
*ctx) {return 0;} char _license[] __attribute__((section("license"),
used)) = "GPL";int _version __attribute__((section("version"), used)) =
0x40100;' | clang -D__KERNEL__ $CLANG_OPTIONS $KERNEL_INC_OPTIONS
-Wno-unused-value -Wno-pointer-sign -working-directory $WORKING_DIR -c
"$CLANG_SOURCE" -target bpf -O2 -o /tmp/foo.o && file $OBJ

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ