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]
Date:   Mon, 07 Aug 2017 10:06:53 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     tmricht@...ux.vnet.ibm.com
Cc:     ast@...nel.org, daniel@...earbox.net, netdev@...r.kernel.org,
        heiko.carstens@...ibm.com, schwidefsky@...ibm.com,
        brueckner@...ux.vnet.ibm.com
Subject: Re: [PATCHv2] bpf: fix selftest/bpf/test_pkt_md_access on s390x

From: Thomas Richter <tmricht@...ux.vnet.ibm.com>
Date: Mon,  7 Aug 2017 10:16:36 +0200

> Commit 18f3d6be6be1 ("selftests/bpf: Add test cases to test narrower ctx field loads")
> introduced new eBPF test cases. One of them (test_pkt_md_access.c)
> fails on s390x. The BPF verifier error message is:
> 
> [root@...60046 bpf]# ./test_progs
> test_pkt_access:PASS:ipv4 349 nsec
> test_pkt_access:PASS:ipv6 212 nsec
> [....]
> libbpf: load bpf program failed: Permission denied
> libbpf: -- BEGIN DUMP LOG ---
> libbpf:
> 0: (71) r2 = *(u8 *)(r1 +0)
> invalid bpf_context access off=0 size=1
> 
> libbpf: -- END LOG --
> libbpf: failed to load program 'test1'
> libbpf: failed to load object './test_pkt_md_access.o'
> Summary: 29 PASSED, 1 FAILED
> [root@...60046 bpf]#
> 
> This is caused by a byte endianness issue. S390x is a big endian
> architecture.  Pointer access to the lowest byte or halfword of a
> four byte value need to add an offset.
> On little endian architectures this offset is not needed.
> 
> Fix this and use the same approach as the originator used for other files
> (for example test_verifier.c) in his original commit.
> 
> With this fix the test program test_progs succeeds on s390x:
 ...
> Signed-off-by: Thomas Richter <tmricht@...ux.vnet.ibm.com>
> Acked-by: Daniel Borkmann <daniel@...earbox.net>

Applied, thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