Linux filesystem development
 help / color / mirror / Atom feed
From: "Colin Walters" <walters@verbum.org>
To: fsverity@lists.linux.dev,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Cc: "Eric Biggers" <ebiggers@google.com>,
	"Miklos Szeredi" <miklos@szeredi.hu>,
	"Amir Goldstein" <amir73il@gmail.com>,
	"Christoph Hellwig" <hch@infradead.org>
Subject: [PATCH] ovl: fix verity lazy-load guard broken by fsverity_active() semantic change
Date: Tue, 05 May 2026 14:15:58 -0400	[thread overview]
Message-ID: <6630d44f-967d-41f0-81ce-6958b371465a@app.fastmail.com> (raw)

Commit f77f281b6118 ("fsverity: use a hashtable to find the fsverity_info")
that broke `ovl_ensure_verity_loaded` in the case when the inode was not in core.

The APIs here are in my opinion now confusing, but this patch intentionally
aims for a minimized fix by using `fsverity_get_info()` which ensures
the hash table is loaded.

Fixes: f77f281b6118 ("fsverity: use a hashtable to find the fsverity_info")
Cc: stable@vger.kernel.org
Link: https://github.com/bootc-dev/bootc/issues/2174
Signed-off-by: Colin Walters <walters@verbum.org>
---
 fs/overlayfs/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 7b86a6bac644..bfdf9310ee78 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -1354,7 +1354,7 @@ int ovl_ensure_verity_loaded(const struct path *datapath)
 	struct inode *inode = d_inode(datapath->dentry);
 	struct file *filp;
 
-	if (!fsverity_active(inode) && IS_VERITY(inode)) {
+	if (IS_VERITY(inode) && !fsverity_get_info(inode)) {
 		/*
 		 * If this inode was not yet opened, the verity info hasn't been
 		 * loaded yet, so we need to do that here to force it into memory.
-- 
2.52.0


             reply	other threads:[~2026-05-05 18:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05 18:15 Colin Walters [this message]
2026-05-05 21:00 ` [PATCH] ovl: fix verity lazy-load guard broken by fsverity_active() semantic change Eric Biggers
2026-05-05 22:46   ` Eric Biggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6630d44f-967d-41f0-81ce-6958b371465a@app.fastmail.com \
    --to=walters@verbum.org \
    --cc=amir73il@gmail.com \
    --cc=ebiggers@google.com \
    --cc=fsverity@lists.linux.dev \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox