diff options
author | Wang YanQing <udknight@gmail.com> | 2020-04-23 07:06:37 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-04-25 02:23:01 +0200 |
commit | 5ca1ca01fae1e90f8d010eb1d83374f28dc11ee6 (patch) | |
tree | 8fec8a8bb6767c895af20b8da8d9aa555539d005 /arch | |
parent | bpf, x86_32: Fix clobbering of dst for BPF_JSET (diff) | |
download | linux-5ca1ca01fae1e90f8d010eb1d83374f28dc11ee6.tar.xz linux-5ca1ca01fae1e90f8d010eb1d83374f28dc11ee6.zip |
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: 836256bf5f37 ("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
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/net/bpf_jit_comp32.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/net/bpf_jit_comp32.c b/arch/x86/net/bpf_jit_comp32.c index ba7d9ccfc662..66cd150b7e54 100644 --- a/arch/x86/net/bpf_jit_comp32.c +++ b/arch/x86/net/bpf_jit_comp32.c @@ -1847,7 +1847,7 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, case BPF_B: case BPF_H: case BPF_W: - if (!bpf_prog->aux->verifier_zext) + if (bpf_prog->aux->verifier_zext) break; if (dstk) { EMIT3(0xC7, add_1reg(0x40, IA32_EBP), |