bpf: Improve ctx access verifier error message

We've already had two "error during ctx access conversion" warnings
triggered by syzkaller. Let's improve the error message by dumping the
cnt variable so that we can more easily differentiate between the
different error cases.

Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/cc94316c30dd76fae4a75a664b61a2dbfe68e205.1754039605.git.paul.chaignon@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
pull/1320/head
Paul Chaignon 2025-08-01 11:49:15 +02:00 committed by Alexei Starovoitov
parent 9e6448f7b1
commit f914876eec
1 changed files with 1 additions and 1 deletions

View File

@ -21445,7 +21445,7 @@ static int convert_ctx_accesses(struct bpf_verifier_env *env)
&target_size);
if (cnt == 0 || cnt >= INSN_BUF_SIZE ||
(ctx_field_size && !target_size)) {
verifier_bug(env, "error during ctx access conversion");
verifier_bug(env, "error during ctx access conversion (%d)", cnt);
return -EFAULT;
}