Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A10EE77188 for ; Mon, 30 Dec 2024 09:53:41 +0000 (UTC) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by mx.groups.io with SMTP id smtpd.web11.60053.1735552410644760616 for ; Mon, 30 Dec 2024 01:53:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Ad4RRAKp; spf=pass (domain: bootlin.com, ip: 217.70.183.200, mailfrom: mathieu.dubois-briand@bootlin.com) Received: by mail.gandi.net (Postfix) with ESMTPSA id F062020007; Mon, 30 Dec 2024 09:53:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1735552408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tx8maRlN/IBRSBlJm1ct/+jHQzqvS5tTQcnkWOzI3PM=; b=Ad4RRAKpoUHbqc8EFCUcUCZxtc5dJMXWilPWI5MRMbVOG3pQyT7iUt1TrOgHl2ZbATkogl 5jAnuTvh2Y6WgA/1+2+MvqY+6BoA3Dy5YFYRRXmqT78HwjkFf0rvZRB+d1yo+639pPAlr4 o0JDXmjyImHhyYr9w8m43nlGONHTkgyYl2cNab5tNuDnJaerug9jn3L/vovpLeRzVugw89 lFr3El3VnrSmH6jvJK4Z7/h3zQ8lOaiR+fmyiFYYckUddH/b/YyM2mGCXflvBIMszu1xG7 YpMCyQBb34qoE1rKGW507+7r9SvbpyN06neFjU8XPDe3dTcXvd9P+wPLtlpWqA== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 30 Dec 2024 10:53:27 +0100 Message-Id: Subject: Re: [OE-core] [PATCH] cve-check: Rework patch parsing From: "Mathieu Dubois-Briand" To: , X-Mailer: aerc 0.18.2-0-ge037c095a049 References: <20241228182757.2346256-1-colinmca242@gmail.com> In-Reply-To: <20241228182757.2346256-1-colinmca242@gmail.com> X-GND-Sasl: mathieu.dubois-briand@bootlin.com List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 30 Dec 2024 09:53:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/209154 On Sat Dec 28, 2024 at 7:27 PM CET, Colin McAllister via lists.openembedded= .org wrote: > The cve_check functionality to parse CVE IDs from the patch filename and > patch contents have been reworked to improve parsing and also add tests. > This ensures that the parsing works as intended. > > Signed-off-by: Colin McAllister > --- Hi Colin, It looks like this patch is causing a break on the autobuilder, with the following error: ERROR: libidn2-2.3.7-r0 do_cve_check: Error executing a python function in = exec_func_python() autogenerated: The stack trace of python calls that resulted in this exception/failure was= : File: 'exec_func_python() autogenerated', lineno: 2, function: 0001: *** 0002:do_cve_check(d) 0003: File: '/srv/pokybuild/yocto-worker/oe-selftest-debian/build/meta/classes/cv= e-check.bbclass', lineno: 184, function: do_cve_check 0180: try: 0181: patched_cves =3D get_patched_cves(d) 0182: except FileNotFoundError: 0183: bb.fatal("Failure in searching patches") *** 0184: cve_data, status =3D check_cves(d, patched_cves) 0185: if len(cve_data) or (d.getVar("CVE_CHECK_COVERAGE") = =3D=3D "1" and status): 0186: get_cve_info(d, cve_data) 0187: cve_write_data(d, cve_data, status) 0188: else: File: '/srv/pokybuild/yocto-worker/oe-selftest-debian/build/meta/classes/cv= e-check.bbclass', lineno: 423, function: check_cves 0419: product_cursor.close() 0420: 0421: if not vulnerable: 0422: bb.note("%s-%s is not vulnerable to %s" % (pn, re= al_pv, cve)) *** 0423: cve_update(d, cve_data, cve, {"abbrev-status": "P= atched", "status": "version-not-in-range"}) 0424: cve_cursor.close() 0425: 0426: if not cves_in_product: 0427: bb.note("No CVE records found for product %s, pn %s" = % (product, pn)) File: '/srv/pokybuild/yocto-worker/oe-selftest-debian/build/meta/classes/cv= e-check.bbclass', lineno: 287, function: cve_update 0283: 0284:def cve_update(d, cve_data, cve, entry): 0285: # If no entry, just add it 0286: if cve not in cve_data: *** 0287: cve_data[cve] =3D entry 0288: return 0289: # If we are updating, there might be change in the status 0290: bb.debug("Trying CVE entry update for %s from %s to %s" % (cv= e, cve_data[cve]['abbrev-status'], entry['abbrev-status'])) 0291: if cve_data[cve]['abbrev-status'] =3D=3D "Unknown": Exception: TypeError: 'set' object does not support item assignment https://valkyrie.yoctoproject.org/#/builders/35/builds/683/steps/14/logs/st= dio On first read, it looks like get_patched_cves() was previously returning a dictionary and is now returning a set(). Can you fix this please ? --=20 Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com