aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf
diff options
context:
space:
mode:
authorLuke Nelson <lukenels@cs.washington.edu>2019-06-28 22:57:50 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2019-07-03 11:14:28 +0200
commit6fa632e719eec4d1b1ebf3ddc0b2d667997b057b (patch)
treed2d6f3e67778c27a1e27c37059ac1b0a31122fd2 /tools/testing/selftests/bpf
parentbpf, x32: Fix bug with ALU64 {LSH, RSH, ARSH} BPF_X shift by 0 (diff)
downloadlinux-dev-6fa632e719eec4d1b1ebf3ddc0b2d667997b057b.tar.xz
linux-dev-6fa632e719eec4d1b1ebf3ddc0b2d667997b057b.zip
bpf, x32: Fix bug with ALU64 {LSH, RSH, ARSH} BPF_K shift by 0
The current x32 BPF JIT does not correctly compile shift operations when the immediate shift amount is 0. The expected behavior is for this to be a no-op. The following program demonstrates the bug. The expexceted result is 1, but the current JITed code returns 2. r0 = 1 r1 = 1 r1 <<= 0 if r1 == 1 goto end r0 = 2 end: exit This patch simplifies the code and fixes the bug. Fixes: 03f5781be2c7 ("bpf, x86_32: add eBPF JIT compiler for ia32") Co-developed-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Luke Nelson <luke.r.nels@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf')
0 files changed, 0 insertions, 0 deletions