[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260111003655.491722-1-thorsten.blum@linux.dev>
Date: Sun, 11 Jan 2026 01:36:52 +0100
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Tyler Hicks <code@...icks.com>,
Thorsten Blum <thorsten.blum@...ux.dev>,
Ard Biesheuvel <ardb@...nel.org>,
Zipeng Zhang <zhangzipeng0@...mail.com>,
Christian Brauner <brauner@...nel.org>,
Eric Biggers <ebiggers@...nel.org>,
Michael Halcrow <mhalcrow@...ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: stable@...r.kernel.org,
ecryptfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] ecryptfs: Add missing gotos in ecryptfs_read_metadata
Add two missing goto statements to exit ecryptfs_read_metadata() when an
error occurs.
The first goto is required; otherwise ECRYPTFS_METADATA_IN_XATTR may be
set when xattr metadata is enabled even though parsing the metadata
failed. The second goto is not strictly necessary, but it makes the
error path explicit instead of relying on falling through to 'out'.
Cc: stable@...r.kernel.org
Fixes: dd2a3b7ad98f ("[PATCH] eCryptfs: Generalize metadata read/write")
Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
---
fs/ecryptfs/crypto.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 260f8a4938b0..d49cdf7292ab 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -1328,6 +1328,7 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
"file xattr region either, inode %lu\n",
ecryptfs_inode->i_ino);
rc = -EINVAL;
+ goto out;
}
if (crypt_stat->mount_crypt_stat->flags
& ECRYPTFS_XATTR_METADATA_ENABLED) {
@@ -1340,6 +1341,7 @@ int ecryptfs_read_metadata(struct dentry *ecryptfs_dentry)
"this like an encrypted file, inode %lu\n",
ecryptfs_inode->i_ino);
rc = -EINVAL;
+ goto out;
}
}
out:
--
Thorsten Blum <thorsten.blum@...ux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
Powered by blists - more mailing lists