On Sun, Nov 20, 2022 at 11:10 AM Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> wrote: > > IMO, there are a certain set of properties that check_func_arg_reg_off provides, > you could say that if each register type was a class, then the checks there > would be what you would do while constructing them on calling: > > PtrToStack(off, var_off /* can be const or variable */) > PtrToMapValue(off, var_off /* can be const or variable */) > PtrToBtfId(off /* must be >= 0 */) /* no var_off */ Just to complicate things a bit... ;) There was a request to allow var_off in ptr_to_btf_id. Sometimes there are fixed size arrays in structs and programs need to iterate those arrays in a loop. Another case is to access flex_array at the end of a struct. Like cgroup->ancestors[]. Both are currently impossible, but the verifier has to get this capability.