diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index bcb42aaf1b3ae5ce4a3845a626c42854e236a3e9..acc2305ad895787266dc4c8c1971be46d6bf6fa3 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -2815,7 +2815,7 @@ static int sanitize_ptr_alu(struct bpf_verifier_env *env, *dst_reg = *ptr_reg; } ret = push_stack(env, env->insn_idx + 1, env->insn_idx, true); - if (!ptr_is_dst_reg) + if (!ptr_is_dst_reg && ret) *dst_reg = tmp; return !ret ? -EFAULT : 0; }