Commit 7d1238f2 authored by Edward Cree's avatar Edward Cree Committed by David S. Miller

bpf/verifier: more concise register state logs for constant var_off

Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b03c9f9f
...@@ -234,6 +234,13 @@ static void print_verifier_state(struct bpf_verifier_state *state) ...@@ -234,6 +234,13 @@ static void print_verifier_state(struct bpf_verifier_state *state)
verbose(",ks=%d,vs=%d", verbose(",ks=%d,vs=%d",
reg->map_ptr->key_size, reg->map_ptr->key_size,
reg->map_ptr->value_size); reg->map_ptr->value_size);
if (tnum_is_const(reg->var_off)) {
/* Typically an immediate SCALAR_VALUE, but
* could be a pointer whose offset is too big
* for reg->off
*/
verbose(",imm=%llx", reg->var_off.value);
} else {
if (reg->smin_value != reg->umin_value && if (reg->smin_value != reg->umin_value &&
reg->smin_value != S64_MIN) reg->smin_value != S64_MIN)
verbose(",smin_value=%lld", verbose(",smin_value=%lld",
...@@ -254,6 +261,7 @@ static void print_verifier_state(struct bpf_verifier_state *state) ...@@ -254,6 +261,7 @@ static void print_verifier_state(struct bpf_verifier_state *state)
tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off); tnum_strn(tn_buf, sizeof(tn_buf), reg->var_off);
verbose(",var_off=%s", tn_buf); verbose(",var_off=%s", tn_buf);
} }
}
verbose(")"); verbose(")");
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment