diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2017-09-08 19:23:04 +0200 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2017-09-08 19:23:04 +0200 |
commit | 2dc3d0d4086ea7e333d7cb65d940c3f483dbf47c (patch) | |
tree | cdfd3a49a51c06c0bf25c7942f42adb47bd99c89 /fs/ecryptfs/file.c | |
parent | e3e4496f794cfd3eb379ce67a748cb019fbc2840 (diff) | |
parent | 423532f98b4d3e57e5b59d5140e9c06e83f560a6 (diff) | |
download | kernel_samsung_tuna-2dc3d0d4086ea7e333d7cb65d940c3f483dbf47c.tar.gz kernel_samsung_tuna-2dc3d0d4086ea7e333d7cb65d940c3f483dbf47c.tar.bz2 kernel_samsung_tuna-2dc3d0d4086ea7e333d7cb65d940c3f483dbf47c.zip |
Merge remote-tracking branch 'lineageos/cm-13.0' into replicant-6.0replicant-6.0-0003replicant-6.0-0002
Diffstat (limited to 'fs/ecryptfs/file.c')
-rw-r--r-- | fs/ecryptfs/file.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index d3f95f941c4..a2a97cb614d 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c @@ -151,7 +151,15 @@ static const struct vm_operations_struct ecryptfs_file_vm_ops = { static int ecryptfs_file_mmap(struct file *file, struct vm_area_struct *vma) { + struct file *lower_file = ecryptfs_file_to_lower(file); int rc; + /* + * Don't allow mmap on top of file systems that don't support it + * natively. If FILESYSTEM_MAX_STACK_DEPTH > 2 or ecryptfs + * allows recursive mounting, this will need to be extended. + */ + if (!lower_file->f_op->mmap) + return -ENODEV; rc = generic_file_mmap(file, vma); if (!rc) |