On Wed, 2024-11-20 at 16:53 -0800, Kumar Kartikeya Dwivedi wrote: > To ensure consistency in resource handling, move RCU and preemption > state counters to bpf_func_state, and convert all users to access them > through cur_func(env). > > For the sake of consistency, also compare active_locks in ressafe as a > quick way to eliminate iteration and entry matching if the number of > locks are not the same. > > OTOH, the comparison of active_preempt_locks and active_rcu_lock is > needed for correctness, as state exploration cannot be avoided if these > counters do not match, and not comparing them will lead to problems > since they lack an actual entry in the acquired_res array. > > Signed-off-by: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx> > --- This change is a bit confusing to me. The following is done currently: - in setup_func_entry() called from check_func_call(): copy_resource_state(callee, caller); - in prepare_func_exit(): copy_resource_state(caller, callee); So it seems that it is logical to track resources in the bpf_verifier_state and avoid copying. There is probably something I don't understand. [...]