Commit 32494d3d authored by Alexei Starovoitov's avatar Alexei Starovoitov Committed by popcornmix
Browse files

bpf: fix 64-bit divide



[ Upstream commit 876a7ae6 ]

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: 89aa0758 ("net: sock: allow eBPF programs to be attached to sockets")
Reported-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 1db5006f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment