All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Shilovsky <pavel.shilovsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: David Disseldorp <ddiss-l3A5Bk7waGM@public.gmane.org>
Cc: Shu Wang <shuwang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Steve French <sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>,
	linux-cifs <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	samba-technical
	<samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org>
Subject: Re: [PATCH 2/2] SMB: fix validate negotiate info uninitialised memory use
Date: Wed, 25 Oct 2017 11:04:31 -0700	[thread overview]
Message-ID: <CAKywueRfuv9c=edNzA0iUO4s3_T=CWXhFZTvNVvEzd1Fb9PJuw@mail.gmail.com> (raw)
In-Reply-To: <20171020124938.9913-3-ddiss-l3A5Bk7waGM@public.gmane.org>

Looks good.

Acked-by: Pavel Shilovsky <pshilov-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>


Best regards,
Pavel Shilovskiy


2017-10-20 5:49 GMT-07:00 David Disseldorp via samba-technical
<samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org>:
> An undersize validate negotiate info server response causes the client
> to use uninitialised memory for struct validate_negotiate_info_rsp
> comparisons of Dialect, SecurityMode and/or Capabilities members.
>
> Link: https://bugzilla.samba.org/show_bug.cgi?id=13092
> Fixes: 7db0a6efdc3e ("SMB3: Work around mount failure when using SMB3 dialect to Macs")
> Signed-off-by: David Disseldorp <ddiss-l3A5Bk7waGM@public.gmane.org>
> ---
>  fs/cifs/smb2pdu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index 052ab5dee6b6..c836de2f79b2 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -727,7 +727,8 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
>                          rsplen);
>
>                 /* relax check since Mac returns max bufsize allowed on ioctl */
> -               if (rsplen > CIFSMaxBufSize)
> +               if ((rsplen > CIFSMaxBufSize)
> +                    || (rsplen < sizeof(struct validate_negotiate_info_rsp)))
>                         goto err_rsp_free;
>         }
>
> --
> 2.13.6
>
>

      parent reply	other threads:[~2017-10-25 18:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-20 10:20 [PATCH] SMB: fix memory leak in smb3_validate_negotiate shuwang
     [not found] ` <20171020102033.22936-1-shuwang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-20 12:49   ` David Disseldorp
     [not found]     ` <20171020124938.9913-1-ddiss-l3A5Bk7waGM@public.gmane.org>
2017-10-20 12:49       ` [PATCH 1/2] SMB: fix leak of validate negotiate info response buffer David Disseldorp
     [not found]         ` <20171020124938.9913-2-ddiss-l3A5Bk7waGM@public.gmane.org>
2017-10-21  2:49           ` Shu Wang
     [not found]             ` <61197467.18033621.1508554198404.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-22 14:16               ` David Disseldorp
2017-10-20 12:49       ` [PATCH 2/2] SMB: fix validate negotiate info uninitialised memory use David Disseldorp
     [not found]         ` <20171020124938.9913-3-ddiss-l3A5Bk7waGM@public.gmane.org>
2017-10-25 18:04           ` Pavel Shilovsky [this message]

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='CAKywueRfuv9c=edNzA0iUO4s3_T=CWXhFZTvNVvEzd1Fb9PJuw@mail.gmail.com' \
    --to=pavel.shilovsky-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=ddiss-l3A5Bk7waGM@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org \
    --cc=sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
    --cc=shuwang-H+wXaHxf7aLQT0dZR+AlfA@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.