[PATCH] qio: Inherit follow_coroutine_ctx across TLS

2024-05-15 Thread Eric Blake
it feature bits. CC: Stefan Hajnoczi CC: Daniel P. Berrangé CC: qemu-sta...@nongnu.org Fixes: https://issues.redhat.com/browse/RHEL-34786 Fixes: 06e0f098 ("io: follow coroutine AioContext in qio_channel_yield()", v8.2.0) Signed-off-by: Eric Blake --- Maybe we should turn ioc->fo

[PATCH v2 2/2] iotests: test NBD+TLS+iothread

2024-05-17 Thread Eric Blake
Prevent regressions when using NBD with TLS in the presence of iothreads, adding coverage the fix to qio channels made in the previous patch. CC: qemu-sta...@nongnu.org Signed-off-by: Eric Blake --- tests/qemu-iotests/tests/nbd-tls-iothread | 170 ++ tests/qemu-iotests/tests

[PATCH v2 0/2] Fix NBD+TLS regression in presence of iothread

2024-05-17 Thread Eric Blake
In v2: - correct list email address - add iotest - add R-b I'm offline next week, and have been communicating with Stefan who may want to push this through his block tree instead of waiting for me to get back. Eric Blake (2): qio: Inherit follow_coroutine_ctx across TLS iotests: test NB

[PATCH v2 1/2] qio: Inherit follow_coroutine_ctx across TLS

2024-05-17 Thread Eric Blake
e way that they inherit feature bits. CC: Stefan Hajnoczi CC: Daniel P. Berrangé CC: qemu-sta...@nongnu.org Fixes: https://issues.redhat.com/browse/RHEL-34786 Fixes: 06e0f098 ("io: follow coroutine AioContext in qio_channel_yield()", v8.2.0) Signed-off-by: Eric Blake Reviewed

Re: [PATCH v2 0/2] Fix NBD+TLS regression in presence of iothread

2024-05-17 Thread Eric Blake
On Fri, May 17, 2024 at 09:50:13PM GMT, Eric Blake wrote: > In v2: > - correct list email address > - add iotest > - add R-b > > I'm offline next week, and have been communicating with Stefan who may > want to push this through his block tree instead of waiting for me to

Re: [PATCH v2 2/2] iotests: test NBD+TLS+iothread

2024-05-17 Thread Eric Blake
Adding a bit of self-review (in case you want to amend this before pushing, instead of waiting for me to get back online), On Fri, May 17, 2024 at 09:50:15PM GMT, Eric Blake wrote: > Prevent regressions when using NBD with TLS in the presence of > iothreads, adding coverage the fix

[PULL 2/2] iotests: test NBD+TLS+iothread

2024-05-30 Thread Eric Blake
relicensing from 2-clause BSD to GPLv2. CC: qemu-sta...@nongnu.org CC: "Richard W.M. Jones" Signed-off-by: Eric Blake Message-ID: <20240518025246.791593-6-ebl...@redhat.com> --- tests/qemu-iotests/tests/nbd-tls-iothread | 168 ++ tests/qemu-iotests/tests/nbd-

Re: [PATCH v2 2/2] iotests: test NBD+TLS+iothread

2024-05-31 Thread Eric Blake
On Fri, May 31, 2024 at 04:36:20PM GMT, Kevin Wolf wrote: > Am 18.05.2024 um 04:50 hat Eric Blake geschrieben: > > Prevent regressions when using NBD with TLS in the presence of > > iothreads, adding coverage the fix to qio channels made in the > > previous patch.

[PATCH v3 0/2] Fix NBD+TLS regression in presence of iothread

2024-05-31 Thread Eric Blake
In v3: - 2/2: fix iotest filtering [kwolf] v2 was here: https://lists.gnu.org/archive/html/qemu-devel/2024-05/msg03517.html and this time, I'll wait for R-b before sending my v2 pull request: https://lists.gnu.org/archive/html/qemu-devel/2024-05/msg06206.html Eric Blake (2): qio: In

[PATCH v3 1/2] qio: Inherit follow_coroutine_ctx across TLS

2024-05-31 Thread Eric Blake
e way that they inherit feature bits. CC: Stefan Hajnoczi CC: Daniel P. Berrangé CC: qemu-sta...@nongnu.org Fixes: https://issues.redhat.com/browse/RHEL-34786 Fixes: 06e0f098 ("io: follow coroutine AioContext in qio_channel_yield()", v8.2.0) Signed-off-by: Eric Blake Reviewed

[PATCH v3 2/2] iotests: test NBD+TLS+iothread

