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]
Date:	Fri, 22 Jan 2016 12:40:50 -0300
From:	Arnaldo Carvalho de Melo <acme@...nel.org>
To:	Wang Nan <wangnan0@...wei.com>
Cc:	ast@...nel.org, linux-kernel@...r.kernel.org,
	Daniel Borkmann <daniel@...earbox.net>,
	Li Zefan <lizefan@...wei.com>, pi3orama@....com
Subject: Re: [PATCH 1/2] perf test: Add libbpf relocation checker

Em Fri, Jan 22, 2016 at 09:27:20AM +0000, Wang Nan escreveu:
> There's a bug in LLVM that it can generate unneeded relocation
> information. See [1] and [2]. Libbpf should check the target section
> of a relocation symbol.
> 
> This patch adds a testcase which reference a global variable (BPF
> doesn't support global variable). Before fixing libbpf, the new test
> case can be loaded into kernel, the global variable acts like the first
> map. It is incorrect.
> 
> Result:
>  # ~/perf test BPF
>  37: Test BPF filter                                          :
>  37.1: Test basic BPF filtering                               : Ok
>  37.2: Test BPF prologue generation                           : Ok
>  37.3: Test BPF relocation checker                            : FAILED!

So I just got a new notebook, a t450s (heya, will be able to test Intel
PT, etc) and installed fedora 23 on it, cool, there is clang/llvm in it!
And furthermore:

[root@...et ~]# clang --version
clang version 3.7.0 (tags/RELEASE_370/final)
Target: x86_64-redhat-linux-gnu
Thread model: posix
[root@...et ~]# 

Seems to be the one we need!

But...

[root@...et ~]# perf test bpf
37: Test BPF filter                                          :
37.1: Test basic BPF filtering                               : Skip
37.2: Test BPF prologue generation                           : Skip
[root@...et ~]# 

oh well...

>From 'perf test -v bpf':

' | $CLANG_EXEC -D__KERNEL__ -D__NR_CPUS__=$NR_CPUS -DLINUX_VERSION_CODE=$LINUX_VERSION_CODE $CLANG_OPTIONS $KERNEL_INC_OPTIONS -Wno-unused-value -Wno-pointer-sign -working-directory $WORKING_DIR -c "$CLANG_SOURCE" -target bpf -O2 -o -
error: unable to create target: 'No available targets are compatible with this triple, see -version for the available targets.'

----

And after googling 'list clang supported target'

[root@...et ~]# llc --version
LLVM (http://llvm.org/):
  LLVM version 3.7.0
  Optimized build.
  Built Dec  4 2015 (15:49:18).
  Default target: x86_64-redhat-linux-gnu
  Host CPU: broadwell

  Registered Targets:
    aarch64    - AArch64 (little endian)
    aarch64_be - AArch64 (big endian)
    amdgcn     - AMD GCN GPUs
    arm        - ARM
    arm64      - ARM64 (little endian)
    armeb      - ARM (big endian)
    cpp        - C++ backend
    nvptx      - NVIDIA PTX 32-bit
    nvptx64    - NVIDIA PTX 64-bit
    ppc32      - PowerPC 32
    ppc64      - PowerPC 64
    ppc64le    - PowerPC 64 LE
    r600       - AMD GPUs HD2XXX-HD6XXX
    systemz    - SystemZ
    thumb      - Thumb
    thumbeb    - Thumb (big endian)
    x86        - 32-bit X86: Pentium-Pro and above
    x86-64     - 64-bit X86: EM64T and AMD64
[root@...et ~]# 

Oops, no bpf, so the good thing is that if we uninstall clang and try that test again:

[root@...et ~]# dnf remove clang llvm
Dependencies resolved.
==============================================================
 Package              Arch    Version       Repository   Size
==============================================================
Removing:
 clang                x86_64  3.7.0-3.fc23  @updates     45 M
 clang-libs           x86_64  3.7.0-3.fc23  @updates     14 M
 gcc-c++              x86_64  5.3.1-2.fc23  @updates     24 M
 libstdc++-devel      x86_64  5.3.1-2.fc23  @updates    9.5 M
 llvm                 x86_64  3.7.0-3.fc23  @updates    4.9 M

Transaction Summary
==============================================================
Remove  5 Packages


When I try it again I get nice instructions on how to install it!

[root@...et ~]# perf test bpf
37: Test BPF filter                                          :
37.1: Test basic BPF filtering                               : Skip
37.2: Test BPF prologue generation                           : Skip
[root@...et ~]# perf test -v bpf
37: Test BPF filter                                          :
37.1: Test basic BPF filtering                               :
--- start ---
test child forked, pid 30062
ERROR:	unable to find clang.
Hint:	Try to install latest clang/llvm to support BPF. Check your $PATH
     	and 'clang-path' option in [llvm] section of ~/.perfconfig.
     	LLVM 3.7 or newer is required. Which can be found from http://llvm.org
     	You may want to try git trunk:
     		git clone http://llvm.org/git/llvm.git
     		     and
     		git clone http://llvm.org/git/clang.git

     	Or fetch the latest clang/llvm 3.7 from pre-built llvm packages for
     	debian/ubuntu:
     		http://llvm.org/apt

     	If you are using old version of clang, change 'clang-bpf-cmd-template'
     	option in [llvm] section of ~/.perfconfig to:

     	  "$CLANG_EXEC $CLANG_OPTIONS $KERNEL_INC_OPTIONS \
     	     -working-directory $WORKING_DIR -c $CLANG_SOURCE \
     	     -emit-llvm -o - | /path/to/llc -march=bpf -filetype=obj -o -"
     	(Replace /path/to/llc with path to your llc)

Failed to compile test case: 'Basic BPF llvm compiling test'
Unable to get BPF object, fix 'perf test LLVM' first
test child finished with -2
---- end ----
Test BPF filter subtest 0: Skip
37.2: Test BPF prologue generation                           :
--- force skipped ---
Test BPF filter subtest 1: Skip
[root@...et ~]# 

Lets try it...

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