mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-18 08:35:08 +08:00
bpf: log PTR_TO_MEM memory size in verifier log
Emit valid memory size addressable through PTR_TO_MEM register. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Link: https://lore.kernel.org/r/20231204233931.49758-2-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
e72c1ccfd4
commit
1e68485d82
@ -682,6 +682,10 @@ static void print_reg_state(struct bpf_verifier_env *env,
|
||||
verbose_a("r=");
|
||||
verbose_unum(env, reg->range);
|
||||
}
|
||||
if (base_type(t) == PTR_TO_MEM) {
|
||||
verbose_a("sz=");
|
||||
verbose_unum(env, reg->mem_size);
|
||||
}
|
||||
if (tnum_is_const(reg->var_off)) {
|
||||
/* a pointer register with fixed offset */
|
||||
if (reg->var_off.value) {
|
||||
|
Loading…
Reference in New Issue
Block a user