Skip to content

Commit 0c8c88b

Browse files
cgwaltersEric Biggers
authored andcommitted
ovl: fix verity lazy-load guard broken by fsverity_active() semantic change
Commit f77f281 ("fsverity: use a hashtable to find the fsverity_info") made fsverity_active() check whether the inode has the verity flag, rather than whether the inode's fsverity_info is loaded. This broke ovl_ensure_verity_loaded(), which wants to load the fsverity_info for any verity inodes that haven't had it loaded yet. Therefore, to check that the fsverity_info hasn't yet been loaded, use fsverity_get_info(inode) == NULL instead of !fsverity_active(inode). Also, since fsverity_get_info() now involves a hash table lookup, put the more lightweight IS_VERITY() flag check first. Fixes: f77f281 ("fsverity: use a hashtable to find the fsverity_info") Cc: stable@vger.kernel.org Link: bootc-dev/bootc#2174 Signed-off-by: Colin Walters <walters@verbum.org> Acked-by: Amir Goldstein <amir73il@gmail.com> Link: https://patch.msgid.link/20260505224257.23213-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
1 parent 7fd2df2 commit 0c8c88b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/overlayfs/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ int ovl_ensure_verity_loaded(const struct path *datapath)
13541354
struct inode *inode = d_inode(datapath->dentry);
13551355
struct file *filp;
13561356

1357-
if (!fsverity_active(inode) && IS_VERITY(inode)) {
1357+
if (IS_VERITY(inode) && fsverity_get_info(inode) == NULL) {
13581358
/*
13591359
* If this inode was not yet opened, the verity info hasn't been
13601360
* loaded yet, so we need to do that here to force it into memory.

0 commit comments

Comments
 (0)