* [PATCH] ecryptfs: refuse pseudo filesystems as a source
@ 2026-11-24 19:53 Alexander Mikhalitsyn
0 siblings, 0 replies; only message in thread
From: Alexander Mikhalitsyn @ 2026-11-24 19:53 UTC (permalink / raw)
To: code
Cc: brauner, ecryptfs, linux-fsdevel, Alexander Mikhalitsyn,
Frank Hsiao 蕭法宣,
Thorsten Blum, linux-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-24 19:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 19:53 [PATCH] ecryptfs: refuse pseudo filesystems as a source Alexander Mikhalitsyn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®