From: Alexander Mikhalitsyn <alex@amutable.com>
To: code@tyhicks.com
Cc: brauner@kernel.org, ecryptfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org,
"Alexander Mikhalitsyn" <alex@amutable.com>,
"Frank Hsiao 蕭法宣" <frankhsiao@qnap.com>,
"Thorsten Blum" <blum@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH] ecryptfs: refuse pseudo filesystems as a source
Date: Tue, 24 Nov 2026 20:53:14 +0100 [thread overview]
Message-ID: <20261124195315.105369-1-alex@amutable.com> (raw)
We shouldn't allow pseudo filesystems to be used as a data layer
for ecryptfs the same way as we have forbidden this in many other
places like loop, erofs, nvmet and acct [1].
Link: https://lore.kernel.org/all/20261114-work-loop-pseudo-v2-0-98639a2286fb@kernel.org/ [1]
Signed-off-by: Alexander Mikhalitsyn <alex@amutable.com>
---
fs/ecryptfs/main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 5f37cddb956f..471d4aff0e7d 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -500,6 +500,12 @@ static int ecryptfs_get_tree(struct fs_context *fc)
goto out_free;
}
+ if (d_real_inode(path.dentry)->i_sb->s_iflags & SB_I_PSEUDO) {
+ rc = -EINVAL;
+ printk(KERN_ERR "Mounting on pseudo filesystems disallowed\n");
+ goto out_free;
+ }
+
if (ctx->check_ruid &&
!uid_eq(d_inode(path.dentry)->i_uid, current_uid())) {
rc = -EPERM;
--
2.47.3
reply other threads:[~2026-11-24 19:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261124195315.105369-1-alex@amutable.com \
--to=alex@amutable.com \
--cc=blum@kernel.org \
--cc=brauner@kernel.org \
--cc=code@tyhicks.com \
--cc=ecryptfs@vger.kernel.org \
--cc=frankhsiao@qnap.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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