On Sat, 1 Mar 2025 at 00:57, Eduard Zingerman <eddyz87@xxxxxxxxx> wrote: > > On Fri, 2025-02-28 at 15:34 -0800, Andrii Nakryiko wrote: > > [...] > > > > There were two alternatives on the table last time: > > > - add support for tags on global functions; > > > > I was supportive of this, I believe > > > > > - verify global subprogram call tree in post-order, > > > in order to have the flags ready when needed. > > > > Remind me of the details here? we'd start validating the main prog, > > suspend that process when encountering global func, go validate global > > func, once done, come back to main prog, right? > > Yes. > The tree can't be built statically if we account for dead code > elimination, as post-order might change. > > > Alternatively, we could mark expected properties (restrictions) of > > global subprogs as we encounter them, right? E.g, if we come to global > > func call inside rcu_read_{lock,unlock}() region, we'd mark it > > internally as "needs to be non-sleepable". > > For situation like below, suppose verification order is main, foo, > bar, buz: > - main() sleepable > - foo() > - bar() > - foo(): > - buz() > - bar(): > - foo() while holding lock > - buz(): > - calls something sleepable > > I think, to handle this the call-tree needs to be built on the main > verification pass, and then checked for sleepable. > But that won't work for changes_pkt_data, as verdict has to be known > right-away to decide whether to invalidate packet pointers. > I know over-conservative marking in presence of possible DCE is non-ideal (that's why I put in the comment, so we revisit it later), I'm getting the sense from this thread that either option is a lot more work/complexity, or insufficient. Except for possibly taggings things properly, but that's been nipped in the bud. So I'm going to prepare a v2 addressing Eduard's comments, and if we reach a consensus, I can follow up to address both changes_pkt_data and sleepable global subprogs. > [...] >