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 --- 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