summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2011-04-13 14:31:28 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-04-13 15:12:22 -0400
commitd1a8016a2d1e75021ecc8715e3c81442d7218eb6 (patch)
treeb2aaef4f3aa4566765c6e3c743c74929a7790af2 /net
parent79a48a1f5d99ab66cf83d2d5d805e7a0e08452ed (diff)
downloadlwn-d1a8016a2d1e75021ecc8715e3c81442d7218eb6.tar.gz
lwn-d1a8016a2d1e75021ecc8715e3c81442d7218eb6.zip
NFS: Fix infinite loop in gss_create_upcall()
There can be an infinite loop if gss_create_upcall() is called without the userspace program running. To prevent this, we return -EACCES if we notice that pipe_version hasn't changed (indicating that the pipe has not been opened). Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index f3914d0c5079..339ba64cce1e 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -520,7 +520,7 @@ gss_refresh_upcall(struct rpc_task *task)
warn_gssd();
task->tk_timeout = 15*HZ;
rpc_sleep_on(&pipe_version_rpc_waitqueue, task, NULL);
- return 0;
+ return -EAGAIN;
}
if (IS_ERR(gss_msg)) {
err = PTR_ERR(gss_msg);
@@ -563,10 +563,12 @@ retry:
if (PTR_ERR(gss_msg) == -EAGAIN) {
err = wait_event_interruptible_timeout(pipe_version_waitqueue,
pipe_version >= 0, 15*HZ);
+ if (pipe_version < 0) {
+ warn_gssd();
+ err = -EACCES;
+ }
if (err)
goto out;
- if (pipe_version < 0)
- warn_gssd();
goto retry;
}
if (IS_ERR(gss_msg)) {