Re: [PATCH -next -v4 01/17] fs: pass struct path to notify_change()

From: Al Viro

Date: Thu Nov 19 2026 - 00:24:23 EST


On Wed, Nov 18, 2026 at 05:13:31PM +0800, Cai Xinchen wrote:
> On whether we want the mount references at all: they are not for NTFS.
> The path-based LSM hooks need them - Landlock's check walks the hierarchy
> up from the object with path->mnt->mnt_root and follow_up(), for every
> layer, and the idmap we pass has to be the one of the mount the path was
> checked in.

Then it won't be happy with overlayfs ones:
upper_mnt = clone_private_mount(upperpath);
...
upper_layer->mnt = upper_mnt;
in ovl_get_upper(),
err = ovl_get_upper(sb, ofs, &layers[0], &ctx->upper);
in ovl_fill_super_creds()
combined with
static inline struct vfsmount *ovl_upper_mnt(struct ovl_fs *ofs)
{
return ofs->layers[0].mnt;
}

mean that the mount you get won't be attached to anything. How (un)happy
would landlock be with that?