4.0-stable review patch.  If anyone has any objections, please let me know.

------------------

From: "Eric W. Biederman" <[email protected]>

commit f53e57975151f54ad8caa1b0ac8a78091cd5700a upstream.

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.

Signed-off-by: "Eric W. Biederman" <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 fs/namespace.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1518,7 +1518,7 @@ void __detach_mounts(struct dentry *dent
 
        namespace_lock();
        mp = lookup_mountpoint(dentry);
-       if (!mp)
+       if (IS_ERR_OR_NULL(mp))
                goto out_unlock;
 
        lock_mount_hash();


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to