linux-stable/arch
Luke Nelson 6fa632e719 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: 03f5781be2 ("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>
2019-07-03 11:14:28 +02:00
..
alpha treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
arc ARC fixes for 5.2-rc4 2019-06-03 14:45:48 -07:00
arm SPDX fixes for 5.2-rc3, round 2 2019-06-02 10:22:38 -07:00
arm64 arm64 fixes for -rc4 2019-06-07 09:21:48 -07:00
c6x treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
csky treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
h8300 treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
hexagon treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
ia64 SPDX update for 5.2-rc3, round 1 2019-05-31 08:34:32 -07:00
m68k treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
microblaze treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
mips Fixes for PPC and s390. 2019-06-02 10:19:39 -07:00
nds32 nds32 patches for 5.2-rc3 2019-06-03 10:23:41 -07:00
nios2 treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
openrisc treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
parisc Merge branch 'parisc-5.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux 2019-06-06 13:13:09 -07:00
powerpc powerpc/bpf: use unsigned division instruction for 64-bit operations 2019-06-13 23:07:00 +02:00
riscv Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 2019-06-07 14:46:47 -07:00
s390 Fixes for PPC and s390. 2019-06-02 10:19:39 -07:00
sh treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 211 2019-05-30 11:29:53 -07:00
sparc sparc: perf: fix updated event period in response to PERF_EVENT_IOC_PERIOD 2019-06-02 22:16:33 -07:00
um treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
unicore32 treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
x86 bpf, x32: Fix bug with ALU64 {LSH, RSH, ARSH} BPF_K shift by 0 2019-07-03 11:14:28 +02:00
xtensa treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
.gitignore
Kconfig Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-05-16 11:00:20 -07:00