]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: fix 64-bit divide
authorAlexei Starovoitov <ast@plumgrid.com>
Mon, 27 Apr 2015 21:40:37 +0000 (14:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 May 2015 12:34:01 +0000 (05:34 -0700)
commit254209849e6280ec3ffcfbd095c5c19dcd0dedbc
tree0af1c8ab83e47a7530746b16b56374ba9ba8946b
parent7214c55cba9630a4728f86ae6b3c73c962430711
bpf: fix 64-bit divide

[ Upstream commit 876a7ae65b86d8cec8efe7d15d050ac61116874e ]

ALU64_DIV instruction should be dividing 64-bit by 64-bit,
whereas do_div() does 64-bit by 32-bit divide.
x64 and arm64 JITs correctly implement 64 by 64 unsigned divide.
llvm BPF backend emits code assuming that ALU64_DIV does 64 by 64.

Fixes: 89aa075832b0 ("net: sock: allow eBPF programs to be attached to sockets")
Reported-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/bpf/core.c