Skip to content

Commit c9b8da7

Browse files
rnavmpe
authored andcommitted
powerpc/bpf ppc32: Fix ALU32 BPF_ARSH operation
Correct the destination register used for ALU32 BPF_ARSH operation. Fixes: 51c66ad ("powerpc/bpf: Implement extended BPF on PPC32") Signed-off-by: Naveen N. Rao <[email protected]> Reviewed-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/6d24c1f9e79b6f61f5135eaf2ea1e8bcd4dac87b.1633464148.git.naveen.n.rao@linux.vnet.ibm.com
1 parent b7540d6 commit c9b8da7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/net/bpf_jit_comp32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, struct codegen_context *
625625
EMIT(PPC_RAW_LI(dst_reg_h, 0));
626626
break;
627627
case BPF_ALU | BPF_ARSH | BPF_X: /* (s32) dst >>= src */
628-
EMIT(PPC_RAW_SRAW(dst_reg_h, dst_reg, src_reg));
628+
EMIT(PPC_RAW_SRAW(dst_reg, dst_reg, src_reg));
629629
break;
630630
case BPF_ALU64 | BPF_ARSH | BPF_X: /* (s64) dst >>= src */
631631
bpf_set_seen_register(ctx, tmp_reg);

0 commit comments

Comments
 (0)