On Wed, 25 Jun 2025, Mickaël Salaün wrote: > On Fri, Jun 20, 2025 at 02:59:17PM -0700, Song Liu wrote: > > Hi Christian, Mickaël, and folks, > > > > Could you please share your comments on this version? Does this > > look sane? > > This looks good to me but we need to know what is the acceptable next > step to support RCU. If we can go with another _rcu helper, I'm good > with the current approach, otherwise we need to figure out a way to > leverage the current helper to make it compatible with callers being in > a RCU read-side critical section while leveraging safe path walk (i.e. > several calls to path_walk_parent). Can you spell out the minimum that you need? My vague impression is that you want to search up from a given strut path, no further then some other given path, looking for a dentry that matches some rule. Is that correct? In general, the original dentry could be moved away from under the dentry you find moments after the match is reported. What mechanisms do you have in place to ensure this doesn't happen, or that it doesn't matter? Would it be sufficient to have an iterator which reported successive ancestors in turn, or reported that you need to restart because something changed? Would you need to know that a restart happened or would it be acceptable to transparently start again at the parent of the starting point? Or do you really need a "one step at a time" interface? Do you need more complex movements around the tree, or is just walking up sufficient? If this has been discussed or documented elsewhere I'd be happy for you just to provide a reference, and I can come back with follow-up questions if needed. Thanks, NeilBrown > > > > > Thanks, > > Song > > > > On Mon, Jun 16, 2025 at 11:11 PM Song Liu <song@xxxxxxxxxx> wrote: > > > > > > In security use cases, it is common to apply rules to VFS subtrees. > > > However, filtering files in a subtree is not straightforward [1]. > > > > > > One solution to this problem is to start from a path and walk up the VFS > > > tree (towards the root). Among in-tree LSMs, Landlock uses this solution. > > > > > > > [...] > > >