From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id CF2D69394A for ; Tue, 21 Feb 2023 13:21:09 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B8A0525B8 for ; Tue, 21 Feb 2023 13:21:09 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 21 Feb 2023 13:21:06 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id DDF8247EC5 for ; Tue, 21 Feb 2023 13:21:05 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Tue, 21 Feb 2023 13:21:02 +0100 Message-Id: <20230221122102.85312-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.003 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, gitlab.com] Subject: [pve-devel] [PATCH qemu] add fix for iscsi double free issue leading to crashes X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2023 12:21:09 -0000 Reported here[0] and here[1]. [0]: https://gitlab.com/qemu-project/qemu/-/issues/1378 [1]: https://forum.proxmox.com/threads/122776/ Signed-off-by: Fiona Ebner --- Another reentrancy issue ;) ...double-free-on-BUSY-or-similar-statu.patch | 32 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 33 insertions(+) create mode 100644 debian/patches/extra/0009-block-iscsi-fix-double-free-on-BUSY-or-similar-statu.patch diff --git a/debian/patches/extra/0009-block-iscsi-fix-double-free-on-BUSY-or-similar-statu.patch b/debian/patches/extra/0009-block-iscsi-fix-double-free-on-BUSY-or-similar-statu.patch new file mode 100644 index 0000000..fe57e02 --- /dev/null +++ b/debian/patches/extra/0009-block-iscsi-fix-double-free-on-BUSY-or-similar-statu.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Tue, 10 Jan 2023 17:36:33 +0100 +Subject: [PATCH] block/iscsi: fix double-free on BUSY or similar statuses + +Commit 8c460269aa77 ("iscsi: base all handling of check condition on +scsi_sense_to_errno", 2019-07-15) removed a "goto out" so that the +same coroutine is re-entered twice; once from iscsi_co_generic_cb, +once from the timer callback iscsi_retry_timer_expired. This can +cause a crash. + +Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1378 +Reported-by: Grzegorz Zdanowski +Signed-off-by: Paolo Bonzini +(cherry-picked from commit 5080152e2ef6cde7aa692e29880c62bd54acb750) +Signed-off-by: Fiona Ebner +--- + block/iscsi.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/block/iscsi.c b/block/iscsi.c +index 3ed4a50c0d..89cd032c3a 100644 +--- a/block/iscsi.c ++++ b/block/iscsi.c +@@ -268,6 +268,7 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status, + timer_mod(&iTask->retry_timer, + qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + retry_time); + iTask->do_retry = 1; ++ return; + } else if (status == SCSI_STATUS_CHECK_CONDITION) { + int error = iscsi_translate_sense(&task->sense); + if (error == EAGAIN) { diff --git a/debian/patches/series b/debian/patches/series index 3ecc9d9..7a85c63 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,6 +6,7 @@ extra/0005-vhost-fix-vq-dirty-bitmap-syncing-when-vIOMMU-is-ena.patch extra/0006-virtio-rng-pci-fix-migration-compat-for-vectors.patch extra/0007-block-fix-detect-zeroes-with-BDRV_REQ_REGISTERED_BUF.patch extra/0008-memory-prevent-dma-reentracy-issues.patch +extra/0009-block-iscsi-fix-double-free-on-BUSY-or-similar-statu.patch bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch bitmap-mirror/0002-drive-mirror-add-support-for-conditional-and-always-.patch bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch -- 2.30.2