summaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/file.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-30 05:12:05 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-30 05:12:05 -0700
commit03420865e10d05d60d592fe8649e4853dc69ca5a (patch)
tree105d173e5267931d794e429ee7c64f83e526a521 /fs/ecryptfs/file.c
parenta2e63709b53312002009c564460af34520c62f98 (diff)
parent6da6c0db5316275015e8cc2959f12a17584aeb64 (diff)
downloadop-kernel-dev-03420865e10d05d60d592fe8649e4853dc69ca5a.zip
op-kernel-dev-03420865e10d05d60d592fe8649e4853dc69ca5a.tar.gz
Merge 4.17-rc3 into staging-next
We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ecryptfs/file.c')
-rw-r--r--fs/ecryptfs/file.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index c74ed3c..b76a985 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -82,17 +82,28 @@ ecryptfs_filldir(struct dir_context *ctx, const char *lower_name,
buf->sb, lower_name,
lower_namelen);
if (rc) {
- printk(KERN_ERR "%s: Error attempting to decode and decrypt "
- "filename [%s]; rc = [%d]\n", __func__, lower_name,
- rc);
- goto out;
+ if (rc != -EINVAL) {
+ ecryptfs_printk(KERN_DEBUG,
+ "%s: Error attempting to decode and decrypt filename [%s]; rc = [%d]\n",
+ __func__, lower_name, rc);
+ return rc;
+ }
+
+ /* Mask -EINVAL errors as these are most likely due a plaintext
+ * filename present in the lower filesystem despite filename
+ * encryption being enabled. One unavoidable example would be
+ * the "lost+found" dentry in the root directory of an Ext4
+ * filesystem.
+ */
+ return 0;
}
+
buf->caller->pos = buf->ctx.pos;
rc = !dir_emit(buf->caller, name, name_size, ino, d_type);
kfree(name);
if (!rc)
buf->entries_written++;
-out:
+
return rc;
}
OpenPOWER on IntegriCloud