All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kinglong Mee <kinglongmee@gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>,
	Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	Kinglong Mee <kinglongmee@gmail.com>
Subject: [PATCH 2/4] nfs: use NFS4_MAXTAGLEN for cb_taglen checking
Date: Sat, 28 Mar 2015 23:49:44 +0800	[thread overview]
Message-ID: <5516CD98.70706@gmail.com> (raw)
In-Reply-To: <5516CCDB.4020509@gmail.com>

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfs/callback_xdr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 1737c2e..ea6d4de 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -18,8 +18,7 @@
 #include "internal.h"
 #include "nfs4session.h"
 
-#define CB_OP_TAGLEN_MAXSZ	(512)
-#define CB_OP_HDR_RES_MAXSZ	(2 + CB_OP_TAGLEN_MAXSZ)
+#define CB_OP_HDR_RES_MAXSZ	(2 + NFS4_MAXTAGLEN)
 #define CB_OP_GETATTR_BITMAP_MAXSZ	(4)
 #define CB_OP_GETATTR_RES_MAXSZ	(CB_OP_HDR_RES_MAXSZ + \
 				CB_OP_GETATTR_BITMAP_MAXSZ + \
@@ -157,7 +156,7 @@ static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound
 	if (unlikely(status != 0))
 		return status;
 	/* We do not like overly long tags! */
-	if (hdr->taglen > CB_OP_TAGLEN_MAXSZ) {
+	if (hdr->taglen > NFS4_MAXTAGLEN) {
 		printk("NFS: NFSv4 CALLBACK %s: server sents tag of length %u\n",
 				__func__, hdr->taglen);
 		return htonl(NFS4ERR_RESOURCE);
-- 
2.3.4


  parent reply	other threads:[~2015-03-28 15:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-28 15:46 [PATCH 0/4] Define common macro NFS4_MAXTAGLEN for nfs/nfsd Kinglong Mee
2015-03-28 15:48 ` [PATCH 1/4] nfs: define NFS4_MAXTAGLEN to OPAQUE limits Kinglong Mee
2015-04-29 19:56   ` J. Bruce Fields
2015-03-28 15:49 ` Kinglong Mee [this message]
2015-03-28 15:50 ` [PATCH 3/4] nfsd: use NFS4_MAXTAGLEN for taglen checking Kinglong Mee
2015-03-28 15:51 ` [PATCH 4/4] nfsd: use NFS4_MAXTAGLEN defined in include/linux/nfs4.h Kinglong Mee
2015-04-29 20:25 ` [PATCH 0/4] Define common macro NFS4_MAXTAGLEN for nfs/nfsd J. Bruce Fields
2015-04-29 20:28   ` Chuck Lever
2015-04-29 20:29   ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5516CD98.70706@gmail.com \
    --to=kinglongmee@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.