linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: "J. Bruce Fields" <bfields@redhat.com>,
	stable@vger.kernel.org, Benny Halevy <bhalevy@primarydata.com>
Subject: [PATCH 1/5] nfsd4: buffer-length check for SUPPATTR_EXCLCREAT
Date: Mon, 24 Feb 2014 17:08:43 -0500	[thread overview]
Message-ID: <1393279727-29437-2-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1393279727-29437-1-git-send-email-bfields@redhat.com>

From: "J. Bruce Fields" <bfields@redhat.com>

This was an omission from 8c18f2052e756e7d5dea712fc6e7ed70c00e8a39
"nfsd41: SUPPATTR_EXCLCREAT attribute".

Cc: stable@vger.kernel.org
Cc: Benny Halevy <bhalevy@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/nfsd/nfs4xdr.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 63f2395..668bfe1 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2483,6 +2483,8 @@ out_acl:
 			goto out;
 	}
 	if (bmval2 & FATTR4_WORD2_SUPPATTR_EXCLCREAT) {
+		if ((buflen -= 16) < 0)
+			goto out_resource;
 		WRITE32(3);
 		WRITE32(NFSD_SUPPATTR_EXCLCREAT_WORD0);
 		WRITE32(NFSD_SUPPATTR_EXCLCREAT_WORD1);
-- 
1.7.9.5


  reply	other threads:[~2014-02-24 22:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-24 22:08 nfsd xdr fixes J. Bruce Fields
2014-02-24 22:08 ` J. Bruce Fields [this message]
2014-02-25 18:37   ` [PATCH 1/5] nfsd4: buffer-length check for SUPPATTR_EXCLCREAT Benny Halevy
2014-02-24 22:08 ` [PATCH 2/5] nfsd4: leave reply buffer space for failed setattr J. Bruce Fields
2014-02-24 22:08 ` [PATCH 3/5] nfsd4: fix test_stateid error reply encoding J. Bruce Fields
2014-02-24 22:08 ` [PATCH 4/5] nfsd4: session needs room for following op to error out J. Bruce Fields
2014-02-24 22:08 ` [PATCH 5/5] nfsd4: make set of large acl return efbig, not resource J. Bruce Fields

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=1393279727-29437-2-git-send-email-bfields@redhat.com \
    --to=bfields@redhat.com \
    --cc=bhalevy@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).