Re: [PATCH for-9.1 6/9] block/nbd: Use URI parsing code from glib

2024-09-23 Thread Eric Blake
specific semantics, which may not match path name traversal semantics). Looks like we need to report a bug to glib, and/or see if glib's URI functions have a flag for turning off this unwanted munging. Or we may just want to document this corner case change as intentional. -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH v1 01/14] s390x/s390-virtio-ccw: don't crash on weird RAM sizes

2024-09-12 Thread Eric Farman
aphic -m 1234K > qemu-system-s390x: ram size must be multiples of 1 MiB > > Signed-off-by: David Hildenbrand > --- > hw/s390x/s390-virtio-ccw.c | 11 +++ > 1 file changed, 11 insertions(+) TIL. Thanks David! Reviewed-by: Eric Farman

Re: [PATCH v2 14/48] include/hw/s390x: replace assert(false) with g_assert_not_reached()

2024-09-12 Thread Eric Farman
Huth > Signed-off-by: Pierrick Bouvier > --- > include/hw/s390x/cpu-topology.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Farman

Re: [PATCH 1/2] qapi: Drop "with an explanation" from error descriptions

2024-09-12 Thread Eric Blake
rmbruster > --- > qapi/block-core.json | 11 +-- > 1 file changed, 5 insertions(+), 6 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH 2/2] qapi/block-core: Drop drive-backup's "Any other error" documentation

2024-09-12 Thread Eric Blake
rror". > > Not useful. Drop. > > Signed-off-by: Markus Armbruster > --- > qapi/block-core.json | 1 - > 1 file changed, 1 deletion(-) Reviewed-by: Eric Blake > > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 82f59a7758..485388be32 100644 > -

Re: [PATCH 01/39] docs/spin: replace assert(0) with g_assert_not_reached()

2024-09-11 Thread Eric Blake
On Wed, Sep 11, 2024 at 07:33:59AM GMT, Eric Blake wrote: > On Tue, Sep 10, 2024 at 03:15:28PM GMT, Pierrick Bouvier wrote: > > Signed-off-by: Pierrick Bouvier > > --- > > A general suggestion for the entire series: please use a commit > message that explains why th

Re: [PATCH 01/39] docs/spin: replace assert(0) with g_assert_not_reached()

2024-09-11 Thread Eric Blake
e" that can be copy-pasted into all the other commits is better than nothing, although a self-contained message is best. Maybe: This patch is part of a series that moves towards a consistent use of g_assert_not_reached() rather than an ad hoc mix of different assertion mechanisms. -- Eric

Re: [Bug Report] smmuv3 event 0x10 report when running virtio-blk-pci

2024-09-11 Thread Eric Auger
tem-aarch64: virtio_bus_start_ioeventfd: failed. Fallback to userspace (slower). Only happens with maxcpus=3. Note the virtio-blk-pci is not protected by the vIOMMU in your case. Thanks Eric > >> ? >> >> My suspicion is that this will have started happening now that >>

Re: [Bug Report] smmuv3 event 0x10 report when running virtio-blk-pci

2024-09-09 Thread Eric Auger
ble to reproduce and effectively the maxcpus kernel option is triggering the issue. It works without. I will come back to you asap. Eric > >> ? >> >> My suspicion is that this will have started happening now that >> we expose an SMMU with two-stage translation support t

Re: [PATCH for-9.2] kvm: Use 'unsigned long' for request argument in functions wrapping ioctl()

2024-08-29 Thread Eric Blake
see also the > review thread on the previous version of the patch: > https://lore.kernel.org/qemu-devel/CAFEAcA8TRQdj33Ycm=xzmuuunapaxvgedexfs+3ycg6klnp...@mail.gmail.com/ > > Since this doesn't actually cause any incorrect behaviour this > is obviously for-9.2 material. >

Re: [PATCH] chardev: allow specifying finer-grained reconnect timeouts

2024-08-29 Thread Eric Blake
es in QAPI where we want mutual exclusion (we mark both fields optional, but expect the user to provide exactly one or get an error), that I wonder if it is worth making it a first-class construct in QAPI (maybe I'm spoiled by the OneOf designation[1] in protobuf[2] used by gRPC[3] in kubernet

[PATCH] sysbus-fdt: DT node generation for tegra234-mgbe assigned device

2024-08-29 Thread Eric Auger
mismatch is crudely handled in the VFIO code at the moment. In case you use a more recent BSP, you should remove that. Signed-off-by: Eric Auger --- The tegra234 mgbe reset module is requested to test. It can be found at: https://github.com/eauger/linux/tree/tegra234-mgbe-reset-module-rfc The guest

[PULL for-9.1-rc4 0/1] NBD patches for 2024-08-26

2024-08-26 Thread Eric Blake
-7409 (use-after-free on nbd-server-stop) ---- Eric Blake (1): nbd/server: CVE-2024-7409: Avoid use-after-free when closing server blockdev-nbd.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.46.0

[PULL 1/1] nbd/server: CVE-2024-7409: Avoid use-after-free when closing server

2024-08-26 Thread Eric Blake
}\'') > > def nbd_list(): > while 1: > os.system('/path/to/build/qemu-nbd -L -k /tmp/nbd-sock') > > def test(): > sst = Thread(target=start_stop) > sst.start() > nlt = Thread(target=nbd_list) > nlt.start() > >

