[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171227030030.GJ3172@yexl-desktop>
Date: Wed, 27 Dec 2017 11:00:30 +0800
From: kernel test robot <xiaolong.ye@...el.com>
To: Alexei Starovoitov <ast@...nel.org>
Cc: Daniel Borkmann <daniel@...earbox.net>,
LKML <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>, lkp@...org
Subject: [lkp-robot] [bpf] 82abbf8d2f: kernel_selftests.bpf.test_align.fail
FYI, we noticed the following commit (built with gcc-7):
commit: 82abbf8d2fc46d79611ab58daa7c608df14bb3ee ("bpf: do not allow root to mangle valid pointers")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
in testcase: kernel_selftests
with following parameters:
test-description: The kernel contains a set of "self tests" under the tools/testing/selftests/ directory. These are intended to be small unit tests to exercise individual code paths in the kernel.
test-url: https://www.kernel.org/doc/Documentation/kselftest.txt
on test machine: qemu-system-x86_64 -enable-kvm -cpu host -smp 2 -m 4G
caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):
selftests: test_align
========================================
Test 0: mov ... PASS
Test 1: shift ... PASS
Test 2: addsub ... PASS
Test 3: mul ... PASS
Test 4: unknown shift ... PASS
Test 5: unknown mul ... PASS
Test 6: packet const offset ... PASS
Test 7: packet variable offset ... PASS
Test 8: packet variable offset 2 ... PASS
Test 9: dubious pointer arithmetic ... Failed to find line 5 for match: R5=inv(id=0,umax_value=64,var_off=(0x0; 0x40))
0: R1=ctx(id=0,off=0,imm=0) R10=fp0
0: (61) r2 = *(u32 *)(r1 +76)
1: R1=ctx(id=0,off=0,imm=0) R2=pkt(id=0,off=0,r=0,imm=0) R10=fp0
1: (61) r3 = *(u32 *)(r1 +80)
2: R1=ctx(id=0,off=0,imm=0) R2=pkt(id=0,off=0,r=0,imm=0) R3=pkt_end(id=0,off=0,imm=0) R10=fp0
2: (b7) r0 = 0
3: R0=inv0 R1=ctx(id=0,off=0,imm=0) R2=pkt(id=0,off=0,r=0,imm=0) R3=pkt_end(id=0,off=0,imm=0) R10=fp0
3: (bf) r5 = r2
4: R0=inv0 R1=ctx(id=0,off=0,imm=0) R2=pkt(id=0,off=0,r=0,imm=0) R3=pkt_end(id=0,off=0,imm=0) R5=pkt(id=0,off=0,r=0,imm=0) R10=fp0
4: (57) r5 &= 64
R5 bitwise operator &= on pointer prohibited
FAIL
Test 10: variable subtraction ... PASS
Test 11: pointer variable subtraction ... PASS
Results: 11 pass 1 fail
not ok 1..7 selftests: test_align [FAIL]
selftests: test_verifier_log
========================================
Test log_level 0...
Test log_size < 128...
Test log_buff = NULL...
Test oversized buffer...
Test exact buffer...
Test undersized buffers...
test_verifier_log: OK
ok 1..8 selftests: test_verifier_log [PASS]
selftests: test_dev_cgroup
========================================
libbpf: load bpf program failed: Permission denied
libbpf: -- BEGIN DUMP LOG ---
libbpf:
0: (61) r2 = *(u32 *)(r1 +4)
1: (b7) r0 = 0
2: (55) if r2 != 0x1 goto pc+8
R0=inv0 R1=ctx(id=0,off=0,imm=0) R2=inv1 R10=fp0
3: (69) r2 = *(u16 *)(r1 +0)
invalid bpf_context access off=0 size=2
libbpf: -- END LOG --
libbpf: failed to load program 'cgroup/dev'
libbpf: failed to load object './dev_cgroup.o'
(/usr/src/linux-selftests-x86_64-rhel-7.2-82abbf8d2fc46d79611ab58daa7c608df14bb3ee/tools/testing/selftests/bpf/cgroup_helpers.c:96: errno: No such file or directory) Opening Cgroup Procs: /mnt/cgroup.procs
Failed to load DEV_CGROUP program
not ok 1..9 selftests: test_dev_cgroup [FAIL]
selftests: test_kmod.sh
========================================
[ JIT enabled:0 hardened:0 ]
[ 134.236248] FAIL
[ 134.239508] not ok 1..7 selftests: test_align [FAIL]
[ 134.264552] not ok 1..9 selftests: test_dev_cgroup [FAIL]
[ 139.352274] test_bpf: Summary: 342 PASSED, 0 FAILED, [0/334 JIT'ed]
[ JIT enabled:1 hardened:0 ]
[ 139.376630] [ 134.264552] not ok 1..9 selftests: test_dev_cgroup [FAIL]
[ 139.383832] [ 139.352274] test_bpf: Summary: 342 PASSED, 0 FAILED, [0/334 JIT'ed]
[ 142.448376] test_bpf: Summary: 342 PASSED, 0 FAILED, [333/334 JIT'ed]
[ JIT enabled:1 hardened:1 ]
[ 145.505579] test_bpf: Summary: 342 PASSED, 0 FAILED, [333/334 JIT'ed]
[ JIT enabled:1 hardened:2 ]
[ 149.611957] test_bpf: Summary: 342 PASSED, 0 FAILED, [333/334 JIT'ed]
ok 1..10 selftests: test_kmod.sh [PASS]
To reproduce:
git clone https://github.com/intel/lkp-tests.git
cd lkp-tests
bin/lkp qemu -k <bzImage> job-script # job-script is attached in this email
Thanks,
Xiaolong
View attachment "config-4.15.0-rc3-00323-g82abbf8" of type "text/plain" (164404 bytes)
View attachment "job-script" of type "text/plain" (5431 bytes)
Download attachment "dmesg.xz" of type "application/x-xz" (98148 bytes)
View attachment "kernel_selftests" of type "text/plain" (242594 bytes)
Powered by blists - more mailing lists