From: Philipp Stanner <pstanner@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Andy Shevchenko" <andy.shevchenko@gmail.com>,
"Jens Axboe" <axboe@kernel.dk>, "Wu Hao" <hao.wu@intel.com>,
"Tom Rix" <trix@redhat.com>, "Moritz Fischer" <mdf@kernel.org>,
"Xu Yilun" <yilun.xu@intel.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Alvaro Karsz" <alvaro.karsz@solid-run.com>,
"Jason Wang" <jasowang@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
"Richard Cochran" <richardcochran@gmail.com>,
"Damien Le Moal" <dlemoal@kernel.org>,
"Hannes Reinecke" <hare@suse.de>,
"John Garry" <john.g.garry@oracle.com>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fpga@vger.kernel.org, linux-gpio@vger.kernel.org,
netdev@vger.kernel.org, linux-pci@vger.kernel.org,
virtualization@lists.linux.dev, stable@vger.kernel.org,
"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH v5 6/7] vdpa: solidrun: Fix UB bug with devres
Date: Fri, 30 Aug 2024 10:05:12 +0200 [thread overview]
Message-ID: <ff637570c16c6a15be414839ec4878e49ecd2350.camel@redhat.com> (raw)
In-Reply-To: <20240829110902-mutt-send-email-mst@kernel.org>
On Thu, 2024-08-29 at 11:10 -0400, Michael S. Tsirkin wrote:
> On Thu, Aug 29, 2024 at 04:49:50PM +0200, Philipp Stanner wrote:
> > On Thu, 2024-08-29 at 10:41 -0400, Michael S. Tsirkin wrote:
> > > On Thu, Aug 29, 2024 at 05:26:39PM +0300, Andy Shevchenko wrote:
> > > > On Thu, Aug 29, 2024 at 5:23 PM Michael S. Tsirkin
> > > > <mst@redhat.com>
> > > > wrote:
> > > > >
> > > > > On Thu, Aug 29, 2024 at 04:16:25PM +0200, Philipp Stanner
> > > > > wrote:
> > > > > > In psnet_open_pf_bar() and snet_open_vf_bar() a string
> > > > > > later
> > > > > > passed to
> > > > > > pcim_iomap_regions() is placed on the stack. Neither
> > > > > > pcim_iomap_regions() nor the functions it calls copy that
> > > > > > string.
> > > > > >
> > > > > > Should the string later ever be used, this, consequently,
> > > > > > causes
> > > > > > undefined behavior since the stack frame will by then have
> > > > > > disappeared.
> > > > > >
> > > > > > Fix the bug by allocating the strings on the heap through
> > > > > > devm_kasprintf().
> > > > > >
> > > > > > Cc: stable@vger.kernel.org # v6.3
> > > > > > Fixes: 51a8f9d7f587 ("virtio: vdpa: new SolidNET DPU
> > > > > > driver.")
> > > > > > Reported-by: Christophe JAILLET
> > > > > > <christophe.jaillet@wanadoo.fr>
> > > > > > Closes:
> > > > > > https://lore.kernel.org/all/74e9109a-ac59-49e2-9b1d-d825c9c9f891@wanadoo.fr/
> > > > > > Suggested-by: Andy Shevchenko <andy@kernel.org>
> > > > > > Signed-off-by: Philipp Stanner <pstanner@redhat.com>
> > > > >
> > > > > Post this separately, so I can apply?
> > > >
> > > > Don't you use `b4`? With it it as simple as
> > > >
> > > > b4 am -P 6 $MSG_ID_OF_THIS_SERIES
> > > >
> > > > --
> > > > With Best Regards,
> > > > Andy Shevchenko
> > >
> > > I can do all kind of things, but if it's posted as part of a
> > > patchset,
> > > it is not clear to me this has been tested outside of the
> > > patchset.
> > >
> >
> > Separating it from the series would lead to merge conflicts,
> > because
> > patch 7 depends on it.
> >
> > If you're responsible for vdpa in general I could send patches 6
> > and 7
> > separately to you.
> >
> > But number 7 depends on number 1, because pcim_iounmap_region()
> > needs
> > to be public. So if patches 1-5 enter through a different tree than
> > yours, that could be a problem.
> >
> >
> > P.
>
> Defer 1/7 until after the merge window, this is what is normally
> done.
1 cannot be deferred. Take a look what 1 does.
Your message is not comprehensible. Be so kind and write some more
sentences.
*What* is normally done? Sending patches? It's up to subsystem
maintainers to queue them for the right cycle.
> Adding new warnings is not nice, anyway.
What?
>
next prev parent reply other threads:[~2024-08-30 8:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 14:16 [PATCH v5 0/7] PCI: Remove pcim_iounmap_regions() Philipp Stanner
2024-08-29 14:16 ` [PATCH v5 1/7] PCI: Deprecate pcim_iounmap_regions() Philipp Stanner
2024-08-29 14:16 ` [PATCH v5 2/7] fpga/dfl-pci.c: Replace deprecated PCI functions Philipp Stanner
2024-08-29 14:16 ` [PATCH v5 3/7] block: mtip32xx: " Philipp Stanner
2024-08-29 14:16 ` [PATCH v5 4/7] gpio: " Philipp Stanner
2024-08-29 14:16 ` [PATCH v5 5/7] ethernet: cavium: " Philipp Stanner
2024-08-29 14:16 ` [PATCH v5 6/7] vdpa: solidrun: Fix UB bug with devres Philipp Stanner
2024-08-29 14:23 ` Michael S. Tsirkin
2024-08-29 14:26 ` Andy Shevchenko
2024-08-29 14:41 ` Michael S. Tsirkin
2024-08-29 14:49 ` Philipp Stanner
2024-08-29 15:10 ` Michael S. Tsirkin
2024-08-30 8:05 ` Philipp Stanner [this message]
2024-08-29 14:16 ` [PATCH v5 7/7] vdap: solidrun: Replace deprecated PCI functions Philipp Stanner
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=ff637570c16c6a15be414839ec4878e49ecd2350.camel@redhat.com \
--to=pstanner@redhat.com \
--cc=alvaro.karsz@solid-run.com \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=axboe@kernel.dk \
--cc=bhelgaas@google.com \
--cc=brgl@bgdev.pl \
--cc=christophe.jaillet@wanadoo.fr \
--cc=davem@davemloft.net \
--cc=dlemoal@kernel.org \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=hao.wu@intel.com \
--cc=hare@suse.de \
--cc=jasowang@redhat.com \
--cc=john.g.garry@oracle.com \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=stable@vger.kernel.org \
--cc=trix@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.com \
--cc=yilun.xu@intel.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;
as well as URLs for NNTP newsgroup(s).