[PATCH for-9.1] nbd/server: CVE-2024-7409: Avoid use-after-free when closing server

2024-08-22 Thread Eric Blake
}\'') > > def nbd_list(): > while 1: > os.system('/path/to/build/qemu-nbd -L -k /tmp/nbd-sock') > > def test(): > sst = Thread(target=start_stop) > sst.start() > nlt = Thread(target=nbd_list) > nlt.start() > >

Re: [PATCH 0/4] hw/arm: Enable 'nested' SMMU in virt, sbsa-ref

2024-08-19 Thread Eric Auger
r virt-9.2 and later; > patch 2 is a trivial "missing comment update" change; patches > 3 and 4 are the board changes. > > Enabling nested support should be transparent to guests, which > will only enable stage 2 if they actually want it. > > thanks > -- PMM For the

Re: [PATCH v1 1/1] block/file-posix: Avoid maybe-uninitialized warning

2024-08-14 Thread Eric Blake
gt; ../qemu/block/file-posix.c:1401:20: note: ‘zoned’ was declared here > 1401 | BlockZoneModel zoned; > |^ > cc1: all warnings being treated as errors > > Signed-off-by: Edgar E. Iglesias > --- > block/file-posix.c | 2 +- > 1 file changed

Re: [PATCH-for-9.1] docs: Fix some typos (found by typos) and grammar issues

2024-08-13 Thread Eric Auger
On 8/13/24 14:56, Stefan Weil via wrote: > Fix the misspellings of "overriden" also in code comments. > > Signed-off-by: Stefan Weil Reviewed-by: Eric Auger Eric > --- > docs/devel/migration/uadk-compression.rst | 4 ++-- > docs/interop/qemu-ga.rst

Re: [PATCH] docs: Tweak location of qemu nbd extensions

2024-08-13 Thread Eric Blake
On Sat, Aug 03, 2024 at 03:18:35PM GMT, Wouter Verhelst wrote: > On Fri, Aug 02, 2024 at 08:36:43AM -0500, Eric Blake wrote: > > Upstream QEMU is moving the location of its NBD docs, as of its commit > > [1]. Instead of pointing to the raw git source file, point to the &g

Re: [PULL 5/5] nbd/server: CVE-2024-7409: Close stray clients at server-stop

2024-08-12 Thread Eric Blake
On Sun, Aug 11, 2024 at 11:02:52AM GMT, Michael Tokarev wrote: > 09.08.2024 00:53, Eric Blake wrote: > > A malicious client can attempt to connect to an NBD server, and then > > intentionally delay progress in the handshake, including if it does > > not know the TLS secrets.

Re: [PATCH 03/13] tests/avocado/intel_iommu.py: increase timeout

2024-08-12 Thread Eric Auger
; dnf download all the repodata, 4 times over. >> > Exactly. > >> If the intention was to test networking, then replace this with >> something that doesn't have to download 100's of MB of data, then >> see what kind of running time we get before increasing any

[PATCH 2/2] nbd/server: Allow users to adjust handshake limit in QMP

2024-08-09 Thread Eric Blake
d unlike the command line, machines don't have problems generating longer spellings. Signed-off-by: Eric Blake --- qapi/block-export.json | 10 ++ include/block/nbd.h| 6 +++--- block/monitor/block-hmp-cmds.c | 4 ++-- blockdev-nbd.c | 26 +

[PATCH for-9.2 0/2] NBD: tune handshake timeout

2024-08-09 Thread Eric Blake
prefer to keep the qemu-nbd command-line spelling shorter. But I'm open to any arguments on why the names should be the same, or on any other better spellings to expose to the user. Eric Blake (2): qemu-nbd: Allow users to adjust handshake limit nbd/server: Allow users to adjust handshake

[PATCH 1/2] qemu-nbd: Allow users to adjust handshake limit

2024-08-09 Thread Eric Blake
t; this is because typing a longer command-line name is undesirable and there is sufficient --help text to document the units. Signed-off-by: Eric Blake --- docs/tools/qemu-nbd.rst | 5 + qemu-nbd.c | 41 ++--- 2 files changed, 31 insertions(+), 15

Re: [PATCH 4/6] qapi/introspect: Supply missing member documentation

2024-08-09 Thread Eric Blake
> qapi/introspect.json | 16 > qapi/pragma.json | 1 - > 2 files changed, 16 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

[PULL 5/5] nbd/server: CVE-2024-7409: Close stray clients at server-stop

2024-08-08 Thread Eric Blake
E-2024-7409 CC: qemu-sta...@nongnu.org Signed-off-by: Eric Blake Message-ID: <20240807174943.771624-14-ebl...@redhat.com> Reviewed-by: Daniel P. Berrangé --- blockdev-nbd.c | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/blockdev-nbd.c

[PULL 1/5] nbd: Minor style and typo fixes

2024-08-08 Thread Eric Blake
Touch up a comment with the wrong type name, and an over-long line, both noticed while working on upcoming patches. Signed-off-by: Eric Blake Message-ID: <20240807174943.771624-10-ebl...@redhat.com> Reviewed-by: Daniel P. Berrangé --- nbd/server.c | 2 +- qemu-nbd.c | 3 ++- 2 files c

