提交 403889c0 编写于 作者: K Kinglong Mee 提交者: Trond Myklebust

NFS: Fix bad checking of max taglen in callback request

The taglen should be checked with CB_OP_TAGLEN_MAXSZ directly.
Signed-off-by: NKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 45724e8a
...@@ -159,7 +159,7 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound ...@@ -159,7 +159,7 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound
if (unlikely(status != 0)) if (unlikely(status != 0))
return status; return status;
/* We do not like overly long tags! */ /* We do not like overly long tags! */
if (hdr->taglen > CB_OP_TAGLEN_MAXSZ - 12) { if (hdr->taglen > CB_OP_TAGLEN_MAXSZ) {
printk("NFS: NFSv4 CALLBACK %s: client sent tag of length %u\n", printk("NFS: NFSv4 CALLBACK %s: client sent tag of length %u\n",
__func__, hdr->taglen); __func__, hdr->taglen);
return htonl(NFS4ERR_RESOURCE); return htonl(NFS4ERR_RESOURCE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册