<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qemu/block/monitor, branch master</title>
<subtitle>QEMU development tree</subtitle>
<id>https://git.zx2c4.com/qemu/atom/block/monitor?h=master</id>
<link rel='self' href='https://git.zx2c4.com/qemu/atom/block/monitor?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/'/>
<updated>2024-08-08T21:02:23Z</updated>
<entry>
<title>nbd/server: CVE-2024-7409: Cap default max-connections to 100</title>
<updated>2024-08-08T21:02:23Z</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2024-08-06T18:53:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=c8a76dbd90c2f48df89b75bef74917f90a59b623'/>
<id>urn:sha1:c8a76dbd90c2f48df89b75bef74917f90a59b623</id>
<content type='text'>
Allowing an unlimited number of clients to any web service is a recipe
for a rudimentary denial of service attack: the client merely needs to
open lots of sockets without closing them, until qemu no longer has
any more fds available to allocate.

For qemu-nbd, we default to allowing only 1 connection unless more are
explicitly asked for (-e or --shared); this was historically picked as
a nice default (without an explicit -t, a non-persistent qemu-nbd goes
away after a client disconnects, without needing any additional
follow-up commands), and we are not going to change that interface now
(besides, someday we want to point people towards qemu-storage-daemon
instead of qemu-nbd).