2024-05-31 Thread Eric Blake
relicensing from 2-clause BSD to GPLv2. CC: qemu-sta...@nongnu.org CC: "Richard W.M. Jones" Signed-off-by: Eric Blake --- tests/qemu-iotests/tests/nbd-tls-iothread | 168 ++ tests/qemu-iotests/tests/nbd-tls-iothread.out | 54 ++ 2 files changed, 222 insertions(

[PULL v2 0/2] NBD patches for 2024-05-30

2024-06-03 Thread Eric Blake
th NBD+TLS ---- Eric Blake (2): qio: Inherit follow_coroutine_ctx across TLS iotests: test NBD+TLS+iothread io/channel-tls.c | 26 ++-- io/channel-websock.c | 1 + tests/qemu-iotests/tests/nbd-tl

[PULL v2 1/2] qio: Inherit follow_coroutine_ctx across TLS

2024-06-03 Thread Eric Blake
e way that they inherit feature bits. CC: Stefan Hajnoczi CC: Daniel P. Berrangé CC: qemu-sta...@nongnu.org Fixes: https://issues.redhat.com/browse/RHEL-34786 Fixes: 06e0f098 ("io: follow coroutine AioContext in qio_channel_yield()", v8.2.0) Signed-off-by: Eric Blake Reviewed

[PULL v2 2/2] iotests: test NBD+TLS+iothread

2024-06-03 Thread Eric Blake
relicensing from 2-clause BSD to GPLv2. CC: qemu-sta...@nongnu.org CC: "Richard W.M. Jones" Signed-off-by: Eric Blake Message-ID: <20240531180639.1392905-6-ebl...@redhat.com> Reviewed-by: Daniel P. Berrangé --- tests/qemu-iotests/tests/nbd-tls-iothread | 168 ++

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

2024-06-10 Thread Eric Blake
there is still an active client, and make sure we don't have any other NULL derefs. I'll respond again once I've studied the code a bit more. > > nbd_server->connections--; > > nbd_update_server_watch(nbd_server); > > -- > Best regards, > Alexander Ivanov -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org

Re: [Libguestfs] Passing block size preferences from NBD -> qemu -> Linux

2024-07-15 Thread Eric Blake
termine when to prioritize hardware advertisements over command-line defaults, while still maintaining flexibility to intentionally pick different sizes than what hardware advertised for the purposes of performance testing. -- 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: 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: [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: [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] 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

[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 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 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 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 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

[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 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

[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

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 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 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

[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

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

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 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 > >

[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 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 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 ++

[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

[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 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 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 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

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

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

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 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 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] 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

[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

[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 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 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

[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

[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 +

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 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

[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() > >

[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() > >

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: [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 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: [Qemu-block] [PATCH v10 09/10] support replication driver in blockdev-add

2015-10-09 Thread Eric Blake
> Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v10 01/10] allow writing to the backing file

2015-10-09 Thread Eric Blake
ubt), you need corresponding documentation of the knob in qapi/block-core.json, since we are trying to keep the command line and QMP in sync when it comes to adding new options. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v10 02/10] Backup: clear all bitmap when doing block checkpoint

2015-10-09 Thread Eric Blake
On 09/25/2015 12:17 AM, Wen Congyang wrote: s/bitmap/bitmaps/ in the subject line. The subject line says "what", but you are missing a commit body that says "why". > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > Reviewe

Re: [Qemu-block] [Qemu-devel] [PATCH v2] migration: disallow migrate_add_blocker during migration

2015-10-09 Thread Eric Blake
e, you could fix it up. > +++ b/stubs/migr-blocker.c > @@ -1,8 +1,9 @@ > #include "qemu-common.h" > #include "migration/migration.h" > > -void migrate_add_blocker(Error *reason) > +int migrate_add_blocker(Error *reason, Error **errp) > { > +

Re: [Qemu-block] [Qemu-devel] [PATCH 03/17] spec: add qcow2-dirty-bitmaps specification

2015-10-09 Thread Eric Blake
se an external format >> for formats that do not support .bitmap_load or .bitmap_store >> (C) Forget about the qcow2 extension entirely, use only the new external >> format >> (D) Something else? >> >> My vote is for (B), > > Sounds good to me. I'm also

[Qemu-block] [PATCH v9 09/17] block: Convert to new qapi union layout

2015-10-15 Thread Eric Blake
ariant members. This leads to spurious collisions if a tag value matches a QMP name. Make the conversion to the new layout for block-related code. Signed-off-by: Eric Blake --- v9: new patch, but incorporates parts of v5 31/46 and Markus' RFC: http://lists.gnu.org/archive/html/qemu-de

Re: [Qemu-block] [Qemu-devel] [PATCH] blkdebug: Don't confuse image as backing file

2015-10-16 Thread Eric Blake
heng > --- > block/blkdebug.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake > > diff --git a/block/blkdebug.c b/block/blkdebug.c > index bc247f4..54650a7 100644 > --- a/block/blkdebug.c > +++ b/block/blkdebug.c > @@ -426,7 +426

Re: [Qemu-block] [Qemu-devel] Question about xen disk unplug support for ahci missed in qemu

2015-10-16 Thread Eric Blake
bling PV, etc. >> > > That's not sufficient though. The IDE device must not be enumerated by the OS > and, in Windows at least, that enumeration occurs before the PV frontend has > started up. ...all before getting to the real new content of the message? It is not only

Re: [Qemu-block] [PATCH v5 1/6] block: Change bdrv_get_encrypted_filename()

2015-10-19 Thread Eric Blake
- > include/block/block.h | 2 +- > monitor.c | 5 - > 3 files changed, 15 insertions(+), 9 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v5 2/6] block: Avoid BlockDriverState.filename

2015-10-19 Thread Eric Blake
ertions(+), 9 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v5 3/6] block: Add bdrv_filename()

2015-10-19 Thread Eric Blake
t; (for use through the JSON pseudo protocol) > and > + * put there. > + * > + * If @sz > 0, the string put into the buffer will always be null-terminated. Maybe add a warning: ...always be null-terminated, even if this truncates the result. Reviewed-by: Eric Blake -- Eric Blak

Re: [Qemu-block] [PATCH v5 4/6] qemu-img: Use bdrv_filename() for map

2015-10-19 Thread Eric Blake
+- > 1 file changed, 13 insertions(+), 1 deletion(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v5 5/6] block: Drop BlockDriverState.filename

2015-10-19 Thread Eric Blake
+++-- > include/block/block_int.h | 1 - > 12 files changed, 96 insertions(+), 44 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v5 6/6] iotests: Test changed Quorum filename

2015-10-19 Thread Eric Blake
> > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/041 | 17 + > 1 file changed, 13 insertions(+), 4 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [Qemu-devel] [PATCH 07/17] qcow2: add a 'keyid' parameter to qcow2 options

2015-10-19 Thread Eric Blake
his feature (since 2.5) > # > +# @keyid: #optional ID of the "secret" object providing the > +# AES decryption key. ...and this line should be swapped. > +# > # Since: 1.7 (For qcow, the entire struct is new so @keyid doesn't need versionin

Re: [Qemu-block] [RFC] transactions: add transaction-wide property

2015-10-20 Thread Eric Blake
ansaction", "arguments":{ "actions":[ {...},{...} ], "properties":{"allow-partial":true} } } while on the C side, new properties don't change the signature of qmp_transaction() any further (because it is all buried behind the has_props/props paramet

[Qemu-block] [PATCH v10 15/25] block: Convert to new qapi union layout

2015-10-22 Thread Eric Blake
ariant members. This leads to spurious collisions if a tag value matches a QMP name. Make the conversion to the new layout for block-related code. Signed-off-by: Eric Blake --- v10: no change v9: new patch, but incorporates parts of v5 31/46 and Markus' RFC: http://lists.gnu.org/archiv

Re: [Qemu-block] [PATCH] block: allow best-effort query

2015-10-26 Thread Eric Blake
> tests/qemu-iotests/110.out | 5 - > 2 files changed, 10 insertions(+), 5 deletions(-) Reviewed-by: Eric Blake Partial is indeed better than nothing :) -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

[Qemu-block] [PATCH v11 15/24] block: Convert to new qapi union layout

2015-10-26 Thread Eric Blake
ariant members. This leads to spurious collisions if a tag value matches a QMP name. Make the conversion to the new layout for block-related code. Signed-off-by: Eric Blake --- v11: no change v10: no change v9: new patch, but incorporates parts of v5 31/46 and Markus' RFC: http://lists.gnu.or

Re: [Qemu-block] [PATCH 2/3] qemu-io: Check for trailing chars

2015-10-26 Thread Eric Blake
VAL; > +} > +return ret; > } Eww. This mixes up two return types, negative errno, and negative input. User input of -22 shouldn't behave differently than -21, just because it happens to match -EINVAL. Do we ever want to allow a negative return from cvtnum(), or should we just

Re: [Qemu-block] [PATCH 1/3] qemu-io: fix cvtnum lval types

2015-10-26 Thread Eric Blake
-1 claims that -1 is non-numeric. Not the end of the world. > +} else if (sig > INT_MAX) { > +printf("signal argument '%s' is too large\n", argv[1]); > +return 0; > } Reviewed-by: Eric Blake -- Eric Blake eblake redhat com

Re: [Qemu-block] [PATCH 2/3] qemu-io: Check for trailing chars

2015-10-26 Thread Eric Blake
On 10/26/2015 04:44 PM, Eric Blake wrote: > On 10/26/2015 04:06 PM, John Snow wrote: >> Make sure there's not trailing garbage, e.g. >> "64k-whatever-i-want-here" >> >> Reported-by: Max Reitz >> Signed-off-by: John Snow >> --- >> q

Re: [Qemu-block] [Qemu-devel] [PATCH 1/3] qemu-io: fix cvtnum lval types

2015-10-26 Thread Eric Blake
On 10/26/2015 04:40 PM, Eric Blake wrote: > On 10/26/2015 04:06 PM, John Snow wrote: >> cvtnum() returns int64_t: we should not be storing this >> result inside of an int. >> >> In a few cases, we need an extra sprinkling of error handling >> where we expect

Re: [Qemu-block] [PATCH 3/3] qemu-io: Correct error messages

2015-10-26 Thread Eric Blake
break; > + default: > +printf("Parsing error -- %s\n", arg); Twice more. With that change, Reviewed-by: Eric Blake > @@ -2199,10 +2214,11 @@ static int sigraise_f(BlockBackend *blk, int argc, > char **argv) > { > int64_t sig = cvtnum(argv[1]); >

Re: [Qemu-block] [PATCH v2 3/3] qemu-io: Correct error messages

2015-10-26 Thread Eric Blake
On 10/26/2015 05:45 PM, John Snow wrote: > Reported-by: Max Reitz > Signed-off-by: John Snow > Reviewed-by: Eric Blake > --- > qemu-io-cmds.c | 53 ++--- > 1 file changed, 34 insertions(+), 19 deletions(-) > > diff --git

Re: [Qemu-block] [Qemu-devel] [PATCH v2 3/3] qemu-io: Correct error messages

2015-10-27 Thread Eric Blake
; > > Crud, sorry Eric -- I didn't do this on purpose. As Kevin notes, I was > just trying to match the existing format. I can change it and send again > if you want. Whatever is easiest for people. And Kevin has a valid point that you just did code motion, so keeping -- is no w

Re: [Qemu-block] [Qemu-devel] [PATCH 06/17] qcow: add a 'keyid' parameter to qcow options

2015-10-28 Thread Eric Blake
AES decryption key. > +# That's a lot of whitespace, but it doesn't hurt. > +# Since: 2.5 > +## > +{ 'struct': 'BlockdevOptionsQcow', > + 'base': 'BlockdevOptionsGenericCOWFormat', > + 'data': { '*keyid': 'str' } } Interface looks fine. Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [Qemu-devel] [PATCH 07/17] qcow2: add a 'keyid' parameter to qcow2 options

2015-10-28 Thread Eric Blake
On 10/19/2015 05:29 PM, Eric Blake wrote: > On 10/19/2015 09:09 AM, Daniel P. Berrange wrote: >> Add a 'keyid' parameter that refers to the ID of a >> QCryptoSecret instance that provides the encryption key. >> >> $QEMU \ >> -object secret,i

Re: [Qemu-block] [Qemu-devel] [PATCH] qemu-iotests: fix cleanup of background processes

2015-10-28 Thread Eric Blake
ot; > +rm -f "${TEST_DIR}/qemu-${i}.pid" > +fi > +if [ -z "${wait}" ] && [ ! -z ${QEMU_PID} ]; then Missing quotes around ${QEMU_PID}. But you got lucky: if it is empty, then you are evaluating [ ! -z ], which is false; where the intended [ ! -z "" ] would also be false. Still, it's bad form to abuse [] like that. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/2] block: Disallow snapshots if the overlay doesn't support backing files

2015-11-02 Thread Eric Blake
, "The snapshot already has a backing image"); > +return; > +} > + > +if (!state->new_bs->drv->supports_backing) { > + error_setg(errp, "The snapshot does not support backing images"); > } > } You could avoid the 'retur

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/2] qemu-iotests: fix cleanup of background processes

2015-11-02 Thread Eric Blake
doesn't have a mail filter for > #!/bin/(ba)?sh ... if.*== for his mail client.) I already know that most (if not all) of qemu-iotests is specifically /bin/bash. But if we want to, we can ditch -n and -z, and just use: if [[ $NBD_SNAPSHOT_PID ]]; then and similarly. In fact, I actually prefer embracing bash-isms when we know we are using bash, to make it obvious that we know we are not catering to /bin/sh. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/2] block: test 'blockdev-snapshot' using a file BDS as the overlay

2015-11-02 Thread Eric Blake
apshot_file}"'...' (if we wanted to write the command with " instead of ' for internal string quoting), or: cmd="...${snapshot_file}..." I suspect that it crept in because locally we have ' in the ..., and '${...}' in isolation is usually wrong (which is why you have to look at the full string, and not just the local change). > Since the latter is mainly out of curiosity, and because English too not > my mother language is, which is why I not the one be should, who himself > over that complains*: LOL -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

  1   2   3   4   5   6   7   8   9   10   >