public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: lometsj@live.com, stfrench@microsoft.com, stable@vger.kernel.org
Subject: Re: [PATCH 5.15.y ] ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16()
Date: Wed, 3 Jan 2024 11:07:14 +0100	[thread overview]
Message-ID: <2024010307-itunes-reshuffle-2339@gregkh> (raw)
In-Reply-To: <CAKYAXd9kQaQYwBuc_=gMi2mKz3aggjxDvkbTCtYM_oJ5i0Rq4Q@mail.gmail.com>

On Wed, Jan 03, 2024 at 09:29:16AM +0900, Namjae Jeon wrote:
> From: Namjae Jeon <linkinjeon@kernel.org>
> 
> [ Upstream commit d10c77873ba1e9e6b91905018e29e196fd5f863d ]
> 
> If ->NameOffset/Length is bigger than ->CreateContextsOffset/Length,
> ksmbd_check_message doesn't validate request buffer it correctly.
> So slab-out-of-bounds warning from calling smb_strndup_from_utf16()
> in smb2_open() could happen. If ->NameLength is non-zero, Set the larger
> of the two sums (Name and CreateContext size) as the offset and length of
> the data area.
> 
> Reported-by: Yang Chaoming <lometsj@live.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> Signed-off-by: Steve French <stfrench@microsoft.com>
> ---
>  fs/ksmbd/smb2misc.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)

Now queued up, thanks.

greg k-h

      reply	other threads:[~2024-01-03 10:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03  0:29 [PATCH 5.15.y ] ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16() Namjae Jeon
2024-01-03 10:07 ` Greg KH [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=2024010307-itunes-reshuffle-2339@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=linkinjeon@kernel.org \
    --cc=lometsj@live.com \
    --cc=stable@vger.kernel.org \
    --cc=stfrench@microsoft.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox