Re: [PATCH Version 2 5/5] SUNRPC Fix rpc_verify_header error returns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2012-09-14 at 17:11 -0400, andros@xxxxxxxxxx wrote:
> From: Andy Adamson <andros@xxxxxxxxxx>
> 
> Signed-off-by: Andy Adamson <andros@xxxxxxxxxx>
> ---
>  net/sunrpc/clnt.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
> index a15b96c..f3136cc 100644
> --- a/net/sunrpc/clnt.c
> +++ b/net/sunrpc/clnt.c
> @@ -2005,7 +2005,8 @@ rpc_verify_header(struct rpc_task *task)
>  		dprintk("RPC: %5u %s: XDR representation not a multiple of"
>  		       " 4 bytes: 0x%x\n", task->tk_pid, __func__,
>  		       task->tk_rqstp->rq_rcv_buf.len);
> -		goto out_eio;
> +		error = -EIO;
> +		goto out_err;
>  	}
>  	if ((len -= 3) < 0)
>  		goto out_overflow;
> @@ -2014,6 +2015,7 @@ rpc_verify_header(struct rpc_task *task)
>  	if ((n = ntohl(*p++)) != RPC_REPLY) {
>  		dprintk("RPC: %5u %s: not an RPC reply: %x\n",
>  			task->tk_pid, __func__, n);
> +		error = -EIO;
>  		goto out_garbage;
>  	}
>  
> @@ -2032,7 +2034,8 @@ rpc_verify_header(struct rpc_task *task)
>  			dprintk("RPC: %5u %s: RPC call rejected, "
>  				"unknown error: %x\n",
>  				task->tk_pid, __func__, n);
> -			goto out_eio;
> +			error = -EIO;
> +			goto out_err;
>  		}
>  		if (--len < 0)
>  			goto out_overflow;
> @@ -2080,6 +2083,7 @@ rpc_verify_header(struct rpc_task *task)
>  	if (!(p = rpcauth_checkverf(task, p))) {
>  		dprintk("RPC: %5u %s: auth check failed\n",
>  				task->tk_pid, __func__);
> +		error = -EACCES;
>  		goto out_garbage;		/* bad verifier, retry */

Umm... This makes zero sense.

If the server is sending us dodgy verifiers then that is _not_ an access
error. Access errors are due to users doing something that they don't
have permission to do, whereas this is a server _bug_...

>  	}
>  	len = p - (__be32 *)iov->iov_base - 1;
> @@ -2132,8 +2136,6 @@ out_garbage:
>  out_retry:
>  		return ERR_PTR(-EAGAIN);
>  	}
> -out_eio:
> -	error = -EIO;
>  out_err:
>  	rpc_exit(task, error);
>  	dprintk("RPC: %5u %s: call failed with error %d\n", task->tk_pid,

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com
��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux