qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL for-8.1 0/1] NBD patches for 2023-07-28
@ 2023-07-28 14:55 Eric Blake
  2023-07-28 14:55 ` [PULL 1/1] qemu-nbd: regression with arguments passing into nbd_client_thread() Eric Blake
  2023-07-28 19:24 ` [PULL for-8.1 0/1] NBD patches for 2023-07-28 Richard Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Blake @ 2023-07-28 14:55 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit ccdd31267678db9d80578b5f80bbe94141609ef4:

  Merge tag 'pull-qapi-2023-07-26-v2' of https://repo.or.cz/qemu/armbru into staging (2023-07-26 07:16:19 -0700)

are available in the Git repository at:

  https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2023-07-28

for you to fetch changes up to e5b815b0defcc3617f473ba70c3e675ef0ee69c2:

  qemu-nbd: regression with arguments passing into nbd_client_thread() (2023-07-27 08:33:44 -0500)

----------------------------------------------------------------
NBD patches for 2023-07-28

- Denis V. Lunev: Fix regression in 'qemu-nbd -c /dev/nbdN'

----------------------------------------------------------------
Denis V. Lunev (1):
      qemu-nbd: regression with arguments passing into nbd_client_thread()

 qemu-nbd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

base-commit: ccdd31267678db9d80578b5f80bbe94141609ef4
-- 
2.41.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PULL 1/1] qemu-nbd: regression with arguments passing into nbd_client_thread()
  2023-07-28 14:55 [PULL for-8.1 0/1] NBD patches for 2023-07-28 Eric Blake
@ 2023-07-28 14:55 ` Eric Blake
  2023-07-28 19:24 ` [PULL for-8.1 0/1] NBD patches for 2023-07-28 Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2023-07-28 14:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Denis V. Lunev, Vladimir Sementsov-Ogievskiy, qemu-stable,
	open list:Network Block Dev...

From: "Denis V. Lunev" <den@openvz.org>

Unfortunately
    commit 03b67621445d601c9cdc7dfe25812e9f19b81488
    Author: Denis V. Lunev <den@openvz.org>
    Date:   Mon Jul 17 16:55:40 2023 +0200
    qemu-nbd: pass structure into nbd_client_thread instead of plain char*
has introduced a regression. struct NbdClientOpts resides on stack inside
'if' block. This specifically means that this stack space could be reused
once the execution will leave that block of the code.

This means that parameters passed into nbd_client_thread could be
overwritten at any moment.

The patch moves the data to the namespace of main() function effectively
preserving it for the whole process lifetime.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Eric Blake <eblake@redhat.com>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
CC: <qemu-stable@nongnu.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230727105828.324314-1-den@openvz.org>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 qemu-nbd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/qemu-nbd.c b/qemu-nbd.c
index 5b2757920c1..aaccaa33184 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -589,6 +589,9 @@ int main(int argc, char **argv)
     const char *pid_file_name = NULL;
     const char *selinux_label = NULL;
     BlockExportOptions *export_opts;
+#if HAVE_NBD_DEVICE
+    struct NbdClientOpts opts;
+#endif

 #ifdef CONFIG_POSIX
     os_setup_early_signal_handling();
@@ -1145,7 +1148,7 @@ int main(int argc, char **argv)
     if (device) {
 #if HAVE_NBD_DEVICE
         int ret;
-        struct NbdClientOpts opts = {
+        opts = (struct NbdClientOpts) {
             .device = device,
             .fork_process = fork_process,
             .verbose = verbose,
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PULL for-8.1 0/1] NBD patches for 2023-07-28
  2023-07-28 14:55 [PULL for-8.1 0/1] NBD patches for 2023-07-28 Eric Blake
  2023-07-28 14:55 ` [PULL 1/1] qemu-nbd: regression with arguments passing into nbd_client_thread() Eric Blake
@ 2023-07-28 19:24 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2023-07-28 19:24 UTC (permalink / raw)
  To: Eric Blake, qemu-devel

On 7/28/23 07:55, Eric Blake wrote:
> The following changes since commit ccdd31267678db9d80578b5f80bbe94141609ef4:
> 
>    Merge tag 'pull-qapi-2023-07-26-v2' of https://repo.or.cz/qemu/armbru into staging (2023-07-26 07:16:19 -0700)
> 
> are available in the Git repository at:
> 
>    https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2023-07-28
> 
> for you to fetch changes up to e5b815b0defcc3617f473ba70c3e675ef0ee69c2:
> 
>    qemu-nbd: regression with arguments passing into nbd_client_thread() (2023-07-27 08:33:44 -0500)
> 
> ----------------------------------------------------------------
> NBD patches for 2023-07-28
> 
> - Denis V. Lunev: Fix regression in 'qemu-nbd -c /dev/nbdN'

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/8.1 as appropriate.


r~


> 
> ----------------------------------------------------------------
> Denis V. Lunev (1):
>        qemu-nbd: regression with arguments passing into nbd_client_thread()
> 
>   qemu-nbd.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> base-commit: ccdd31267678db9d80578b5f80bbe94141609ef4



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-07-28 20:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-28 14:55 [PULL for-8.1 0/1] NBD patches for 2023-07-28 Eric Blake
2023-07-28 14:55 ` [PULL 1/1] qemu-nbd: regression with arguments passing into nbd_client_thread() Eric Blake
2023-07-28 19:24 ` [PULL for-8.1 0/1] NBD patches for 2023-07-28 Richard Henderson

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