From: Kevin Wolf <kwolf@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-block@nongnu.org, richard.henderson@linaro.org,
hreitz@redhat.com, eblake@redhat.com, stefanha@redhat.com,
qemu-devel@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [PULL 4/4] block: Parse filenames only when explicitly requested
Date: Thu, 4 Jul 2024 13:29:35 +0200 [thread overview]
Message-ID: <ZoaHn87kcpnwFcIU@redhat.com> (raw)
In-Reply-To: <358eddb4-7d14-4a6d-b360-24bb416b901e@tls.msk.ru>
Am 03.07.2024 um 23:16 hat Michael Tokarev geschrieben:
> 02.07.2024 19:39, Kevin Wolf wrote:
> > When handling image filenames from legacy options such as -drive or from
> > tools, these filenames are parsed for protocol prefixes, including for
> > the json:{} pseudo-protocol.
> >
> > This behaviour is intended for filenames that come directly from the
> > command line and for backing files, which may come from the image file
> > itself. Higher level management tools generally take care to verify that
> > untrusted images don't contain a bad (or any) backing file reference;
> > 'qemu-img info' is a suitable tool for this.
> >
> > However, for other files that can be referenced in images, such as
> > qcow2 data files or VMDK extents, the string from the image file is
> > usually not verified by management tools - and 'qemu-img info' wouldn't
> > be suitable because in contrast to backing files, it already opens these
> > other referenced files. So here the string should be interpreted as a
> > literal local filename. More complex configurations need to be specified
> > explicitly on the command line or in QMP.
> >
> > This patch changes bdrv_open_inherit() so that it only parses filenames
> > if a new parameter parse_filename is true. It is set for the top level
> > in bdrv_open(), for the file child and for the backing file child. All
> > other callers pass false and disable filename parsing this way.
>
> I'm attaching backports of this change to 8.2 and 7.2 series.
>
> Please check if the resulting backports are correct, or if they're needed
> in the first place. Note: 7.2 lacks quite some locking in this area, eg
> v8.0.0-2069-g8394c35ee148 "block: Fix AioContext locking in bdrv_open_child()"
> v8.2.0-rc0-59-g6bc0bcc89f84 "block: Fix deadlocks in bdrv_graph_wrunlock()".
Apart from minor style differences, your 7.2 backport is a perfect match
of the RHEL 9.2 backport which I already reviewed downstream. The 8.2
patch is a bit different from the RHEL 9.4 one because we backported the
final bits of the multiqueue work, but the differences make sense for
upstream QEMU 8.2.
So both patches look good to me.
Kevin
next prev parent reply other threads:[~2024-07-04 11:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 16:39 [PULL 0/4] Block layer patches (CVE-2024-4467) Kevin Wolf
2024-07-02 16:39 ` [PULL 1/4] qcow2: Don't open data_file with BDRV_O_NO_IO Kevin Wolf
2024-07-02 16:39 ` [PULL 2/4] iotests/244: Don't store data-file with protocol in image Kevin Wolf
2024-07-02 16:39 ` [PULL 3/4] iotests/270: Don't store data-file with json: prefix " Kevin Wolf
2024-07-02 16:39 ` [PULL 4/4] block: Parse filenames only when explicitly requested Kevin Wolf
2024-07-03 21:16 ` Michael Tokarev
2024-07-04 11:29 ` Kevin Wolf [this message]
2024-07-04 11:34 ` Michael Tokarev
2024-07-03 18:26 ` [PULL 0/4] Block layer patches (CVE-2024-4467) Richard Henderson
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=ZoaHn87kcpnwFcIU@redhat.com \
--to=kwolf@redhat.com \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=stefanha@redhat.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).