]> git.hungrycats.org Git - linux/commitdiff
NFSv4: Fix two infinite loops in the mount code
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 27 Mar 2012 22:13:02 +0000 (18:13 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Apr 2012 17:32:22 +0000 (10:32 -0700)
commit 05e9cfb408b24debb3a85fd98edbfd09dd148881 upstream.

We can currently loop forever in nfs4_lookup_root() and in
nfs41_proc_secinfo_no_name(), if the first iteration returns a
NFS4ERR_DELAY or something else that causes exception.retry to get
set.

Reported-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c

index 78a6fe8ad3fdd56bab63a93aadb9ff08d56ba2c2..9996d54102b644f003821bb489a32e185c1200c1 100644 (file)
@@ -2249,11 +2249,12 @@ static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
                switch (err) {
                case 0:
                case -NFS4ERR_WRONGSEC:
-                       break;
+                       goto out;
                default:
                        err = nfs4_handle_exception(server, err, &exception);
                }
        } while (exception.retry);
+out:
        return err;
 }
 
@@ -6068,11 +6069,12 @@ nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle,
                case 0:
                case -NFS4ERR_WRONGSEC:
                case -NFS4ERR_NOTSUPP:
-                       break;
+                       goto out;
                default:
                        err = nfs4_handle_exception(server, err, &exception);
                }
        } while (exception.retry);
+out:
        return err;
 }