[PULL 0/5] NBD: fix CVE-2024-7409 for 9.1

2024-08-08 Thread Eric Blake
oiting nbd-server-stop ---- Eric Blake (5): nbd: Minor style and typo fixes nbd/server: Plumb in new args to nbd_client_add() nbd/server: CVE-2024-7409: Cap default max-connections to 100 nbd/server: CVE-2024-7409

[PULL 3/5] nbd/server: CVE-2024-7409: Cap default max-connections to 100

2024-08-08 Thread Eric Blake
une things should be using QMP). Suggested-by: Daniel P. Berrangé Signed-off-by: Eric Blake Message-ID: <20240807174943.771624-12-ebl...@redhat.com> Reviewed-by: Daniel P. Berrangé [ericb: Expand commit message to summarize Dan's argument for why we break corner-case back-compat behavior

[PULL 2/5] nbd/server: Plumb in new args to nbd_client_add()

2024-08-08 Thread Eric Blake
, although for now the two servers (qemu-nbd.c and blockdev-nbd.c) do not change behavior even though they pass in a new default timeout value. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Eric Blake Message-ID: <20240807174943.771624-11-ebl...@redhat.com> Reviewed-by: Da

[PULL 4/5] nbd/server: CVE-2024-7409: Drop non-negotiating clients

2024-08-08 Thread Eric Blake
H[i].connect_uri("nbd://localhost") ' $ kill $! where later connections get to start progressing once earlier ones are forcefully dropped for taking too long, rather than hanging. Suggested-by: Daniel P. Berrangé Signed-off-by: Eric Blake Message-ID: <20240807174943.771624-1

Re: [PATCH] block/blkio: use FUA flag on write zeroes only if supported

2024-08-08 Thread Eric Blake
+ > block/blkio.c | 6 -- > 2 files changed, 6 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH 1/2] util: Refactor json-writer's string sanitizer to be public

2024-08-08 Thread Eric Blake
On Thu, Aug 08, 2024 at 09:54:26AM GMT, Markus Armbruster wrote: > Eric Blake writes: > > > My next patch needs to convert text from an untrusted input into an > > output representation that is suitable for display on a terminal is > > useful to more than just the json

Re: [PATCH v4 5/7] nbd/server: CVE-2024-7409: Close stray client sockets at shutdown

2024-08-07 Thread Eric Blake
On Wed, Aug 07, 2024 at 07:29:25PM GMT, Daniel P. Berrangé wrote: > On Wed, Aug 07, 2024 at 12:43:31PM -0500, Eric Blake wrote: > > A malicious client can attempt to connect to an NBD server, and then > > intentionally delay progress in the handshake, including if it does >

Re: [PATCH v4 3/7] nbd/server: CVE-2024-7409: Change default max-connections to 100

2024-08-07 Thread Eric Blake
On Wed, Aug 07, 2024 at 07:24:56PM GMT, Daniel P. Berrangé wrote: > On Wed, Aug 07, 2024 at 12:43:29PM -0500, Eric Blake wrote: > > 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 &

Re: [PATCH v4 2/7] nbd/server: Plumb in new args to nbd_client_add()

2024-08-07 Thread Eric Blake
On Wed, Aug 07, 2024 at 06:58:36PM GMT, Daniel P. Berrangé wrote: > On Wed, Aug 07, 2024 at 12:43:28PM -0500, Eric Blake wrote: > > Upcoming patches to fix a CVE need to track an opaque pointer passed > > in by the owner of a client object, as well as reequest for a time s/r

[PATCH v4 4/7] nbd/server: CVE-2024-7409: Drop non-negotiating clients

2024-08-07 Thread Eric Blake
H[i].connect_uri("nbd://localhost") ' where later connections get to start progressing once earlier ones are forcefully dropped for taking too long, rather than hanging. Suggested-by: Daniel P. Berrangé Signed-off-by: Eric Blake --- nbd/server.c | 31 ++

Re: [PATCH for-9.1 0/2] NBD: don't print raw server error text to terminal

2024-08-07 Thread Eric Blake
On Mon, Aug 05, 2024 at 08:11:31PM GMT, Richard W.M. Jones wrote: > On Mon, Aug 05, 2024 at 01:48:12PM -0500, Eric Blake wrote: > > On Fri, Aug 02, 2024 at 02:26:04PM GMT, Eric Blake wrote: > > > I've requested a CVE from Red Hat, and hope to have an assigned number > &g

[PATCH for-9.1 v4 0/7] CVE-2024-7409

2024-08-07 Thread Eric Blake
for reverting back to 9.0 behavior for integration testing purposes; I'm okay if these last two miss 9.1 Eric Blake (7): nbd: Minor style fixes nbd/server: Plumb in new args to nbd_client_add() nbd/server: CVE-2024-7409: Change default max-connections to 100 nbd/server: CVE-2024

[PATCH v4 6/7] qemu-nbd: Allow users to adjust handshake limit

2024-08-07 Thread Eric Blake
away from the default. This option is unlikely to be used in enough scenarios to warrant a short option letter. Signed-off-by: Eric Blake --- I'm not sure if this is 9.1 material. It is a new feature (user-visible command line option) implemented after soft freeze; on the other hand, i

