summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-hierofalcon-4.1/dcache-CVE-2015-2925.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-hierofalcon-4.1/dcache-CVE-2015-2925.patch')
-rw-r--r--recipes-kernel/linux/linux-hierofalcon-4.1/dcache-CVE-2015-2925.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-hierofalcon-4.1/dcache-CVE-2015-2925.patch b/recipes-kernel/linux/linux-hierofalcon-4.1/dcache-CVE-2015-2925.patch
new file mode 100644
index 0000000..a6a8449
--- /dev/null
+++ b/recipes-kernel/linux/linux-hierofalcon-4.1/dcache-CVE-2015-2925.patch
@@ -0,0 +1,70 @@
1From 6f4e45e35c02fd23589a62aab0dc84286cc1302c Mon Sep 17 00:00:00 2001
2From: "Eric W. Biederman" <ebiederm@xmission.com>
3Date: Sat, 15 Aug 2015 13:36:12 -0500
4Subject: dcache: Handle escaped paths in prepend_path
5
6commit cde93be45a8a90d8c264c776fab63487b5038a65 upstream.
7
8A rename can result in a dentry that by walking up d_parent
9will never reach it's mnt_root. For lack of a better term
10I call this an escaped path.
11
12prepend_path is called by four different functions __d_path,
13d_absolute_path, d_path, and getcwd.
14
15__d_path only wants to see paths are connected to the root it passes
16in. So __d_path needs prepend_path to return an error.
17
18d_absolute_path similarly wants to see paths that are connected to
19some root. Escaped paths are not connected to any mnt_root so
20d_absolute_path needs prepend_path to return an error greater
21than 1. So escaped paths will be treated like paths on lazily
22unmounted mounts.
23
24getcwd needs to prepend "(unreachable)" so getcwd also needs
25prepend_path to return an error.
26
27d_path is the interesting hold out. d_path just wants to print
28something, and does not care about the weird cases. Which raises
29the question what should be printed?
30
31Given that <escaped_path>/<anything> should result in -ENOENT I
32believe it is desirable for escaped paths to be printed as empty
33paths. As there are not really any meaninful path components when
34considered from the perspective of a mount tree.
35
36So tweak prepend_path to return an empty path with an new error
37code of 3 when it encounters an escaped path.
38
39Fixes CVE-2015-2925.
40Upstream-Status: Backport
41
42Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
43Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
44Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
45Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
46---
47 fs/dcache.c | 7 +++++++
48 1 file changed, 7 insertions(+)
49
50diff --git a/fs/dcache.c b/fs/dcache.c
51index 5d03eb0..2e8ddc1 100644
52--- a/fs/dcache.c
53+++ b/fs/dcache.c
54@@ -2923,6 +2923,13 @@ restart:
55
56 if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
57 struct mount *parent = ACCESS_ONCE(mnt->mnt_parent);
58+ /* Escaped? */
59+ if (dentry != vfsmnt->mnt_root) {
60+ bptr = *buffer;
61+ blen = *buflen;
62+ error = 3;
63+ break;
64+ }
65 /* Global root? */
66 if (mnt != parent) {
67 dentry = ACCESS_ONCE(mnt->mnt_mountpoint);
68--
69cgit v0.12
70