diff options
author | David S. Miller <davem@davemloft.net> | 2017-10-09 20:11:09 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-09 20:11:09 -0700 |
commit | d93fa2ba64384a0bbee4ae7409d85fccb2cfcf14 (patch) | |
tree | 8e55d9d74f46ce13e4299d23c23c72b9306798c1 /kernel/bpf/verifier.c | |
parent | d0e60206bea2dec46c0a28fd6b116646aa67c5ae (diff) | |
parent | 529a86e063e9ff625c4ff247d8aa17d8072444fb (diff) | |
download | linux-d93fa2ba64384a0bbee4ae7409d85fccb2cfcf14.tar.bz2 |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'kernel/bpf/verifier.c')
-rw-r--r-- | kernel/bpf/verifier.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 590125e29161..6352a88ca6d1 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -704,6 +704,10 @@ static void mark_reg_read(const struct bpf_verifier_state *state, u32 regno) { struct bpf_verifier_state *parent = state->parent; + if (regno == BPF_REG_FP) + /* We don't need to worry about FP liveness because it's read-only */ + return; + while (parent) { /* if read wasn't screened by an earlier write ... */ if (state->regs[regno].live & REG_LIVE_WRITTEN) @@ -2402,6 +2406,7 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn) * copy register state to dest reg */ regs[insn->dst_reg] = regs[insn->src_reg]; + regs[insn->dst_reg].live |= REG_LIVE_WRITTEN; } else { /* R1 = (u32) R2 */ if (is_pointer_value(env, insn->src_reg)) { |