[PATCH v4 7/7] nbd/server: Allow users to adjust handshake limit in QMP

2024-08-07 Thread Eric Blake
he default. Signed-off-by: Eric Blake --- I'm not sure if this is 9.1 material. It is a new feature (user-visible QMP addition) implemented after soft freeze; on the other hand, it allows one to recover the behavior that existed prior to plugging the CVE which may be useful in inte

[PATCH v4 1/7] nbd: Minor style fixes

2024-08-07 Thread Eric Blake
Touch up a comment with the wrong type name, and an over-long line, both noticed while working on upcoming patches. Signed-off-by: Eric Blake --- nbd/server.c | 2 +- qemu-nbd.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index

[PATCH v4 2/7] nbd/server: Plumb in new args to nbd_client_add()

2024-08-07 Thread Eric Blake
, although for now the two servers (qemu-nbd.c and blockdev-nbd.c) do not change behavior. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Eric Blake --- include/block/nbd.h | 11 ++- blockdev-nbd.c | 6 -- nbd/server.c| 20 +--- qemu-nbd.c

[PATCH v4 5/7] nbd/server: CVE-2024-7409: Close stray client sockets at shutdown

2024-08-07 Thread Eric Blake
list closed in nbd_export_close_all), despite that patch intentionally tearing down the QIONetListener to prevent new clients. Reported-by: Alexander Ivanov Fixes: CVE-2024-7409 Signed-off-by: Eric Blake --- blockdev-nbd.c | 35 ++- 1 file changed, 34 insertions(

[PATCH v4 3/7] nbd/server: CVE-2024-7409: Change default max-connections to 100

2024-08-07 Thread Eric Blake
from being able to connect; thus, later patches will further add timeouts to reject clients that are not making progress. Suggested-by: Daniel P. Berrangé Signed-off-by: Eric Blake --- qapi/block-export.json | 4 ++-- include/block/nbd.h| 7 +++ block/monitor/block-hmp-c

Re: [PATCH v3 2/2] nbd: Clean up clients more efficiently

2024-08-06 Thread Eric Blake
On Tue, Aug 06, 2024 at 10:32:54AM GMT, Daniel P. Berrangé wrote: > On Mon, Aug 05, 2024 at 09:21:36PM -0500, Eric Blake wrote: > > Since an NBD server may be long-living, serving clients that > > repeatedly connect and disconnect, it can be more efficient to clean > >

Re: [PATCH v3 2/2] nbd: Clean up clients more efficiently

2024-08-06 Thread Eric Blake
On Tue, Aug 06, 2024 at 10:32:54AM GMT, Daniel P. Berrangé wrote: > On Mon, Aug 05, 2024 at 09:21:36PM -0500, Eric Blake wrote: > > Since an NBD server may be long-living, serving clients that > > repeatedly connect and disconnect, it can be more efficient to clean > >

Re: [PATCH v3 2/2] nbd: Clean up clients more efficiently

2024-08-05 Thread Eric Blake
On Mon, Aug 05, 2024 at 09:21:36PM GMT, Eric Blake wrote: > Since an NBD server may be long-living, serving clients that > repeatedly connect and disconnect, it can be more efficient to clean > up after each client disconnects, rather than storing a list of > resources to clean up whe

Re: [PATCH v2 1/3] nbd: CVE-XXX: Use cookie to track generation of nbd-server

2024-08-05 Thread Eric Blake
ake it clear I'm relying on the synchronous nature of coroutines yielding only at known points and the code executing only in the main thread as the reason why we don't need explicit locking here. -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

[PATCH for-9.1 v3 0/2] NBD CVE-2024-7409

2024-08-05 Thread Eric Blake
f a doubly-linked list (where the client has to remember an opaque pointer) over a singly-linked one (where the client is unchanged, but a lot of repeated client connect/disconnect over a long-lived server can chew up memory and slow down the eventual nbd-server-stop) Eric Blake (2):

[PATCH v3 1/2] nbd: CVE-2024-7409: Close stray client sockets at server shutdown

2024-08-05 Thread Eric Blake
ocket never got added to the list closed in nbd_export_close_all), despite that patch intentionally tearing down the QIONetListener to prevent new clients. Reported-by: Alexander Ivanov Fixes: CVE-2024-7409 Signed-off-by: Eric Blake --- blockdev-nbd.c | 30 ++ 1 file ch

[PATCH v3 2/2] nbd: Clean up clients more efficiently

2024-08-05 Thread Eric Blake
that we can get O(1) deletion to keep the list pruned to size as clients exit. This in turn requires each client to track an opaque pointer of owner information (although qemu-nbd doesn't need to refer to it). Signed-off-by: Eric Blake --- include/block/nbd.h | 4 +++- blockdev-nbd.c

Re: [PATCH for-9.1 0/2] NBD: don't print raw server error text to terminal

2024-08-05 Thread Eric Blake
On Fri, Aug 02, 2024 at 02:26:04PM GMT, Eric Blake wrote: > I've requested a CVE from Red Hat, and hope to have an assigned number > soon. Meanwhile, we can get review started, to make sure this is > ready to include in 9.1. 'qemu-img info' should never print untrusted &g

[PATCH for-9.1 0/2] NBD: don't print raw server error text to terminal

2024-08-02 Thread Eric Blake
ace purposes), but we may find uses for it; in fact, it raises the question of whether any of our trace_ calls need to sanitize untrusted data (or whether we can rely on ALL trace engines to be doing that on our behalf, already). Eric Blake (2): util: Refactor json-writer's string sanitize

