Skip to content

Commit 36e24c0

Browse files
borkmanndavem330
authored andcommitted
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 <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4a2ff55 commit 36e24c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/bpf/verifier.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,8 @@ static void clear_all_pkt_pointers(struct bpf_verifier_env *env)
13461346
if (reg->type != PTR_TO_PACKET &&
13471347
reg->type != PTR_TO_PACKET_END)
13481348
continue;
1349-
reg->type = UNKNOWN_VALUE;
1350-
reg->imm = 0;
1349+
__mark_reg_unknown_value(state->spilled_regs,
1350+
i / BPF_REG_SIZE);
13511351
}
13521352
}
13531353

0 commit comments

Comments
 (0)