[PATCH v2 02/13] fs: add d_real_data_inode() and d_real_metadata_inode()
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Mon Nov 16 09:49:56 UTC 2026
> Currently, d_real() can't fail. When overlayfs fails to look up the data
> of a metacopy file in a data-only layer it hands back the overlayfs
> dentry and callers silently work with the overlayfs inode. That's more
> problematic than current callers realize.
>
> For trace_uprobe and bpf's uprobe_multi it means uprobe_register() fails
> with an -EIO that has nothing to do with the actual problem. For IMA it
> means the stacked change detection is skipped and for IPE the file is
> evaluated against an inode that has none of the properties of the real
> file.
>
> Teach d_real() to fail and teach all callers to handle errors. This adds
> two helpers for the callers to switch over to:
>
> - d_real_data_inode() returns the inode hosting the data or an ERR_PTR()
> [ ... ]
>
> Suggested-by: Amir Goldstein <amir73il at gmail.com>
> Link: https://lore.kernel.org/all/CAOQ4uxhGxpBtMZ5kfuzR1tQAewiecoX7UjXQRo91QjJHH9T_Yw@mail.gmail.com
> Reviewed-by: Amir Goldstein <amir73il at gmail.com>
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-work-ovl-d_real-v2-0-90564c4ae347@kernel.org?part=2
More information about the Linux-security-module-archive
mailing list