aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-01-19 12:48:45 -0500
committerEric W. Biederman <ebiederm@xmission.com>2015-04-09 12:39:56 -0400
commitf53e57975151f54ad8caa1b0ac8a78091cd5700a (patch)
tree7322a985d8f37d229cdb6ef66ddae5bf218b9df6 /fs
parentce07d891a0891d3c0d0c2d73d577490486b809e1 (diff)
mnt: Fix the error check in __detach_mounts
lookup_mountpoint can return either NULL or an error value. Update the test in __detach_mounts to test for an error value to avoid pathological cases causing a NULL pointer dereferences. The callers of __detach_mounts should prevent it from ever being called on an unlinked dentry but don't take any chances. Cc: stable@vger.kernel.org Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 1894d1878dbc..e8f7f8c58c3c 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1516,7 +1516,7 @@ void __detach_mounts(struct dentry *dentry)
1516 1516
1517 namespace_lock(); 1517 namespace_lock();
1518 mp = lookup_mountpoint(dentry); 1518 mp = lookup_mountpoint(dentry);
1519 if (!mp) 1519 if (IS_ERR_OR_NULL(mp))
1520 goto out_unlock; 1520 goto out_unlock;
1521 1521
1522 lock_mount_hash(); 1522 lock_mount_hash();