bpf: reset id on spilled regs in clear_all_pkt_pointers
Right now, we don't reset the id of spilled registers in case of clear_all_pkt_pointers(). Given pkt_pointers are highly likely to contain an id, do so by reusing __mark_reg_unknown_value(). Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4a2ff55aa4
commit
36e24c0030
@ -1346,8 +1346,8 @@ static void clear_all_pkt_pointers(struct bpf_verifier_env *env)
|
|||||||
if (reg->type != PTR_TO_PACKET &&
|
if (reg->type != PTR_TO_PACKET &&
|
||||||
reg->type != PTR_TO_PACKET_END)
|
reg->type != PTR_TO_PACKET_END)
|
||||||
continue;
|
continue;
|
||||||
reg->type = UNKNOWN_VALUE;
|
__mark_reg_unknown_value(state->spilled_regs,
|
||||||
reg->imm = 0;
|
i / BPF_REG_SIZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user