summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-01-19 11:48:45 -0600
committerSasha Levin <sasha.levin@oracle.com>2015-06-28 13:39:24 -0400
commit5d4bafa7be0843b63b6368ae49aaf0f5a941fc9f (patch)
tree2dd6ef33dc4cd5e47aed5f94613403d9f55d4309 /fs
parentf9c3700bef5c3f09ac0935e2f831ee182c23d9e8 (diff)
mnt: Fix the error check in __detach_mounts
[ Upstream commit f53e57975151f54ad8caa1b0ac8a78091cd5700a ] 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> Signed-off-by: Sasha Levin <sasha.levin@oracle.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 8b60287a488b..a19d05c4ebe5 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1490,7 +1490,7 @@ void __detach_mounts(struct dentry *dentry)
namespace_lock();
mp = lookup_mountpoint(dentry);
- if (!mp)
+ if (IS_ERR_OR_NULL(mp))
goto out_unlock;
lock_mount_hash();