提交 ae82a8d0 编写于 作者: M Mi Jinlong 提交者: J. Bruce Fields

nfsd41: check the size of request

Check in SEQUENCE that the request doesn't exceed maxreq_sz for the
given session.
Signed-off-by: NMi Jinlong <mijinlong@cn.fujitsu.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 1b74c25b
......@@ -1762,6 +1762,14 @@ static bool nfsd4_session_too_many_ops(struct svc_rqst *rqstp, struct nfsd4_sess
return args->opcnt > session->se_fchannel.maxops;
}
static bool nfsd4_request_too_big(struct svc_rqst *rqstp,
struct nfsd4_session *session)
{
struct xdr_buf *xb = &rqstp->rq_arg;
return xb->len > session->se_fchannel.maxreq_sz;
}
__be32
nfsd4_sequence(struct svc_rqst *rqstp,
struct nfsd4_compound_state *cstate,
......@@ -1794,6 +1802,10 @@ nfsd4_sequence(struct svc_rqst *rqstp,
if (nfsd4_session_too_many_ops(rqstp, session))
goto out;
status = nfserr_req_too_big;
if (nfsd4_request_too_big(rqstp, session))
goto out;
status = nfserr_badslot;
if (seq->slotid >= session->se_fchannel.maxreqs)
goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册