Skip to content

Commit 5ca1ca0

Browse files
wyqkpAlexei Starovoitov
authored andcommitted
bpf, x86_32: Fix logic error in BPF_LDX zero-extension
When verifier_zext is true, we don't need to emit code for zero-extension. Fixes: 836256b ("x32: bpf: eliminate zero extension code-gen") Signed-off-by: Wang YanQing <udknight@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200423050637.GA4029@udknight
1 parent 50fe7eb commit 5ca1ca0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/net/bpf_jit_comp32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,7 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
18471847
case BPF_B:
18481848
case BPF_H:
18491849
case BPF_W:
1850-
if (!bpf_prog->aux->verifier_zext)
1850+
if (bpf_prog->aux->verifier_zext)
18511851
break;
18521852
if (dstk) {
18531853
EMIT3(0xC7, add_1reg(0x40, IA32_EBP),

0 commit comments

Comments
 (0)