[PATCH -next -v4 01/17] fs: pass struct path to notify_change()
Cai Xinchen
caixinchen1 at huawei.com
Thu Nov 26 13:27:37 UTC 2026
oh, I get it.
I think it would be better to use a new function, such as
notify_change_internal,
to bypass this upperpath check, while retaining the inode check.
ovl_do_notify_change
->notify_change_internal(...)
->do_notify_change(..., true)
->security_inode_setattr
if (!internal)
security_path_setattr
But this leads me to possibly needing to split the inode LSM hooks and
the path
LSM hooks.
On 11/19/2026 1:23 PM, Al Viro wrote:
> 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?
More information about the Linux-security-module-archive
mailing list