From patchwork Thu Dec 3 05:33:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasanth R X-Patchwork-Id: 107054 Received: from mail-dy1-f178.google.com (mail-dy1-f178.google.com [74.125.82.178]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.7895.1796276041288039690 for ; Wed, 02 Dec 2026 21:34:01 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=AvUWPOin; spf=pass (domain: gmail.com, ip: 74.125.82.178, mailfrom: ragaprasanth@gmail.com) Received: by mail-dy1-f178.google.com with SMTP id 5a478bee46e88-38747f42472so14467eec.0 for ; Wed, 02 Dec 2026 21:34:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796276041; x=1796880841; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=F4QWCobdE1UGvW4V+uqRbaqh4VeCBVefARDFwOyEyJo=; b=AvUWPOin8GQjO1mJcQZChr6Lf+PaiK+7dNT9xhpHOl1GUOJYEbZiJsHMQtMMUNboGw I6J+kgvswVd8IzQb80MQoMnAR8hxlaLBq3Epy0xcrg7F37SIx6KL49fQXDBfvcP0rygA UIVSn4A8wNGUOXjRPWzbnx75TEqoYw0s8JGInqF/gSo/oTUkq7/hVkm/CeFW+QGRQIPg PLTXpWd3wjCjhMTrHCxH2CKycD8pK9YnFJPDKoECD/x/NjnkP6EwlHiVZEd2VYdJLiTn 1dLZG1VI186G8R3+loDjrhFVpw9Z9r6RpF+UoZNn2JikbOKNUVyZDzz67RLx1krwec06 ERew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796276041; x=1796880841; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date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PyeEQagoxASgFCbnYCjgsvl3zyFj3ZbCFbeEpRUenWNEwJsOoWsWv7nvysBO9yc7v r4cHpWCuTBcUDM5zgQQ6fko7uRnsVzqI3PxXtIDNe6b1KsyOWt8hl+C0xtnuNT++UOtL50t0T9B 6m+cOYUgXng== X-Received: by 2002:a05:7301:1402:b0:375:ed63:5f12 with SMTP id 5a478bee46e88-3856fe564admr46968542eec.22.1796276040440; Wed, 02 Dec 2026 21:34:00 -0800 (PST) Return-Path: Received: from prasanth.alps.lineo.co.jp (vpn1.lineo.co.jp. [203.141.200.204]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38744b79d1fsm2345709eec.30.2026.12.02.21.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 21:33:59 -0800 (PST) From: Prasanth R To: openembedded-core@lists.openembedded.org Cc: Daniel Turull , Prasanth R Subject: [PATCH 1/2] improve_kernel_cve_report: stop when debug sources list no files Date: Thu, 3 Dec 2026 14:33:47 +0900 Message-Id: <20261203053348.4024389-1-ragaprasanth@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Thu, 03 Dec 2026 05:34:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251872 A kernel built without debug info (CONFIG_DEBUG_INFO_NONE) has only empty entries in its debugsources file, and the script fails with an IndexError. Skipping them is not enough: with no compiled files left, every CVE would be ignored as not applicable. Skip entries without a path and stop with a clear message if nothing is left. Found with linux-fslc for imx6qdlsabresd. AI-Generated: Uses Claude Signed-off-by: Prasanth R --- scripts/contrib/improve_kernel_cve_report.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/contrib/improve_kernel_cve_report.py b/scripts/contrib/improve_kernel_cve_report.py index 41cbc1e222..76ba54d835 100755 --- a/scripts/contrib/improve_kernel_cve_report.py +++ b/scripts/contrib/improve_kernel_cve_report.py @@ -252,8 +252,14 @@ def read_debugsources(file_path): # We need to remove one level from the debug sources for source_list in json_data.values(): for source in source_list: + # entries are empty if the kernel has no debug info + if "/" not in source: + continue src = source.split("/",1)[1] cfiles.add(src) + if not cfiles: + sys.exit(f"{file_path} lists no compiled sources: " + "is the kernel built without debug info (CONFIG_DEBUG_INFO)?") return cfiles def check_kernel_compiled_files(compiled_files, cve_info): From patchwork Thu Dec 3 05:33:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasanth R X-Patchwork-Id: 107055 Received: from mail-dy1-f172.google.com (mail-dy1-f172.google.com [74.125.82.172]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.7896.1796276042483919447 for ; Wed, 02 Dec 2026 21:34:02 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=KMSsg/ra; spf=pass (domain: gmail.com, ip: 74.125.82.172, mailfrom: ragaprasanth@gmail.com) Received: by mail-dy1-f172.google.com with SMTP id 5a478bee46e88-3863db981d4so19045359eec.0 for ; Wed, 02 Dec 2026 21:34:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796276042; x=1796880842; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6lVk7EAz8guEDoqEQW/5w9yaJ+NFd6OYsGYIrQigxLY=; b=KMSsg/ra+4o5hT+oBaFRnDlf6HUJ0mp1Nm9n0bqMOdUxPrfF4uW7oTBb9eWPDjkd2a EOH0KqiT1YJfCFfD+LTPrIJ0sVLMT7AISlYrBEfL1h4Z1N70Wjdq6hvGJazEjgWjWtkV bSdhxLrMoF3QoB1NCAh5IjYIuDhImHbql1xmnlBdtKWYuH/cOGjD7ZG53BEN333Cw8mV NR/dOQ90Y01r8rVWKdobqinuXLGawcmB9QlVYTTD+jEjtkzKEQv4vS3HHt2N53R1py3R ysqERTEcPigenLyRm3yyXyoxyildsjzIHBKIEFPpXn47biFL4lNKOyFK0A9Hs0xE7O4b oBEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796276042; x=1796880842; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=6lVk7EAz8guEDoqEQW/5w9yaJ+NFd6OYsGYIrQigxLY=; b=lz5DwmztLzeZjMc78KU8uWVMGAhbPmHKo/GIJpw4xkKZ0rCRw9ve4iQ+GZMUcpZ/X9 Er9XBufNbbfizECyDOW+jmfNYpGHF0KI/SgehIaL9HajJkWvTE3L7w+NyOSpLrmpmaC2 HyG1IcTb8hyiGc0VSwMNZJsOvOIsRcD9enBv4abmx8u5GPEOBrV9xVU1ZP/DIrWPZH8F dGQv+M3fpa6XJ/wkhMIQfqGEsS71V4viZy0E5SLAL2EL2R7lcw7EKkch2mwQQed1uiQb zgqI8RiRsJSnkkHHkF5qJdNs1iKyPV8ppSXIM+PtlHQHE9OKo+0cm4A1CHo771SUrgNj NfzA== X-Gm-Message-State: APuU4Z8p/6pTt/LSbu+jR8Tv9Vu3GATi4T4m//1RB34V60ifj2iwQ0Dz ZtJs+65qLLc+0oFlobtK13g4macQOMBlogmrcXkt51xPxiAalgUqj8Wj/w40tWDX X-Gm-Gg: AZFdTZdISdiu1MIr39PmQJg3Q88Mc4J49MQcLat7qnZWuelDsX++8+1fTwBtObm3s9F z4iY/PvFlM9Zld4UNil0yw82/yWOz3VP1wbQpbEGSJUCLo6c+iCtPac5Zj2FhVrYe0ntNEgpl1i ZXpewe3YjqHC34AVL1dFHxXeUGCExX68I+g7raqoeUgDT+cM2wWVOmtI0xYpRLZjd2BMTO2L2SO iN83ROFfAoGKPBeQpjZvig5DbhrtOIujGpm7kDiy7fZxNU/P5n6qY8LNRMxctU+IWIt2iEtGZqW pvuXalOfEbAxic44s8BtMx/J/L62Mn8LCDjPSohHBPbBacG+sYYUMSTdMcO2HFr5IM8iYvrmVzf uww+tcEmOjWgyiLVMph1oupOisX+I7EtmJ22sQXgikWXTJyG95wNSZglZJVG4yllnoExMMXFGO6 eRGjNRNcErlA98Bm0OzMZ2xXjWkhoGrxgPByLZs4nwmuLU+5mOlN+jpdY6unSOnBxpObd1iqAFh xOxLR11k4A/CNzjGESPlnDPWO8gGz9O1My6fZx7gcdkG239VB6RTu5F93ajorxplib3x7zOwRf3 ZNAIiR4UzI1upXJDLRX1lVNEWDQR9LPrW7kX2lXNnIzZowmCl2bpIBaUQG2DoPij X-Received: by 2002:a05:7301:10c4:b0:386:d310:4c1c with SMTP id 5a478bee46e88-386d3104c52mr32993604eec.21.1796276041731; Wed, 02 Dec 2026 21:34:01 -0800 (PST) Return-Path: Received: from prasanth.alps.lineo.co.jp (vpn1.lineo.co.jp. [203.141.200.204]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38744b79d1fsm2345709eec.30.2026.12.02.21.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 21:34:01 -0800 (PST) From: Prasanth R To: openembedded-core@lists.openembedded.org Cc: Daniel Turull , Prasanth R Subject: [PATCH 2/2] improve_kernel_cve_report: use the zstd tool if zstandard is missing Date: Thu, 3 Dec 2026 14:33:48 +0900 Message-Id: <20261203053348.4024389-2-ragaprasanth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261203053348.4024389-1-ragaprasanth@gmail.com> References: <20261203053348.4024389-1-ragaprasanth@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Thu, 03 Dec 2026 05:34:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251873 The python zstandard module is not installed on all build hosts, but the zstd tool is a Yocto host requirement. Fall back to 'zstd -dc' when the module is not available. AI-Generated: Uses Claude Signed-off-by: Prasanth R --- scripts/contrib/improve_kernel_cve_report.py | 33 +++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/scripts/contrib/improve_kernel_cve_report.py b/scripts/contrib/improve_kernel_cve_report.py index 76ba54d835..3446527654 100755 --- a/scripts/contrib/improve_kernel_cve_report.py +++ b/scripts/contrib/improve_kernel_cve_report.py @@ -240,23 +240,28 @@ def read_debugsources(file_path): ''' Read zstd file from pkgdata to extract sources ''' - import zstandard as zstd import itertools # Decompress the .zst file cfiles = set() - with open(file_path, 'rb') as fh: - dctx = zstd.ZstdDecompressor() - with dctx.stream_reader(fh) as reader: - decompressed_bytes = reader.read() - json_data = json.loads(decompressed_bytes) - # We need to remove one level from the debug sources - for source_list in json_data.values(): - for source in source_list: - # entries are empty if the kernel has no debug info - if "/" not in source: - continue - src = source.split("/",1)[1] - cfiles.add(src) + try: + import zstandard as zstd + with open(file_path, 'rb') as fh: + with zstd.ZstdDecompressor().stream_reader(fh) as reader: + decompressed_bytes = reader.read() + except ImportError: + # zstd is a Yocto host tool: use it if the python module is missing + import subprocess + decompressed_bytes = subprocess.run(["zstd", "-dc", file_path], + check=True, capture_output=True).stdout + json_data = json.loads(decompressed_bytes) + # We need to remove one level from the debug sources + for source_list in json_data.values(): + for source in source_list: + # entries are empty if the kernel has no debug info + if "/" not in source: + continue + src = source.split("/",1)[1] + cfiles.add(src) if not cfiles: sys.exit(f"{file_path} lists no compiled sources: " "is the kernel built without debug info (CONFIG_DEBUG_INFO)?")