Re: [PATCH bpf 3/4] bpf: Improve ctx access verifier error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2025-08-01 at 18:19 +0200, Paul Chaignon wrote:

[...]

> > > @@ -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);
> > 
> > Nit: maybe print the rest of the fields as well?
> 
> I considered it but didn't want to unnecessarily bloat the message.
> Knowing cnt is enough to know which of the three conditions is true. If
> the last one is true, then knowing the values of ctx_field_size and
> target_size doesn't really help us because the issue is just that one is
> set (ctx_field_size in _is_valid_access) while the other wasn't
> (target_size in _convert_ctx_accesses). That indicates a mismatch
> between the two functions for that particular program type.

Ack, makes sense. Thank you for explaining.





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux