[PATCH 08/13] ipe: handle errors from resolving the real inode

Christian Brauner brauner at kernel.org
Mon Nov 16 08:19:30 UTC 2026


On Sun, Nov 15, 2026 at 01:00:55PM -0800, Fan Wu wrote:
> On 11/15/2026 6:01 AM, Christian Brauner wrote:
> 
> ...
> 
> > 
> > diff --git a/security/ipe/eval.c b/security/ipe/eval.c
> > index 4a7be96c84f03..3751963509df4 100644
> > --- a/security/ipe/eval.c
> > +++ b/security/ipe/eval.c
> > @@ -102,7 +102,11 @@ void ipe_build_eval_ctx(struct ipe_eval_ctx *ctx,
> >  
> >  	if (file) {
> >  		build_ipe_sb_ctx(ctx, file);
> > -		ino = d_real_inode(file->f_path.dentry);
> > +		ino = d_real_data_inode(file->f_path.dentry);
> > +		if (IS_ERR(ino)) {
> > +			ctx->file_err = PTR_ERR(ino);
> > +			return;
> > +		}
> >  		build_ipe_bdev_ctx(ctx, ino);
> >  		build_ipe_inode_ctx(ctx, ino);
> 
> 
> I think we only need to change this part like:
> 
> 	/*
> 	 * If the real data inode cannot be resolved, leave the bdev
> 	 * and inode fields unset so the file is evaluated without
> 	 * dm-verity/fs-verity state.
> 	 */
> 	ino = d_real_data_inode(file->f_path.dentry);
> 	if (!IS_ERR(ino)) {
> 		build_ipe_bdev_ctx(ctx, ino);
> 		build_ipe_inode_ctx(ctx, ino);
> 	}
> 
> 
> This also avoids the missing audit issue noted by the bpf bot, and we
> don't need to add file_err to struct ipe_eval_ctx.
> 
> With the above change, feel free to add:
> 
> Acked-by: Fan Wu <wufan at kernel.org>

Done, thanks, that's a good solution!



More information about the Linux-security-module-archive mailing list