Skip to contentSkip to conversation

ecryptfs: refuse pseudo filesystems as a source

PATCH New Alexander Mikhalitsyn 1 participant 1 message Nov 24

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

---
 fs/ecryptfs/main.c | 6 ++++++
 1 file changed, 6 insertions(+)
fs/ecryptfs/main.c +6 -0
index 5f37cddb956f..471d4aff0e7d 100644
@@ -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