summaryrefslogtreecommitdiff
path: root/net/ipv4/tcp_bic.c
diff options
context:
space:
mode:
authorLuke Nelson <luke.r.nels@gmail.com>2019-05-31 01:29:22 +0300
committerAlexei Starovoitov <ast@kernel.org>2019-06-01 03:08:53 +0300
commit1e692f09e091bf5c8b38384f297d6dae5dbf0f12 (patch)
treebd39ab619e1c156b8a8b6701527ba6b472dc3748 /net/ipv4/tcp_bic.c
parentcfd4921049269ee6765b4a1cb820b95d0df5dda5 (diff)
downloadlinux-1e692f09e091bf5c8b38384f297d6dae5dbf0f12.tar.xz
bpf, riscv: clear high 32 bits for ALU32 add/sub/neg/lsh/rsh/arsh
In BPF, 32-bit ALU operations should zero-extend their results into the 64-bit registers. The current BPF JIT on RISC-V emits incorrect instructions that perform sign extension only (e.g., addw, subw) on 32-bit add, sub, lsh, rsh, arsh, and neg. This behavior diverges from the interpreter and JITs for other architectures. This patch fixes the bugs by performing zero extension on the destination register of 32-bit ALU operations. Fixes: 2353ecc6f91f ("bpf, riscv: add BPF JIT for RV64G") Cc: Xi Wang <xi.wang@gmail.com> Signed-off-by: Luke Nelson <luke.r.nels@gmail.com> Acked-by: Song Liu <songliubraving@fb.com> Acked-by: Björn Töpel <bjorn.topel@gmail.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/ipv4/tcp_bic.c')
0 files changed, 0 insertions, 0 deletions