[PATCH 2/2] qemu-img: CVE-XXX Sanitize untrusted output from NBD server

2024-08-02 Thread Eric Blake
ts in trace_nbd_server_error_msg; this is because I assume that our trace engines already treat all string strings as untrusted input and apply their own escaping as needed. Reported-by: "Richard W.M. Jones" Signed-off-by: Eric Blake --- If my assumption about allowing raw escape bytes t

[PATCH 1/2] util: Refactor json-writer's string sanitizer to be public

2024-08-02 Thread Eric Blake
e are okay passing printable Unicode through (we still need to escape control characters). But for now, I went for minimal code churn, including the fact that the resulting function allows a non-UTF-8 2-byte synonym for U+. Signed-off-by: Eric Blake --- include/qemu/unicode.h | 3 ++ qobject

Re: [PATCH v2 1/3] nbd: CVE-XXX: Use cookie to track generation of nbd-server

2024-08-02 Thread Eric Blake
On Fri, Aug 02, 2024 at 06:00:32PM GMT, Vladimir Sementsov-Ogievskiy wrote: > On 02.08.24 04:32, Eric Blake wrote: > [..] > > > -static void nbd_blockdev_client_closed(NBDClient *client, bool ignored) > > +static void nbd_blockdev_client_closed(NBDClient *cl

Re: [PATCH v2 1/3] nbd: CVE-XXX: Use cookie to track generation of nbd-server

2024-08-02 Thread Eric Blake
On Thu, Aug 01, 2024 at 08:32:06PM GMT, Eric Blake wrote: > As part of the QMP command nbd-server-start, the blockdev code was > creating a single global nbd_server object, and telling the qio code > to accept one or more client connections to the exposed listener > socket. But ev

Re: [PATCH 6/5] docs: Typo fix in live disk backup

2024-08-02 Thread Eric Blake
On Fri, Aug 02, 2024 at 08:30:25AM GMT, Eric Blake wrote: > Add in the missing space in the section header. > > Fixes: 1084159b31 ("qapi: deprecate drive-backup", v6.2.0) > Signed-off-by: Eric Blake Regarding the subject line using [PATCH 6/5]: I meant to send

[PATCH] docs: Tweak location of qemu nbd extensions

2024-08-02 Thread Eric Blake
Upstream QEMU is moving the location of its NBD docs, as of its commit [1]. Instead of pointing to the raw git source file, point to the rendered html version built from rST. CC: qemu-devel@nongnu.org Signed-off-by: Eric Blake --- [1] Commit id TBD, I will update this patch to match

[PATCH 6/5] docs: Typo fix in live disk backup

2024-08-02 Thread Eric Blake
Add in the missing space in the section header. Fixes: 1084159b31 ("qapi: deprecate drive-backup", v6.2.0) Signed-off-by: Eric Blake --- Noticed while figuring out where nbd docs would appear in [1] once [2] goes live: [1] https://www.qemu.org/docs/master/interop/index.html

Re: [PATCH 2/5] docs/interop/nbd.txt: Convert to rST

2024-08-02 Thread Eric Blake
On Fri, Aug 02, 2024 at 09:39:41AM GMT, Peter Maydell wrote: > On Thu, 1 Aug 2024 at 19:39, Eric Blake wrote: > > > > On Thu, Aug 01, 2024 at 06:01:28PM GMT, Peter Maydell wrote: > > > Convert nbd.txt to rST format. > > > > > > -F: docs/inte

[PATCH v2 1/3] nbd: CVE-XXX: Use cookie to track generation of nbd-server

2024-08-01 Thread Eric Blake
through NBD negotiation); the next patch will add some code to forcefully close any lingering clients as soon as possible when the server is torn down. Reported-by: Alexander Ivanov Signed-off-by: Eric Blake --- include/block/nbd.h | 3 ++- blockdev-nbd.c | 17 - nbd/server.c

[PATCH v2 3/3] nbd: Minor style fixes

2024-08-01 Thread Eric Blake
Touch up a comment with the wrong type name, and an over-long line, both noticed while working on the previous patches. Signed-off-by: Eric Blake --- nbd/server.c | 2 +- qemu-nbd.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index

[PATCH v2 2/3] nbd: CVE-XXX: Close stray client sockets at server shutdown

2024-08-01 Thread Eric Blake
service attack, so it is still categorized under the same CVE. Signed-off-by: Eric Blake --- I do not know if I need to worry about multi-threaded access (is it possible that more than one client trying to connect simultaneously means that I need to access nbd_server->conns atomically)? block

[PATCH v2 for-9.1 0/3] Avoid NBD crash on nbd-server-stop

