aboutsummaryrefslogtreecommitdiffstats
path: root/fs/mount.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-01-15 17:49:25 +0000
committerSimon Shields <keepcalm444@gmail.com>2016-03-15 00:30:36 -0800
commitb9ff9ff44ca2b2b348a27081c8e0bb686dd094fa (patch)
tree10831feedaafed2ed72ec1fc63fa8a7586d696ca /fs/mount.h
parentb2332d884f24e8b74bf9d7e425e11ef5d02813ae (diff)
downloadkernel_samsung_smdk4412-b9ff9ff44ca2b2b348a27081c8e0bb686dd094fa.zip
kernel_samsung_smdk4412-b9ff9ff44ca2b2b348a27081c8e0bb686dd094fa.tar.gz
kernel_samsung_smdk4412-b9ff9ff44ca2b2b348a27081c8e0bb686dd094fa.tar.bz2
vfs: new internal helper: mnt_has_parent(mnt)
vfsmounts have ->mnt_parent pointing either to a different vfsmount or to itself; it's never NULL and termination condition in loops traversing the tree towards root is mnt == mnt->mnt_parent. At least one place (see the next patch) is confused about what's going on; let's add an explicit helper checking it right way and use it in all places where we need it. Not that there had been too many, but... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> (cherry picked from commit b2dba1af3c4157040303a76d25216b1713d333d0) CVE-2014-7970 BugLink: http://bugs.launchpad.net/bugs/1383356 Signed-off-by: Luis Henriques <luis.henriques@canonical.com> Acked-by: Stefan Bader <stefan.bader@canonical.com> Acked-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andy Whitcroft <apw@canonical.com> Change-Id: Iaa5ab510804f3b17fe71197b8919d663a416bf05
Diffstat (limited to 'fs/mount.h')
-rw-r--r--fs/mount.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/mount.h b/fs/mount.h
new file mode 100644
index 0000000..7890e49
--- /dev/null
+++ b/fs/mount.h
@@ -0,0 +1,6 @@
+#include <linux/mount.h>
+
+static inline int mnt_has_parent(struct vfsmount *mnt)
+{
+ return mnt != mnt->mnt_parent;
+}