Re: [PATCH v2 06/13] ima: handle errors from resolving the real inode
From: Christian Brauner
Date: Mon Nov 30 2026 - 09:23:44 EST
On Mon, Nov 16, 2026 at 10:44:03AM +0100, Christian Brauner wrote:
> Currently, if overlayfs fails to resolve the data of a file it hands
> back the overlayfs inode. process_measurement() then sees
> real_inode == inode, skips the detection of changes in the backing file
> and returns the cached verdict.
Ok, Mimi asked off-list whether this is limited to overlayfs with an
fsverity backing file because she couldn't reproduce it on a simple
overlay. Answering here so it's on the list and because Mimi said that's
ok:
It's not limited to verity. ovl_d_real() can only fail for D_REAL_DATA
and only in ovl_verify_lowerdata():
(1) lazy lookup of lower data
For example, a metacopy file whose redirect points into a data-only
lower layer (lowerdir=...::data). If that data file can't be found
then the lookup fails.
(2) verity=on/require
If the data file doesn't match the digest stored in the metacopy
file validation fails.
On a simple overlay without metacopy the lower dentry is the data. So
d_real() can't fail because nothing has to be resolved.