2024-08-01 Thread Eric Blake
y on a prolonged NBD_OPT_* conversation). [I'm also aware of some Coverity analysis pointing to potential race conditions in block/nbd.c; if those need fixes, I hope to also post patches for those in time for inclusion in the same pull request that picks up this series] Eric Blake (3): nbd

Re: [PATCH 2/5] docs/interop/nbd.txt: Convert to rST

2024-08-01 Thread Eric Blake
> +bit 0: > + ``NBD_STATE_DIRTY``, set when the extent is "dirty" > + > +The second is related to exposing the source of various extents within > +the image, with a single metadata context named:: I'm not an rst expert, so I'm assuming the difference between

Re: [PATCH] iotests/024: exclude 'backing file format' field from the output

2024-07-30 Thread Eric Blake
> Signed-off-by: Andrey Drobyshev > --- > tests/qemu-iotests/024 | 2 +- > tests/qemu-iotests/024.out | 1 - > 2 files changed, 1 insertion(+), 2 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH v3] scripts/qcow2-to-stdout.py: Add script to write qcow2 images to stdout

2024-07-29 Thread Eric Blake
ue, > +) Does q-s-d exposing an image as raw still support lseek(SEEK_HOLE) efficiently? > +parser.add_argument( > +"-v", > +dest="qcow2_version", > +metavar="qcow2_version", > +help=f"qcow2 version (default: {QCOW2_DEFAULT_VERSION})", > +default=QCOW2_DEFAULT_VERSION, > +type=int, > +choices=[2, 3], Is it really worth trying to create v2 images? These days, v3 images are hands down better, and we should be encouraging people to upgrade their tools to v3 all around, rather than making it easy to still consume v2 images. -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH] nbd: Prevent NULL pointer dereference in nbd_blockdev_client_closed()

