aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/verifier/jit.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-05-07 09:25:43 -0700
committerDavid S. Miller <davem@davemloft.net>2019-05-07 09:25:43 -0700
commit982e826d31b1cbfebb8c94bea47949d684f272dc (patch)
treee71dcb34377763d4dc084dd06fb160c3b02d01d0 /tools/testing/selftests/bpf/verifier/jit.c
parentipv4: Define __ipv4_neigh_lookup_noref when CONFIG_INET is disabled (diff)
parentbpf, x32: Fix bug for BPF_ALU64 | BPF_NEG (diff)
downloadlinux-dev-982e826d31b1cbfebb8c94bea47949d684f272dc.tar.xz
linux-dev-982e826d31b1cbfebb8c94bea47949d684f272dc.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Daniel Borkmann says: ==================== pull-request: bpf 2019-05-06 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Two x32 JIT fixes: one which has buggy signed comparisons in 64 bit conditional jumps and another one for 64 bit negation, both from Wang. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/bpf/verifier/jit.c')
-rw-r--r--tools/testing/selftests/bpf/verifier/jit.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/verifier/jit.c b/tools/testing/selftests/bpf/verifier/jit.c
index be488b4495a3..c33adf344fae 100644
--- a/tools/testing/selftests/bpf/verifier/jit.c
+++ b/tools/testing/selftests/bpf/verifier/jit.c
@@ -86,3 +86,22 @@
.result = ACCEPT,
.retval = 2,
},
+{
+ "jit: jsgt, jslt",
+ .insns = {
+ BPF_LD_IMM64(BPF_REG_1, 0x80000000ULL),
+ BPF_LD_IMM64(BPF_REG_2, 0x0ULL),
+ BPF_JMP_REG(BPF_JSGT, BPF_REG_1, BPF_REG_2, 2),
+ BPF_MOV64_IMM(BPF_REG_0, 1),
+ BPF_EXIT_INSN(),
+
+ BPF_JMP_REG(BPF_JSLT, BPF_REG_2, BPF_REG_1, 2),
+ BPF_MOV64_IMM(BPF_REG_0, 1),
+ BPF_EXIT_INSN(),
+
+ BPF_MOV64_IMM(BPF_REG_0, 2),
+ BPF_EXIT_INSN(),
+ },
+ .result = ACCEPT,
+ .retval = 2,
+},