about summary refs log tree commit diff
path: root/pkgs/os-specific/linux
diff options
context:
space:
mode:
authorobadz <obadz-git@obadz.com>2016-07-13 11:01:56 +0200
committerobadz <obadz-git@obadz.com>2016-07-13 11:04:07 +0200
commitfad9a8841b67ee9e09dd352785e24d9b9d22e11c (patch)
tree7615a40015c229564e64a11fc1beae7122212aea /pkgs/os-specific/linux
parent5737c26b6b1c0a1f49c1a0213f3be05c010cc6bb (diff)
downloadnixlib-fad9a8841b67ee9e09dd352785e24d9b9d22e11c.tar
nixlib-fad9a8841b67ee9e09dd352785e24d9b9d22e11c.tar.gz
nixlib-fad9a8841b67ee9e09dd352785e24d9b9d22e11c.tar.bz2
nixlib-fad9a8841b67ee9e09dd352785e24d9b9d22e11c.tar.lz
nixlib-fad9a8841b67ee9e09dd352785e24d9b9d22e11c.tar.xz
nixlib-fad9a8841b67ee9e09dd352785e24d9b9d22e11c.tar.zst
nixlib-fad9a8841b67ee9e09dd352785e24d9b9d22e11c.zip
ecryptfs: fix kernel bug introduced in 4.4.14
Introduced by mainline commit 2f36db7
Patch is from http://www.spinics.net/lists/stable/msg137350.html
Fixes #16766
Diffstat (limited to 'pkgs/os-specific/linux')
-rw-r--r--pkgs/os-specific/linux/kernel/ecryptfs-fix-mmap-bug.patch20
-rw-r--r--pkgs/os-specific/linux/kernel/patches.nix4
2 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/kernel/ecryptfs-fix-mmap-bug.patch b/pkgs/os-specific/linux/kernel/ecryptfs-fix-mmap-bug.patch
new file mode 100644
index 000000000000..7f94669a9f45
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/ecryptfs-fix-mmap-bug.patch
@@ -0,0 +1,20 @@
+Signed-off-by: Tyler Hicks <tyhicks@xxxxxxxxxxxxx>
+Tested-by: Tyler Hicks <tyhicks@xxxxxxxxxxxxx> # 4.4.y, 3.18.y
+Cc: <stable@xxxxxxxxxxxxxxx> # 4.5-
+---
+ fs/ecryptfs/kthread.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fs/ecryptfs/kthread.c b/fs/ecryptfs/kthread.c
+index e818f5a..b9faeab 100644
+--- a/fs/ecryptfs/kthread.c
++++ b/fs/ecryptfs/kthread.c
+@@ -171,7 +171,7 @@ int ecryptfs_privileged_open(struct file **lower_file,
+ 		goto out;
+ 	}
+ have_file:
+-	if ((*lower_file)->f_op->mmap == NULL) {
++	if ((*lower_file)->f_op->mmap == NULL && !d_is_dir(lower_dentry)) {
+ 		fput(*lower_file);
+ 		*lower_file = NULL;
+ 		rc = -EMEDIUMTYPE;
diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix
index 4f8d57acc17b..7b2feaf84a80 100644
--- a/pkgs/os-specific/linux/kernel/patches.nix
+++ b/pkgs/os-specific/linux/kernel/patches.nix
@@ -148,4 +148,8 @@ rec {
         sha256 = "14rm1qr87p7a5prz8g5fwbpxzdp3ighj095x8rvhm8csm20wspyy";
       };
     };
+  ecryptfs_fix_mmap_bug =
+    { name = "ecryptfs_fix_mmap_bug";
+      patch = ./ecryptfs-fix-mmap-bug.patch;
+    };
 }