From: David Gstir Date: Wed, 17 May 2017 11:36:16 +0000 (+0200) Subject: ubifs: Don't encrypt special files on creation X-Git-Tag: v4.12.4~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd152e6e347c6c6311877e40a75eee37cf00be43;p=thirdparty%2Fkernel%2Fstable.git ubifs: Don't encrypt special files on creation commit f34e87f58dabc31eb69f61cf4a79e951d4176743 upstream. 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") Signed-off-by: David Gstir Signed-off-by: Richard Weinberger Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 566079d9b402c..c67f6a3a606ca 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -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();