From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id D7C2D1FF0B4 for ; Tue, 10 Nov 2026 12:48:30 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 033E92158E; Tue, 10 Nov 2026 12:48:27 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server] fix #8251: migrate: nbd: align check for absolute path on target side Date: Tue, 10 Nov 2026 12:47:21 +0100 Message-ID: <20261110114818.78160-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794311301623 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.286 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: QMFMI55IBSSW3DT5TMQHSJ73A6NZ4P5J X-Message-ID-Hash: QMFMI55IBSSW3DT5TMQHSJ73A6NZ4P5J X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: A migration with both NBD storage migration and a passed-through device (with shared=1, otherwise migration fails on the source side already) would fail with "unable to parse volume ID 'XYZ'" on the target side. The problematic call is parse_volume_id() in vm_migrate_get_nbd_disks(). Without NBD storage migration, this is not reached. Fix the bug by adding the same check for absolute paths that scan_local_volumes() does on the source side. Note that remote migration does not use vm_migrate_get_nbd_disks(), but does its own NBD handling and absolute paths are limited to 'root@pam' only, so a configuration with absolute paths is denied for the API token used for remote migration, when the volume access is checked. Signed-off-by: Fiona Ebner --- src/PVE/QemuServer.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index 8149184e..9f8c7b13 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -5225,6 +5225,12 @@ sub vm_migrate_get_nbd_disks { return if !$volid; + # Matching the check in scan_local_volumes(). + if ($volid =~ m|^/|) { + return if $drive->{shared}; + die "$ds: unexpected non-shared local file/device '$volid'\n"; + } + my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid); my $scfg = PVE::Storage::storage_config($storecfg, $storeid); -- 2.47.3