ecryptfs: refuse pseudo filesystems as a source
Subsystems (2)
PATCH 1/1 ecryptfs: refuse pseudo filesystems as a source
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].
Signed-off-by Alexander Mikhalitsyn <[email protected]>
--- fs/ecryptfs/main.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/ecryptfs/main.c +6 -0
@@ -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 ;
Signature · 1 line
2.47.3