diff options
author | Andy Adamson <andros@netapp.com> | 2012-11-27 10:34:19 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-12-12 15:36:02 -0500 |
commit | eb96d5c97b0825d542e9c4ba5e0a22b519355166 (patch) | |
tree | 62c98e2bdbcc7334a7043725d1fd81a589a75177 /fs/nfs/nfs3proc.c | |
parent | 620038f6d2304475dce800dc5c75fc335a19613a (diff) |
SUNRPC handle EKEYEXPIRED in call_refreshresult
Currently, when an RPCSEC_GSS context has expired or is non-existent
and the users (Kerberos) credentials have also expired or are non-existent,
the client receives the -EKEYEXPIRED error and tries to refresh the context
forever. If an application is performing I/O, or other work against the share,
the application hangs, and the user is not prompted to refresh/establish their
credentials. This can result in a denial of service for other users.
Users are expected to manage their Kerberos credential lifetimes to mitigate
this issue.
Move the -EKEYEXPIRED handling into the RPC layer. Try tk_cred_retry number
of times to refresh the gss_context, and then return -EACCES to the application.
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs3proc.c')
-rw-r--r-- | fs/nfs/nfs3proc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 69322096c325..70efb63b1e42 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -24,14 +24,14 @@ | |||
24 | 24 | ||
25 | #define NFSDBG_FACILITY NFSDBG_PROC | 25 | #define NFSDBG_FACILITY NFSDBG_PROC |
26 | 26 | ||
27 | /* A wrapper to handle the EJUKEBOX and EKEYEXPIRED error messages */ | 27 | /* A wrapper to handle the EJUKEBOX error messages */ |
28 | static int | 28 | static int |
29 | nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) | 29 | nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) |
30 | { | 30 | { |
31 | int res; | 31 | int res; |
32 | do { | 32 | do { |
33 | res = rpc_call_sync(clnt, msg, flags); | 33 | res = rpc_call_sync(clnt, msg, flags); |
34 | if (res != -EJUKEBOX && res != -EKEYEXPIRED) | 34 | if (res != -EJUKEBOX) |
35 | break; | 35 | break; |
36 | freezable_schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME); | 36 | freezable_schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME); |
37 | res = -ERESTARTSYS; | 37 | res = -ERESTARTSYS; |
@@ -44,7 +44,7 @@ nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) | |||
44 | static int | 44 | static int |
45 | nfs3_async_handle_jukebox(struct rpc_task *task, struct inode *inode) | 45 | nfs3_async_handle_jukebox(struct rpc_task *task, struct inode *inode) |
46 | { | 46 | { |
47 | if (task->tk_status != -EJUKEBOX && task->tk_status != -EKEYEXPIRED) | 47 | if (task->tk_status != -EJUKEBOX) |
48 | return 0; | 48 | return 0; |
49 | if (task->tk_status == -EJUKEBOX) | 49 | if (task->tk_status == -EJUKEBOX) |
50 | nfs_inc_stats(inode, NFSIOS_DELAY); | 50 | nfs_inc_stats(inode, NFSIOS_DELAY); |