From: Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Pavel Shilovsky <pshilov-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>,
linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 3/5] CIFS: Fix a possible memory corruption in push locks
Date: Tue, 06 Dec 2016 15:36:35 +0530 [thread overview]
Message-ID: <1481018795.4195.10.camel@redhat.com> (raw)
In-Reply-To: <1480972271-57692-4-git-send-email-pshilov-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>
On Mon, 2016-12-05 at 13:11 -0800, Pavel Shilovsky wrote:
> If maxBuf is not 0 but less than a size of SMB2 lock structure
> we can end up with a memory corruption.
>
> Cc: Stable <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
> Signed-off-by: Pavel Shilovsky <pshilov-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>
Acked-by: Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> fs/cifs/smb2file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c
> index f9e766f..b2aff0c 100644
> --- a/fs/cifs/smb2file.c
> +++ b/fs/cifs/smb2file.c
> @@ -260,7 +260,7 @@ smb2_push_mandatory_locks(struct cifsFileInfo
> *cfile)
> * and check it for zero before using.
> */
> max_buf = tlink_tcon(cfile->tlink)->ses->server->maxBuf;
> - if (!max_buf) {
> + if (max_buf < sizeof(struct smb2_lock_element)) {
> free_xid(xid);
> return -EINVAL;
> }
next prev parent reply other threads:[~2016-12-06 10:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 21:11 [PATCH v2 0/5] Stable fixes Pavel Shilovsky
[not found] ` <1480972271-57692-1-git-send-email-pshilov-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>
2016-12-05 21:11 ` [PATCH v2 1/5] CIFS: Decrease verbosity of ioctl call Pavel Shilovsky
2016-12-05 21:11 ` [PATCH v2 2/5] CIFS: Fix missing nls unload in smb2_reconnect() Pavel Shilovsky
2016-12-05 21:11 ` [PATCH v2 3/5] CIFS: Fix a possible memory corruption in push locks Pavel Shilovsky
[not found] ` <1480972271-57692-4-git-send-email-pshilov-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>
2016-12-06 10:06 ` Sachin Prabhu [this message]
2016-12-05 21:11 ` [PATCH v2 4/5] CIFS: Fix a possible memory corruption during reconnect Pavel Shilovsky
[not found] ` <1480972271-57692-5-git-send-email-pshilov-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>
2016-12-07 7:23 ` Sachin Prabhu
2016-12-05 21:11 ` [PATCH v2 5/5] CIFS: Fix a possible double locking of mutex " Pavel Shilovsky
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=1481018795.4195.10.camel@redhat.com \
--to=sprabhu-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pshilov-0li6OtcxBFHby3iVrkZq2A@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 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.