提交 6f02dc88 编写于 作者: J Jeff Layton 提交者: Trond Myklebust

nfs: deny backchannel RPCs with an incorrect authflavor instead of dropping them

A drop should really only be done when the frame is malformed or we have
reason to think that there is some sort of DoS going on. When we get an
RPC with bad auth, we should send back an error instead.

Cc: Andy Adamson <William.Adamson@netapp.com>
Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 5fd23f7e
...@@ -458,7 +458,7 @@ check_gss_callback_principal(struct nfs_client *clp, struct svc_rqst *rqstp) ...@@ -458,7 +458,7 @@ check_gss_callback_principal(struct nfs_client *clp, struct svc_rqst *rqstp)
* pg_authenticate method for nfsv4 callback threads. * pg_authenticate method for nfsv4 callback threads.
* *
* The authflavor has been negotiated, so an incorrect flavor is a server * The authflavor has been negotiated, so an incorrect flavor is a server
* bug. Drop packets with incorrect authflavor. * bug. Deny packets with incorrect authflavor.
* *
* All other checking done after NFS decoding where the nfs_client can be * All other checking done after NFS decoding where the nfs_client can be
* found in nfs4_callback_compound * found in nfs4_callback_compound
...@@ -468,12 +468,12 @@ static int nfs_callback_authenticate(struct svc_rqst *rqstp) ...@@ -468,12 +468,12 @@ static int nfs_callback_authenticate(struct svc_rqst *rqstp)
switch (rqstp->rq_authop->flavour) { switch (rqstp->rq_authop->flavour) {
case RPC_AUTH_NULL: case RPC_AUTH_NULL:
if (rqstp->rq_proc != CB_NULL) if (rqstp->rq_proc != CB_NULL)
return SVC_DROP; return SVC_DENIED;
break; break;
case RPC_AUTH_GSS: case RPC_AUTH_GSS:
/* No RPC_AUTH_GSS support yet in NFSv4.1 */ /* No RPC_AUTH_GSS support yet in NFSv4.1 */
if (svc_is_backchannel(rqstp)) if (svc_is_backchannel(rqstp))
return SVC_DROP; return SVC_DENIED;
} }
return SVC_OK; return SVC_OK;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册