From nobody Sun Feb 8 06:05:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557748363; cv=none; d=zoho.com; s=zohoarc; b=DeLnYXVlcx7GXMsPGVkVCAx+Lasw6YajhMUHcmkp8U+MLDSdBJpfR7amc9B2dbHIIhFHVP53yStx7dF/Rnj6v9+QKOZhfGrU4psCXOUfOUcO9+iDiA7P/hgL7LyZZ6FNshoMUKlUMAlwfYfMc2mp0mWdixbPdLDMVAK0qZZgi6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557748363; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=eLvi2OpKOxVK2HEplauEP9Zx9e3iMRWuAqnbBb+uzfw=; b=hFT202gMtY/LXoND4BxRakzhjkDs8FLEb1US+JmhMaHqCCSMr9r3qHGMykqN3HzkREHJvmLITFiu7PoNqOAY0EanryeSxE8+1rZBto6yF6mZMOYNVHPRaOWZNG7ht3Uv8oxOlifcpsUUzAPlZczbExbOfc118OQ0czldwMsxpS0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557748363176163.21410801578622; Mon, 13 May 2019 04:52:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6BCB73082231; Mon, 13 May 2019 11:52:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44D8E69292; Mon, 13 May 2019 11:52:41 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0DB7318052EE; Mon, 13 May 2019 11:52:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4DBqNZc031051 for ; Mon, 13 May 2019 07:52:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id CB3086843C; Mon, 13 May 2019 11:52:23 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.42.22.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42BED60C4D; Mon, 13 May 2019 11:52:23 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Mon, 13 May 2019 12:52:05 +0100 Message-Id: <20190513115206.1088-9-berrange@redhat.com> In-Reply-To: <20190513115206.1088-1-berrange@redhat.com> References: <20190513115206.1088-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [security-notice PATCH 8/9] scripts: fuzzy matching on subject to identify unannotated cherry picks X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 13 May 2019 11:52:42 +0000 (UTC) Sometimes fixes are mistakenly cherry picked into branches without using the '-x' flag to record the cherry pick master commit. Add fuzzy matching based on subject line to attempt to identify these fixes on branches. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: J=C3=A1n Tomko --- scripts/report-vulnerable-tags.pl | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/scripts/report-vulnerable-tags.pl b/scripts/report-vulnerable-= tags.pl index 6a0f7dc..c37416d 100644 --- a/scripts/report-vulnerable-tags.pl +++ b/scripts/report-vulnerable-tags.pl @@ -121,6 +121,38 @@ sub get_cherry_picks { return %cherrypicks; } =20 +sub get_fuzzy_picks { + my $branch =3D shift @_; + my $tag =3D shift @_; + + my %subjects; + + for my $commit (@fixed) { + open GIT, "-|", "git", "show", "--no-patch", "--format=3D%s", $commit + or die "cannot query 'git show --no-patch --format=3D%s $commit': $!"; + my $subject =3D ; + chomp $subject; + close GIT; + + $subjects{$subject} =3D $commit; + } + + open GIT, "-|", "git", "log", "--format=3D%H %s", "$tag..origin/$branc= h" or + die "cannot query 'git log --format=3D'%h %s' $tag..origin/$branch': $!\n= "; + + my $commit; + my %fuzzypicks; + while () { + if (/([a-zA-Z0-9]+)\s(.*)$/) { + if (exists $subjects{$2}) { + $fuzzypicks{$subjects{$2}} =3D $1; + } + } + } + + return %fuzzypicks; +} + sub add_branch { my $name =3D shift @_; =20 @@ -226,6 +258,20 @@ if (defined $fixed) { } } =20 + if (int(@missing)) { + my @unfixed =3D @missing; + my %fuzzypicks =3D get_fuzzy_picks($branch, $basetag); + @missing =3D (); + for my $commit (@unfixed) { + if (exists $fuzzypicks{$commit}) { + my $fuzzy =3D $fuzzypicks{$commit}; + add_fixed_commit($branch, $fuzzy); + } else { + push @missing, $commit; + } + } + } + # If all fixes on master exist on branch, then # identify any tags holding the last cherry-pick # so the branch gets marked as non-vulnerable. --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list