But for qemu proper, and the newer qemu-storage-daemon, the QMP
nbd-server-start command has historically had a default of unlimited
number of connections, in part because unlike qemu-nbd it is
inherently persistent until nbd-server-stop.  Allowing multiple client
sockets is particularly useful for clients that can take advantage of
MULTI_CONN (creating parallel sockets to increase throughput),
although known clients that do so (such as libnbd's nbdcopy) typically
use only 8 or 16 connections (the benefits of scaling diminish once
more sockets are competing for kernel attention).  Picking a number
large enough for typical use cases, but not unlimited, makes it
slightly harder for a malicious client to perform a denial of service
merely by opening lots of connections withot progressing through the
handshake.

This change does not eliminate CVE-2024-7409 on its own, but reduces
the chance for fd exhaustion or unlimited memory usage as an attack
surface.  On the other hand, by itself, it makes it more obvious that
with a finite limit, we have the problem of an unauthenticated client
holding 100 fds opened as a way to block out a legitimate client from
being able to connect; thus, later patches will further add timeouts
to reject clients that are not making progress.

This is an INTENTIONAL change in behavior, and will break any client
of nbd-server-start that was not passing an explicit max-connections
parameter, yet expects more than 100 simultaneous connections.  We are
not aware of any such client (as stated above, most clients aware of
MULTI_CONN get by just fine on 8 or 16 connections, and probably cope
with later connections failing by relying on the earlier connections;
libvirt has not yet been passing max-connections, but generally
creates NBD servers with the intent for a single client for the sake
of live storage migration; meanwhile, the KubeSAN project anticipates
a large cluster sharing multiple clients [up to 8 per node, and up to
100 nodes in a cluster], but it currently uses qemu-nbd with an
explicit --shared=0 rather than qemu-storage-daemon with
nbd-server-start).

We considered using a deprecation period (declare that omitting
max-parameters is deprecated, and make it mandatory in 3 releases -
then we don't need to pick an arbitrary default); that has zero risk
of breaking any apps that accidentally depended on more than 100
connections, and where such breakage might not be noticed under unit
testing but only under the larger loads of production usage.  But it
does not close the denial-of-service hole until far into the future,
and requires all apps to change to add the parameter even if 100 was
good enough.  It also has a drawback that any app (like libvirt) that
is accidentally relying on an unlimited default should seriously
consider their own CVE now, at which point they are going to change to
pass explicit max-connections sooner than waiting for 3 qemu releases.
Finally, if our changed default breaks an app, that app can always
pass in an explicit max-parameters with a larger value.

It is also intentional that the HMP interface to nbd-server-start is
not changed to expose max-connections (any client needing to fine-tune
things should be using QMP).

Suggested-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
Message-ID: &lt;20240807174943.771624-12-eblake@redhat.com&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
[ericb: Expand commit message to summarize Dan's argument for why we
break corner-case back-compat behavior without a deprecation period]
Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
</content>
</entry>
<entry>
<title>stream: Allow users to request only format driver names in backing file format</title>
<updated>2024-01-26T10:16:58Z</updated>
<author>
<name>Peter Krempa</name>
<email>pkrempa@redhat.com</email>
</author>
<published>2023-12-05T17:14:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=72098a3aba7a7fccd7d1287c2ff88c1dac9b807d'/>
<id>urn:sha1:72098a3aba7a7fccd7d1287c2ff88c1dac9b807d</id>
<content type='text'>
Introduce a new flag 'backing-mask-protocol' for the block-stream QMP
command which instructs the internals to use 'raw' instead of the
protocol driver in case when a image is used without a dummy 'raw'
wrapper.

The flag is designed such that it can be always asserted by management
tools even when there isn't any update to backing files.

The flag will be used by libvirt so that the backing images still
reference the proper format even when libvirt will stop using the dummy
raw driver (raw driver with no other config). Libvirt needs this so that
the images stay compatible with older libvirt versions which didn't
expect that a protocol driver name can appear in the backing file format
field.

Signed-off-by: Peter Krempa &lt;pkrempa@redhat.com&gt;
Reviewed-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@yandex-team.ru&gt;
Message-ID: &lt;bbee9a0a59748a8893289bf8249f568f0d587e62.1701796348.git.pkrempa@redhat.com&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: remove AioContext locking</title>
<updated>2023-12-21T21:49:27Z</updated>
<author>
<name>Stefan Hajnoczi</name>
<email>stefanha@redhat.com</email>
</author>
<published>2023-12-05T18:20:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=b49f4755c7fa35ea6e17e5b52c1cdaef6b4aa21c'/>
<id>urn:sha1:b49f4755c7fa35ea6e17e5b52c1cdaef6b4aa21c</id>
<content type='text'>
This is the big patch that removes
aio_context_acquire()/aio_context_release() from the block layer and
affected block layer users.

There isn't a clean way to split this patch and the reviewers are likely
the same group of people, so I decided to do it in one patch.

Signed-off-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Reviewed-by: Paul Durrant &lt;paul@xen.org&gt;
Message-ID: &lt;20231205182011.1976568-7-stefanha@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Mark bdrv_skip_implicit_filters() and callers GRAPH_RDLOCK</title>
<updated>2023-11-07T18:14:19Z</updated>
<author>
<name>Kevin Wolf</name>
<email>kwolf@redhat.com</email>
</author>
<published>2023-10-27T15:53:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=430da832afb6a6eebb7c1726991c60fb06322d3e'/>
<id>urn:sha1:430da832afb6a6eebb7c1726991c60fb06322d3e</id>
<content type='text'>
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_skip_implicit_filters() need to hold a reader lock for the graph
because it calls bdrv_filter_child(), which accesses bs-&gt;file/backing.

Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Message-ID: &lt;20231027155333.420094-8-kwolf@redhat.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>qapi/block-core: use JobType for BlockJobInfo's type</title>
<updated>2023-10-31T17:20:29Z</updated>
<author>
<name>Fiona Ebner</name>
<email>f.ebner@proxmox.com</email>
</author>
<published>2023-10-31T13:54:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=d67c54d05fe05cf1b6a3b2cf36cc3832d2a0ce05'/>
<id>urn:sha1:d67c54d05fe05cf1b6a3b2cf36cc3832d2a0ce05</id>
<content type='text'>
In preparation to turn BlockJobInfo into a union with @type as the
discriminator. That requires it to be an enum. Even without that
requirement, it's nicer to have an enum instead of a str here.

No functional change is intended.

Signed-off-by: Fiona Ebner &lt;f.ebner@proxmox.com&gt;
Reviewed-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@yandex-team.ru&gt;
Reviewed-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-ID: &lt;20231031135431.393137-7-f.ebner@proxmox.com&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Mark bdrv_op_is_blocked() and callers GRAPH_RDLOCK</title>
<updated>2023-10-12T14:31:33Z</updated>
<author>
<name>Kevin Wolf</name>
<email>kwolf@redhat.com</email>
</author>
<published>2023-09-29T14:51:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=277f2007ce187a6ff467579cb016824f80a2be10'/>
<id>urn:sha1:277f2007ce187a6ff467579cb016824f80a2be10</id>
<content type='text'>
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_op_is_blocked() need to hold a reader lock for the graph
because it calls bdrv_get_device_or_node_name(), which accesses the
parents list of a node.

Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Message-ID: &lt;20230929145157.45443-18-kwolf@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Mark bdrv_first_blk() and bdrv_is_root_node() GRAPH_RDLOCK</title>
<updated>2023-10-12T14:31:33Z</updated>
<author>
<name>Kevin Wolf</name>
<email>kwolf@redhat.com</email>
</author>
<published>2023-09-29T14:51:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=2b3912f1350971fbc2c04d986a1d0c60ae757c78'/>
<id>urn:sha1:2b3912f1350971fbc2c04d986a1d0c60ae757c78</id>
<content type='text'>
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_first_blk() and bdrv_is_root_node() need to hold a reader lock
for the graph. These functions are the only functions in block-backend.c
that access the parent list of a node.

Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Message-ID: &lt;20230929145157.45443-5-kwolf@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block/dirty-bitmap: Clean up local variable shadowing</title>
<updated>2023-09-29T06:13:57Z</updated>
<author>
<name>Markus Armbruster</name>
<email>armbru@redhat.com</email>
</author>
<published>2023-09-21T12:13:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=6a0f7ff7dd2034fb167557f0444e1f1851dbd654'/>
<id>urn:sha1:6a0f7ff7dd2034fb167557f0444e1f1851dbd654</id>
<content type='text'>
Local variables shadowing other local variables or parameters make the
code needlessly hard to understand.  Tracked down with -Wshadow=local.
Clean up: rename both the pair of parameters and the pair of local
variables.  While there, move the local variables to function scope.

Suggested-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Message-ID: &lt;20230921121312.1301864-5-armbru@redhat.com&gt;
</content>
</entry>
<entry>
<title>meson: Replace softmmu_ss -&gt; system_ss</title>
<updated>2023-06-20T08:01:30Z</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2023-06-13T13:33:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=de6cd7599b518f0c832cc85980196ec02c129a86'/>
<id>urn:sha1:de6cd7599b518f0c832cc85980196ec02c129a86</id>
<content type='text'>
We use the user_ss[] array to hold the user emulation sources,
and the softmmu_ss[] array to hold the system emulation ones.
Hold the latter in the 'system_ss[]' array for parity with user
emulation.

Mechanical change doing:

  $ sed -i -e s/softmmu_ss/system_ss/g $(git grep -l softmmu_ss)

Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20230613133347.82210-10-philmd@linaro.org&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>block/monitor: Fix crash when executing HMP commit</title>
<updated>2023-04-25T13:11:57Z</updated>
<author>
<name>Wang Liang</name>
<email>wangliangzz@inspur.com</email>
</author>
<published>2023-04-24T10:39:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=8c1e8fb2e7fc2cbeb57703e143965a4cd3ad301a'/>
<id>urn:sha1:8c1e8fb2e7fc2cbeb57703e143965a4cd3ad301a</id>
<content type='text'>
hmp_commit() calls blk_is_available() from a non-coroutine context (and
in the main loop). blk_is_available() is a co_wrapper_mixed_bdrv_rdlock
function, and in the non-coroutine context it calls AIO_WAIT_WHILE(),
which crashes if the aio_context lock is not taken before.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1615
Signed-off-by: Wang Liang &lt;wangliangzz@inspur.com&gt;
Message-Id: &lt;20230424103902.45265-1-wangliangzz@126.com&gt;
Reviewed-by: Emanuele Giuseppe Esposito &lt;eesposit@redhat.com&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
</feed>
