Skip to content

Commit 05e9cfb

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
NFSv4: Fix two infinite loops in the mount code
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> Cc: stable@vger.kernel.org
1 parent 864cf9b commit 05e9cfb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎fs/nfs/nfs4proc.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,11 +2290,12 @@ static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle,
22902290
switch (err) {
22912291
case 0:
22922292
case -NFS4ERR_WRONGSEC:
2293-
break;
2293+
goto out;
22942294
default:
22952295
err = nfs4_handle_exception(server, err, &exception);
22962296
}
22972297
} while (exception.retry);
2298+
out:
22982299
return err;
22992300
}
23002301

@@ -6229,11 +6230,12 @@ nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle,
62296230
case 0:
62306231
case -NFS4ERR_WRONGSEC:
62316232
case -NFS4ERR_NOTSUPP:
6232-
break;
6233+
goto out;
62336234
default:
62346235
err = nfs4_handle_exception(server, err, &exception);
62356236
}
62366237
} while (exception.retry);
6238+
out:
62376239
return err;
62386240
}
62396241

0 commit comments

Comments
 (0)