]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86: bpf_jit: fix FROM_BE16 and FROM_LE16/32 instructions
authorAlexei Starovoitov <ast@plumgrid.com>
Tue, 12 May 2015 06:25:16 +0000 (23:25 -0700)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 15 Jun 2015 18:26:49 +0000 (14:26 -0400)
commit8cf633a242cb01b9cea77604337bc9801c3eb5ae
tree2f32203b848e6e4d2c78ff6bcffd9d078c97583b
parent5d2ed1cd21b16a83059eeb217a562de52239d003
x86: bpf_jit: fix FROM_BE16 and FROM_LE16/32 instructions

[ Upstream commit 343f845b375989f1753f605902931fa939aa2223 ]

FROM_BE16:
'ror %reg, 8' doesn't clear upper bits of the register,
so use additional 'movzwl' insn to zero extend 16 bits into 64

FROM_LE16:
should zero extend lower 16 bits into 64 bit

FROM_LE32:
should zero extend lower 32 bits into 64 bit

Fixes: 89aa075832b0 ("net: sock: allow eBPF programs to be attached to sockets")
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
arch/x86/net/bpf_jit_comp.c