From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 3/5] cifs: fix comment in validate_t2
Date: Thu, 31 Mar 2011 17:36:43 -0400 [thread overview]
Message-ID: <1301607405-4379-4-git-send-email-jlayton@redhat.com> (raw)
In-Reply-To: <1301607405-4379-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
The comment about checking the bcc is in the wrong place. Also make it
match kernel coding style.
Reported-and-acked-by: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
fs/cifs/cifssmb.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 4f5c6d0..655f24c 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -339,12 +339,13 @@ static int validate_t2(struct smb_t2_rsp *pSMB)
get_unaligned_le16(&pSMB->t2_rsp.DataOffset) > 1024)
goto vt2_err;
- /* check that bcc is at least as big as parms + data */
- /* check that bcc is less than negotiated smb buffer */
total_size = get_unaligned_le16(&pSMB->t2_rsp.ParameterCount);
if (total_size >= 512)
goto vt2_err;
+ /* check that bcc is at least as big as parms + data, and that it is
+ * less than negotiated smb buffer
+ */
total_size += get_unaligned_le16(&pSMB->t2_rsp.DataCount);
if (total_size > get_bcc(&pSMB->hdr) ||
total_size >= CIFSMaxBufSize + MAX_CIFS_HDR_SIZE)
--
1.7.4
next prev parent reply other threads:[~2011-03-31 21:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-31 21:36 [PATCH 0/5] cifs: various cleanups pointed out by David Howells Jeff Layton
[not found] ` <1301607405-4379-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-03-31 21:36 ` [PATCH 1/5] cifs: turn BCC into a static inlined function Jeff Layton
2011-03-31 21:36 ` [PATCH 2/5] cifs: remove unneeded variable initialization in cifs_reconnect_tcon Jeff Layton
[not found] ` <1301607405-4379-3-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-04-05 17:06 ` Steve French
[not found] ` <BANLkTin4Js462-nZcBcSYD6YO_1b9UEeRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-05 17:17 ` Jeff Layton
[not found] ` <20110405101729.27657db0-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-04-05 17:20 ` Steve French
[not found] ` <BANLkTi=pfFJKs3ZE1ogZrxpaJGf94RFxew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-05 17:28 ` Jeff Layton
2011-03-31 21:36 ` Jeff Layton [this message]
2011-03-31 21:36 ` [PATCH 4/5] cifs: clean up length checks in check2ndT2 Jeff Layton
2011-03-31 21:36 ` [PATCH 5/5] cifs: clean up various nits in unicode routines Jeff Layton
[not found] ` <1301607405-4379-6-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-04-05 17:23 ` Steve French
[not found] ` <20110405103209.75fb7da5-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-04-05 17:58 ` David Howells
[not found] ` <7828.1302026339-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-04-05 18:00 ` Steve French
2011-04-05 18:01 ` David Howells
[not found] ` <7882.1302026478-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-04-05 18:37 ` Jeff Layton
[not found] ` <BANLkTino1a1Wr55BCynPGK176Zbm5DPcXw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-05 17:32 ` Jeff Layton
2011-04-05 19:02 ` [PATCH] cifs: clean up various nits in unicode routines (try #2) Jeff Layton
[not found] ` <1302030157-5486-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-04-05 19:11 ` Steve French
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=1301607405-4379-4-git-send-email-jlayton@redhat.com \
--to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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