ARM: net: bpf: fix LDX instructions
authorRussell King <rmk+kernel@armlinux.org.uk>
Sat, 13 Jan 2018 21:06:16 +0000 (21:06 +0000)
committerRussell King <rmk+kernel@armlinux.org.uk>
Wed, 17 Jan 2018 19:38:21 +0000 (19:38 +0000)
commitec19e02b343db991d2d1610c409efefebf4e2ca9
treec631847a3e173367ef9ec46d38d1ebc4a4815278
parent02088d9b392f605c892894b46aa8c83e3abd0115
ARM: net: bpf: fix LDX instructions

When the source and destination register are identical, our JIT does not
generate correct code, which leads to kernel oopses.

Fix this by (a) generating more efficient code, and (b) making use of
the temporary earlier if we will overwrite the address register.

Fixes: 39c13c204bb1 ("arm: eBPF JIT compiler")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/net/bpf_jit_32.c