ubifs: Don't encrypt special files on creation
authorDavid Gstir <david@sigma-star.at>
Wed, 17 May 2017 11:36:16 +0000 (13:36 +0200)
committerRichard Weinberger <richard@nod.at>
Fri, 14 Jul 2017 20:49:05 +0000 (22:49 +0200)
When a new inode is created, we check if the containing folder has a encryption
policy set and inherit that. This should however only be done for regular
files, links and subdirectories. Not for sockes fifos etc.

Fixes: d475a507457b ("ubifs: Add skeleton for fscrypto")
Cc: stable@vger.kernel.org
Signed-off-by: David Gstir <david@sigma-star.at>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/dir.c

index 996e4215fd289fb9b3930b7ddbee0a3dff75f723..90a3f01c55d1dbcff3b9be6518a2ff88e98dcc1a 100644 (file)
@@ -143,6 +143,7 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, struct inode *dir,
        case S_IFBLK:
        case S_IFCHR:
                inode->i_op  = &ubifs_file_inode_operations;
+               encrypted = false;
                break;
        default:
                BUG();