2024-07-29 Thread Eric Blake
ns > 0) { +error_setg(errp, "NBD server still has connected clients"); +return; +} + nbd_server_free(nbd_server); nbd_server = NULL; } but it's not as graceful as I'd like (it would be nicer to have the nbd-server-stop command wait until it k

Re: query dirty areas according to bitmap via QMP or qemu-nbd

2024-07-29 Thread Eric Blake
ry about things like the two contexts returning different lengths of information ("base:allocation" might tell you about a 64k hole while qemu:dirty-bitmap:XXX tells you about a 1M dirty region - but consolidating that into contiguous extents of combined output information is tricky, especially if you don't want to re-query status you already know about one context but not the other). > > Best Regards, > Fiona > -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: query dirty areas according to bitmap via QMP or qemu-nbd

2024-07-26 Thread Eric Blake
h, but it has never risen to the level of enough of an itch for me to write it myself (especially since 'nbdinfo --map's output works just as well). -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [PATCH v6 9/9] vfio/common: Allow disabling device dirty page tracking

2024-07-23 Thread Eric Auger
On 7/23/24 10:42, Joao Martins wrote: > On 23/07/2024 09:31, Eric Auger wrote: >> >> On 7/22/24 23:13, Joao Martins wrote: >>> The property 'x-pre-copy-dirty-page-tracking' allows disabling the whole >>> tracking of VF pre-copy phase of dirty page trac

Re: [PATCH v6 9/9] vfio/common: Allow disabling device dirty page tracking

2024-07-23 Thread Eric Auger
hat disables the VF dirty page tracking, and fall > back into container-based dirty page tracking. This also allows to > use IOMMU dirty tracking even on VFs with their own dirty > tracker scheme. Forced ON value isn't really meaningful though. I mean only valid values are AUTO an

Re: [PATCH v6 4/9] vfio/{iommufd,container}: Invoke HostIOMMUDevice::realize() during attach_device()

2024-07-23 Thread Eric Auger
On 7/23/24 10:20, Duan, Zhenzhong wrote: > >> -Original Message- >> From: Joao Martins >> Subject: Re: [PATCH v6 4/9] vfio/{iommufd,container}: Invoke >> HostIOMMUDevice::realize() during attach_device() >> >> On 23/07/2024 08:55, Eric Auger wro

Re: [PATCH v6 8/9] vfio/migration: Don't block migration device dirty tracking is unsupported

2024-07-23 Thread Eric Auger
"%s: VFIO device doesn't support device dirty > tracking", > - vbasedev->name); nit: does support neither/nor writing may be better here and below but I am not a native english speaker Reviewed-by: Eric Auger Eric > +

Re: [PATCH v6 6/9] vfio/iommufd: Implement VFIOIOMMUClass::set_dirty_tracking support

2024-07-23 Thread Eric Auger
On 7/23/24 10:14, Joao Martins wrote: > On 23/07/2024 09:03, Eric Auger wrote: >> Hi Joao, >> >> On 7/22/24 23:13, Joao Martins wrote: >>> ioctl(iommufd, IOMMU_HWPT_SET_DIRTY_TRACKING, arg) is the UAPI that >>> enables or disables dirty page tracking. The

Re: [PATCH v6 4/9] vfio/{iommufd,container}: Invoke HostIOMMUDevice::realize() during attach_device()

2024-07-23 Thread Eric Auger
On 7/23/24 10:05, Joao Martins wrote: > On 23/07/2024 08:55, Eric Auger wrote: >> >> On 7/23/24 09:44, Cédric Le Goater wrote: >>> On 7/23/24 09:38, Eric Auger wrote: >>>> Hi Joao, >>>> >>>> On 7/22/24 23:13, Joao Martins wrote: >&g

Re: [PATCH v6 5/9] vfio/iommufd: Probe and request hwpt dirty tracking capability

2024-07-23 Thread Eric Auger
On 7/23/24 10:00, Joao Martins wrote: > On 23/07/2024 08:50, Eric Auger wrote: >> Hi Joao, >> >> On 7/22/24 23:13, Joao Martins wrote: >>> In preparation to using the dirty tracking UAPI, probe whether the IOMMU >>> supports dirty tracking. This is don

Re: [PATCH v6 6/9] vfio/iommufd: Implement VFIOIOMMUClass::set_dirty_tracking support

2024-07-23 Thread Eric Auger
rs my previous question. So do you want to tag a container as dirty_pages_supported = true as soon as one device is backed up with a dirty tracking hwpt within that container? I think I miss the high level view of when this case may happen and why the devices do not end up in differ

Re: [PATCH v6 4/9] vfio/{iommufd,container}: Invoke HostIOMMUDevice::realize() during attach_device()

2024-07-23 Thread Eric Auger
On 7/23/24 09:44, Cédric Le Goater wrote: > On 7/23/24 09:38, Eric Auger wrote: >> Hi Joao, >> >> On 7/22/24 23:13, Joao Martins wrote: >>> Move the HostIOMMUDevice::realize() to be invoked during the attach >>> of the device >>> before we a

Re: [PATCH v6 5/9] vfio/iommufd: Probe and request hwpt dirty tracking capability

2024-07-23 Thread Eric Auger
ol iommufd_cdev_autodomains_get(VFIODevice > *vbasedev, > } > > vbasedev->hwpt = hwpt; > +vbasedev->iommu_dirty_tracking = iommufd_hwpt_dirty_tracking(hwpt); > QLIST_INSERT_HEAD(&hwpt->device_list, vbasedev, hwpt_next); > QLIST_INSERT_HE

Re: [PATCH v6 4/9] vfio/{iommufd,container}: Invoke HostIOMMUDevice::realize() during attach_device()

2024-07-23 Thread Eric Auger
@@ -403,6 +403,10 @@ static bool iommufd_cdev_attach(const char *name, > VFIODevice *vbasedev, > > space = vfio_get_address_space(as); > > +if (!vfio_device_hiod_realize(vbasedev, errp)) { > +return false; > +} > + > /* try to attach to an existing container in this space */ > QLIST_FOREACH(bcontainer, &space->containers, next) { > container = container_of(bcontainer, VFIOIOMMUFDContainer, > bcontainer); Eric

Re: [PATCH v6 3/9] vfio/iommufd: Add hw_caps field to HostIOMMUDeviceCaps

2024-07-23 Thread Eric Auger
preparation for HostIOMMUDevice::realize() being called early > during attach_device(). > > Signed-off-by: Joao Martins > Reviewed-by: Cédric Le Goater Reviewed-by: Eric Auger Eric > --- > include/sysemu/host_iommu_device.h | 4 > hw/vfio/iommufd.c |

Re: [PATCH v6 2/9] vfio/{iommufd,container}: Remove caps::aw_bits

2024-07-23 Thread Eric Auger
Device::realize() being called early > during attach_device(). > > Suggested-by: Zhenzhong Duan > Signed-off-by: Joao Martins > Reviewed-by: Cédric Le Goater Eric > --- > include/sysemu/host_iommu_device.h | 3 --- > backends/iommufd.c | 3 ++- &g

Re: [PATCH v6 1/9] vfio/iommufd: Introduce auto domain creation

2024-07-23 Thread Eric Auger
ion > state is initialized after the device attachment. But such mixed mode of > IOMMU dirty tracking + device dirty tracking is an improvement that can > be added on. Keep the 'all of nothing' of type1 approach that we have > been using so far between container vs device dirty tr

Re: [PATCH v5 01/13] vfio/pci: Extract mdev check into an helper

2024-07-23 Thread Eric Auger
t's mdev or not. > > Signed-off-by: Joao Martins Reviewed-by: Eric Auger Eric > --- > include/hw/vfio/vfio-common.h | 2 ++ > hw/vfio/helpers.c | 14 ++ > hw/vfio/pci.c | 12 +++- > 3 files changed, 19 insertions(+), 9 dele

Re: [PATCH 2/2] vfio/ccw: Don't initialize HOST_IOMMU_DEVICE with mdev

2024-07-22 Thread Eric Farman
On Mon, 2024-07-22 at 17:36 +0200, Cédric Le Goater wrote: > On 7/22/24 17:09, Joao Martins wrote: > > On 22/07/2024 15:57, Eric Farman wrote: > > > On Mon, 2024-07-22 at 15:07 +0800, Zhenzhong Duan wrote: > > > > mdevs aren't "physical" devices and w

Re: [PATCH 2/2] vfio/ccw: Don't initialize HOST_IOMMU_DEVICE with mdev

2024-07-22 Thread Eric Farman
On Mon, 2024-07-22 at 15:07 +0800, Zhenzhong Duan wrote: > mdevs aren't "physical" devices and when asking for backing IOMMU info, > it fails the entire provisioning of the guest. Fix that by setting > vbasedev->mdev true so skipping HostIOMMUDevice initialization in the > presence of mdevs. Hmm,

Re: [PATCH] hw/arm/smmuv3: Assert input to oas2bits() is valid

2024-07-22 Thread Eric Auger
e function > to assert that. > > Reported-By: Peter Maydell > Link: > https://lore.kernel.org/qemu-devel/CAFEAcA-H=n-3mhc+el6yjfl1m+x+b+fk3mkgzbn74wnxiff...@mail.gmail.com/ > Signed-off-by: Mostafa Saleh Reviewed-by: Eric Auger Eric > --- > hw/arm/smmuv3-internal.h | 3 ++

Re: [PATCH 0/2] Don't initialize HOST_IOMMU_DEVICE with mdev

2024-07-22 Thread Eric Auger
): > vfio/ap: Don't initialize HOST_IOMMU_DEVICE with mdev > vfio/ccw: Don't initialize HOST_IOMMU_DEVICE with mdev For the series Reviewed-by: Eric Auger Eric > > hw/vfio/ap.c | 3 +++ > hw/vfio/ccw.c | 3 +++ > 2 files changed, 6 insertions(+) >

[PATCH] hw/vfio/container: Fix SIGSEV on vfio_container_instance_finalize()

2024-07-19 Thread Eric Auger
the first instance. Fixes: 938026053f4 ("vfio/container: Switch to QOM") Signed-off-by: Eric Auger --- hw/vfio/container.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/vfio/container.c b/hw/vfio/container.c index 425db1a14c..d8b7c533af 100644 --- a/hw/vfio/container.c +++ b

Re: [PATCH v5 00/18] SMMUv3 nested translation support

2024-07-17 Thread Eric Auger
I did some testing in non nesting mode with virtio-net/vhost and I have not noticed any regression. Would be nice if someone could send his T-b for the nested part though (Julien?). Thanks Eric

Re: [PATCH v5 03/18] hw/arm/smmuv3: Fix encoding of CLASS in events

2024-07-17 Thread Eric Auger
On 7/17/24 17:58, Jean-Philippe Brucker wrote: > Hi Eric, > > On Wed, Jul 17, 2024 at 05:07:57PM +0200, Eric Auger wrote: >> Hi Jean, >> >> On 7/15/24 10:45, Mostafa Saleh wrote: >>> The SMMUv3 spec (ARM IHI 0070 F.b - 7.3 Event records) defines the >>

Re: [PATCH v5 16/18] hw/arm/smmuv3: Handle translation faults according to SMMUPTWEventInfo

2024-07-17 Thread Eric Auger
trigger a stage-2 fault, so we check SMMUPTWEventInfo as it would > have the correct stage set from the page table walk. > > Signed-off-by: Mostafa Saleh Reviewed-by: Eric Auger Eric > --- > hw/arm/smmuv3.c | 15 --- > 1 file changed, 8 insertions(+), 7 deletions(-

Re: [PATCH v5 15/18] hw/arm/smmuv3: Support nested SMMUs in smmuv3_notify_iova()

2024-07-17 Thread Eric Auger
he IOVA and would be notified. > > Signed-off-by: Mostafa Saleh Reviewed-by: Eric Auger Eric > --- > hw/arm/smmuv3.c | 39 +-- > hw/arm/trace-events | 2 +- > 2 files changed, 26 insertions(+), 15 deletions(-) > > diff --git a/

Re: [PATCH v5 11/18] hw/arm/smmu-common: Support nested translation

2024-07-17 Thread Eric Auger
to differ faults > from walking stage 1 translation table and faults from translating > an IPA for a transaction. > > Signed-off-by: Mostafa Saleh Reviewed-by: Eric Auger Eric > --- > hw/arm/smmu-common.c | 74 +++- > hw/arm/smmuv3.c

Re: [PATCH v5 09/18] hw/arm/smmu-common: Rework TLB lookup for nesting

2024-07-17 Thread Eric Auger
;t > consider the page offset bits. > > Signed-off-by: Mostafa Saleh Reviewed-by: Eric Auger Eric > --- > hw/arm/smmu-common.c | 64 +--- > 1 file changed, 43 insertions(+), 21 deletions(-) > > diff --git a/hw/arm/smmu-common.c b/h

Re: [PATCH v5 08/18] hw/arm/smmuv3: Translate CD and TT using stage-2 table

2024-07-17 Thread Eric Auger
ling > required. > > As in CD and TTBx translation context, the iova is not known, setting > the InputAddr was removed from "smmuv3_do_translate" and set after > from "smmuv3_translate" with the new function "smmuv3_fixup_event" > > Signed-off-by: Most

Re: [PATCH v5 03/18] hw/arm/smmuv3: Fix encoding of CLASS in events

2024-07-17 Thread Eric Auger
SMMU_CLASS_IN : SMMU_CLASS_TT; does it match your expectations. While reading your previous comment I have the impression what you had in mind was more complicated than that * s2 walk that encounters EABT on S2 descriptor while translating non-descriptor IPA i

  1   2   3   4   5   6   7   8   9   10   >