From nobody Sat Apr 27 16:52:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617292506; cv=none; d=zohomail.com; s=zohoarc; b=NRTERYSsgKT/vj7eXRBonp9nMU5SXsDSxhJt53qNjtpmoaGSxBiFHvYk0s1k6aUY3jFrU9ztOKV2CYRo9gAgdGDNvIhHEJPBGRdjuz+F/geotcM5g8ONC0yxO/PxUuhvQDW+5uFAXVICheOboy0EFDmP7PzWYDjoBQLcsXAVXps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617292506; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7Zt2U+rlMa9VuCgVf/rHyKTbY+ZUK4QYDedZmczriAk=; b=lnKrRjHkABdA4UndBqYnnCHJfX6vlcXuPmn+FIxU95YuOlHJT6H1jXuX98S4cxVl4p3Yf6zoY8DUoVTyOgcLmFW2gbGD9YhQ5AAWSKi8KQ/1cgpOBHYimRmEiA0eXMlu0wXlsS9JAHj/Shhxt0qrhMPYJyg3UfiYO4BeIZ8HrrQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617292506772240.466120771708; Thu, 1 Apr 2021 08:55:06 -0700 (PDT) Received: from localhost ([::1]:37766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRzez-0007Je-Ie for importer@patchew.org; Thu, 01 Apr 2021 11:55:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRzcL-0004yg-JE for qemu-devel@nongnu.org; Thu, 01 Apr 2021 11:52:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRzcF-0007lj-UU for qemu-devel@nongnu.org; Thu, 01 Apr 2021 11:52:21 -0400 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-485-k_SJC8vvNnigU18cJFGQsQ-1; Thu, 01 Apr 2021 11:52:14 -0400 Received: by mail-oo1-f71.google.com with SMTP id u30so2962201ooj.22 for ; Thu, 01 Apr 2021 08:52:14 -0700 (PDT) Received: from redhat.redhat.com (ip68-103-222-6.ks.ok.cox.net. [68.103.222.6]) by smtp.gmail.com with ESMTPSA id d21sm1093357oic.54.2021.04.01.08.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 08:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617292335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Zt2U+rlMa9VuCgVf/rHyKTbY+ZUK4QYDedZmczriAk=; b=bR7AFOlD7JKubkjzxDPqPTLi8wTlqgH5Y5ZD4Obc6RKS5+5hFeZtafhcwi5bkI4JhGsNmd Pe39EGn93/k+Qyyee5OWjmMX56tpNAdSHAWiKUOMOjBQfMdfRsIERJIv4iLw8j4DKFNv5Q AtmnEGJD+8fc46wLzU9RTeD+mYfWcQo= X-MC-Unique: k_SJC8vvNnigU18cJFGQsQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7Zt2U+rlMa9VuCgVf/rHyKTbY+ZUK4QYDedZmczriAk=; b=Cm/Vef3hawgnBDCD+kccCSkujU60onItfN8EN0+2dH7UOT/Jdbi0s3NrZ08JzOHSXb E9usZm9E2eGCHkBFBWpymuFrQ9KQ+Ag6yvaemuQ2Kg7UFlj/TS+fyIIUoaDDCcpKiFgw b8lIqYKQG8q/apR+9VmqYG++DvulioupAkuKd0KpL590Xb2VThSqoanOep3plbZhwBRi o4oBrQUvPTGsRXl7Uqw2VbPGNgrt5VcZaLVs6PaNzQwG0vmk8sf4kAarEf83cjQbzd+L 4ZBgOl1XoaiqvSfLd1Y25cGa4t7D/c3csWG34C3WzdxOMs54DK7MYh+FavK0JFoqc8jo FEwQ== X-Gm-Message-State: AOAM533ddsK93AkJXi4BFI70QWJWStpvmc9LK6vnAgDqd/UoFkwLzQeJ 7WN4sSGN64jMfS1lcAIYqS2XkNhAp2NZnrjSU1kcT4LJLfQMzVG6tsyfVKPp6rCO0K+O8AYOSDQ SGEarElP9xZTGZGI= X-Received: by 2002:a05:6808:ab0:: with SMTP id r16mr6178877oij.34.1617292333485; Thu, 01 Apr 2021 08:52:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtiiklR7qRY20k0t+XHTBI7qGXeAImnTjcc0x9BkTzT+wrnBgQ66XajL0EnJW3cgZLPiqPGw== X-Received: by 2002:a05:6808:ab0:: with SMTP id r16mr6178864oij.34.1617292333310; Thu, 01 Apr 2021 08:52:13 -0700 (PDT) From: Connor Kuehl To: qemu-block@nongnu.org Subject: [PATCH 1/2] iotests/231: Update expected deprecation message Date: Thu, 1 Apr 2021 10:52:10 -0500 Message-Id: <20210401155211.2093139-2-ckuehl@redhat.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210401155211.2093139-1-ckuehl@redhat.com> References: <20210401155211.2093139-1-ckuehl@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ckuehl@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=ckuehl@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, dillaman@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The deprecation message changed slightly at some point in the past but the expected output wasn't updated along with it; causing it to fail. Fix it, so it passes. Signed-off-by: Connor Kuehl Reviewed-by: Max Reitz --- tests/qemu-iotests/231.out | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/qemu-iotests/231.out b/tests/qemu-iotests/231.out index 579ba11c16..747dd221bb 100644 --- a/tests/qemu-iotests/231.out +++ b/tests/qemu-iotests/231.out @@ -1,9 +1,7 @@ QA output created by 231 -qemu-img: RBD options encoded in the filename as keyvalue pairs is depreca= ted. Future versions may cease to parse these options in the future. +qemu-img: warning: RBD options encoded in the filename as keyvalue pairs i= s deprecated unable to get monitor info from DNS SRV with service name: ceph-mon -no monitors specified to connect to. qemu-img: Could not open 'json:{'file.driver':'rbd','file.filename':'rbd:r= bd/bogus:conf=3DBOGUS_CONF'}': error connecting: No such file or directory unable to get monitor info from DNS SRV with service name: ceph-mon -no monitors specified to connect to. qemu-img: Could not open 'json:{'file.driver':'rbd','file.pool':'rbd','fil= e.image':'bogus','file.conf':'BOGUS_CONF'}': error connecting: No such file= or directory *** done --=20 2.30.2 From nobody Sat Apr 27 16:52:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617292397; cv=none; d=zohomail.com; s=zohoarc; b=eixDRG0lnILkKyq450qOmbnNo3s3rwVqwYqD4ReZCjXFX2mamC/TnRTPNsqV4m6rOJxgNXtwdh5IRxRSp7R35nsc2E4ukI9D1rr8OLaPLaRZ4RdRzCZUgSa3vnFbX5426vd57hoJv6RNM50LzOHa59Lr0zBQCUPAegAAY9usKks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617292397; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8hJliMhByCo9Bbq9sOssJubAEcDpWWt97l41J858uQ0=; b=mN7b40JQXz9/4EHe/wycryr56ZOaEllVvQqnCLA4xHgSCqzJb6x0TtsEin26TKh60BTTvKQuqmly5mSDD3fqYcUoClBGjODtnfOlwXsHnKiEwQla3BaHMX/cDqCZydN1SVr6v6wyP7dg1NuCv1bOZ35W0uZLDCoM87CHNLM/kFc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617292397087704.7962341704518; Thu, 1 Apr 2021 08:53:17 -0700 (PDT) Received: from localhost ([::1]:34092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRzdD-0005qd-V3 for importer@patchew.org; Thu, 01 Apr 2021 11:53:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRzcJ-0004wP-Rh for qemu-devel@nongnu.org; Thu, 01 Apr 2021 11:52:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRzcH-0007mT-7F for qemu-devel@nongnu.org; Thu, 01 Apr 2021 11:52:19 -0400 Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-109-BBX_q6RKPEGzo4ssYqLSFA-1; Thu, 01 Apr 2021 11:52:15 -0400 Received: by mail-ot1-f72.google.com with SMTP id 45so2712533otg.10 for ; Thu, 01 Apr 2021 08:52:14 -0700 (PDT) Received: from redhat.redhat.com (ip68-103-222-6.ks.ok.cox.net. [68.103.222.6]) by smtp.gmail.com with ESMTPSA id d21sm1093357oic.54.2021.04.01.08.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 08:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617292336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8hJliMhByCo9Bbq9sOssJubAEcDpWWt97l41J858uQ0=; b=eMZ7IExOaVXvtYyF1SAOjL9K2vRVseDcY4Z8IPi/mNPa5j7J8w7Bs8co0ba3vB3NY+vcxD 7Bufz+5+i9kfcIofucYs8Wg8ONnM6sdCaiku4t5JqMSEndsToSAzP+m1HRWl90FIH2uqA4 j7w7jaalmofRt1f+xU8Swr9852BtgCM= X-MC-Unique: BBX_q6RKPEGzo4ssYqLSFA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8hJliMhByCo9Bbq9sOssJubAEcDpWWt97l41J858uQ0=; b=Y5kuOXfCYCipDlOTidjd9hBzybYnPM7zoUJRVVXSf5WhfSyEtO67XkypjdLDHxP1Ii vI+vqALdY/wq2FE+9Ra3iKg1n4T054r4DwMb3UNSgt7K2H2CUGGxeyCVqTSfOaveDbmK j5ku9O3RcVreDM/YeXAZtKYcIH1CLg1O9OUsLPrumZdk38eyTMcXuXHngZ2Y8IkWPQTD 81hFMsUsACDut6TdBLk+4iP+6VKZ/obKU+kOSGewg5+oVh3NMKnB+teMzxBbt3yTH3fp hgTiLlTNHvjl1sxwtHk4XqU9S8n7KrIvwO190lTFpDOkpqJH1wPJO5xsf8MZ/fyMC5NN qAhg== X-Gm-Message-State: AOAM5329Z9HQ8AsZ2lfMjHSLkJko6+bTSwaApJPiXnH7mlneT/PtgZRw Qb/+YOPhJaFCZW3/h/ZjknXjHQ7AYtlUXx3CppBm2tA9o4r3q2RAU7aqckwpmqayIWgbGTdJ3fK QiZ8v0t9XOSruTVM= X-Received: by 2002:a9d:8d5:: with SMTP id 79mr7515915otf.345.1617292334317; Thu, 01 Apr 2021 08:52:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIy1/8yHRqPnvrVf/iRfQ83oEQDRDpUnrUpV2ZddSdkMBcf/NjrYf86MuDw7vWg8VCF2nxFg== X-Received: by 2002:a9d:8d5:: with SMTP id 79mr7515907otf.345.1617292334134; Thu, 01 Apr 2021 08:52:14 -0700 (PDT) From: Connor Kuehl To: qemu-block@nongnu.org Subject: [PATCH 2/2] block/rbd: Don't unescape in qemu_rbd_next_tok() Date: Thu, 1 Apr 2021 10:52:11 -0500 Message-Id: <20210401155211.2093139-3-ckuehl@redhat.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210401155211.2093139-1-ckuehl@redhat.com> References: <20210401155211.2093139-1-ckuehl@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ckuehl@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=ckuehl@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, dillaman@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" That's qemu_rbd_unescape()'s job! No need to duplicate the labor. Furthermore, this was causing some confusion in the parsing logic to where the caller might test for the presence of a character to split on like so: if (strchr(image_name, '/')) { found_str =3D qemu_rbd_next_tok(image_name, '/', &image_name); [..] When qemu_rbd_next_tok() performs unescaping as a side effect, the parser can get confused thinking that it can split this string, but really the delimiter '/' gets unescaped and so qemu_rbd_next_tok() never "finds" the delimiter and consumes the rest of the token input stream. This is problematic because qemu_rbd_next_tok() also steals the input pointer to the token stream and sets it to NULL. This causes a segfault where the parser expects to split one string into two. In this case, the parser is determining if a string is a namespace/image_name pair like so: "foo/bar" And clearly it's looking to split it like so: namespace: foo image_name: bar but if the input is "foo\/bar", it *should* split into namespace: foo\ image_name: bar and its subordinate parts can be unescaped after tokenization. So, instead of tokenizing *and* escaping all at once, do one before the other to avoid stumbling into a segfault by confusing the parsing logic. Reported-by: Han Han Fixes: https://bugzilla.redhat.com/1873913 Signed-off-by: Connor Kuehl --- block/rbd.c | 3 --- tests/qemu-iotests/231 | 4 ++++ tests/qemu-iotests/231.out | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index 9071a00e3f..9bed0863e5 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -123,9 +123,6 @@ static char *qemu_rbd_next_tok(char *src, char delim, c= har **p) if (*end =3D=3D delim) { break; } - if (*end =3D=3D '\\' && end[1] !=3D '\0') { - end++; - } } if (*end =3D=3D delim) { *p =3D end + 1; diff --git a/tests/qemu-iotests/231 b/tests/qemu-iotests/231 index 0f66d0ca36..8e6c6447c1 100755 --- a/tests/qemu-iotests/231 +++ b/tests/qemu-iotests/231 @@ -55,6 +55,10 @@ _filter_conf() $QEMU_IMG info "json:{'file.driver':'rbd','file.filename':'rbd:rbd/bogus:c= onf=3D${BOGUS_CONF}'}" 2>&1 | _filter_conf $QEMU_IMG info "json:{'file.driver':'rbd','file.pool':'rbd','file.image':'= bogus','file.conf':'${BOGUS_CONF}'}" 2>&1 | _filter_conf =20 +# Regression test: the qemu-img invocation is expected to fail, but it sho= uld +# not seg fault the parser. +$QEMU_IMG create "rbd:rbd/aa\/bb:conf=3D${BOGUS_CONF}" 1M 2>&1 | _filter_c= onf + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/231.out b/tests/qemu-iotests/231.out index 747dd221bb..a785a6e859 100644 --- a/tests/qemu-iotests/231.out +++ b/tests/qemu-iotests/231.out @@ -4,4 +4,7 @@ unable to get monitor info from DNS SRV with service name: = ceph-mon qemu-img: Could not open 'json:{'file.driver':'rbd','file.filename':'rbd:r= bd/bogus:conf=3DBOGUS_CONF'}': error connecting: No such file or directory unable to get monitor info from DNS SRV with service name: ceph-mon qemu-img: Could not open 'json:{'file.driver':'rbd','file.pool':'rbd','fil= e.image':'bogus','file.conf':'BOGUS_CONF'}': error connecting: No such file= or directory +Formatting 'rbd:rbd/aa\/bb:conf=3DBOGUS_CONF', fmt=3Draw size=3D1048576 +unable to get monitor info from DNS SRV with service name: ceph-mon +qemu-img: rbd:rbd/aa\/bb:conf=3DBOGUS_CONF: error connecting: No such file= or directory *** done --=20 2.30.2