Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Salvatore Bonaccorso <carnil@debian.org>
Cc: ZhaoLong Wang <wangzhaolong1@huawei.com>,
	stable@vger.kernel.org, sfrench@samba.org, kovalev@altlinux.org,
	"Mohamed Abuelfotoh, Hazem" <abuehaze@amazon.com>,
	Darren Kenny <darren.kenny@oracle.com>,
	Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Subject: Re: [PATCH 5.10 0/1] cifs: Fix stack-out-of-bounds in smb2_set_next_command()
Date: Tue, 20 Feb 2024 21:26:47 +0100	[thread overview]
Message-ID: <2024022000-serpent-luckiness-5c27@gregkh> (raw)
In-Reply-To: <ZcOdnBHA0OIB956t@eldamar.lan>

On Wed, Feb 07, 2024 at 04:11:24PM +0100, Salvatore Bonaccorso wrote:
> Hi,
> 
> On Wed, Feb 07, 2024 at 07:52:50PM +0800, ZhaoLong Wang wrote:
> > Hello,
> > 
> > I am sending this patch for inclusion in the stable tree, as it fixes
> > a critical stack-out-of-bounds bug in the cifs module related to the
> > `smb2_set_next_command()` function.
> > 
> > Problem Summary:
> > A problem was observed in the `statfs` system call for cifs, where it
> > failed with a "Resource temporarily unavailable" message. Further
> > investigation with KASAN revealed a stack-out-of-bounds error. The
> > root cause was a miscalculation of the size of the `smb2_query_info_req`
> > structure in the `SMB2_query_info_init()` function.
> > 
> > This situation arose due to a dependency on a prior commit
> > (`eb3e28c1e89b`) that replaced a 1-element array with a flexible
> > array member in the `smb2_query_info_req` structure. This commit was
> > not backported to the 5.10.y and 5.15.y stable branch, leading to an
> > incorrect size calculation after the backport of commit `33eae65c6f49`.
> > 
> > Fix Details:
> > The patch corrects the size calculation to ensure the correct length
> > is used when initializing the `smb2_query_info_req` structure. It has
> > been tested and confirmed to resolve the issue without introducing
> > any regressions.
> > 
> > Maybe the prior commit eb3e28c1e89b ("smb3: Replace smb2pdu 1-element
> > arrays with flex-arrays") should be backported to solve this problem
> > directly. The patch does not seem to conflict.
> 
> It looks there are several people working on the very same problem
> addint patches right now on top.
> 
> See as well https://lore.kernel.org/stable/c4c2f990-20cf-4126-95bd-d14c58e85042@oracle.com/
> 
> But this is already worked on and the proper solution is to only the
> eb3e28c1e89b backport included?
> 
> See as well
> https://lore.kernel.org/regressions/Zb5eL-AKcZpmvYSl@eldamar.lan/ and
> following.
> 
> And this needs to be done consistently for the 5.10.y and 5.15.y
> series.

And I'm totally confused here.

Can someone send me, on top of the patches that are in the current queue
(I'll push out a -rc series soon), for what needs to be done here?  Or,
should I just start reverting things?

lost,

greg k-h

      reply	other threads:[~2024-02-20 20:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 11:52 [PATCH 5.10 0/1] cifs: Fix stack-out-of-bounds in smb2_set_next_command() ZhaoLong Wang
2024-02-07 11:52 ` [PATCH 5.10 1/1] " ZhaoLong Wang
2024-02-07 15:11 ` [PATCH 5.10 0/1] " Salvatore Bonaccorso
2024-02-20 20:26   ` 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=2024022000-serpent-luckiness-5c27@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=abuehaze@amazon.com \
    --cc=carnil@debian.org \
    --cc=darren.kenny@oracle.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=kovalev@altlinux.org \
    --cc=sfrench@samba.org \
    --cc=stable@vger.kernel.org \
    --cc=wangzhaolong1@huawei.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