Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] improve_kernel_cve_report: stop when debug sources list no files
@ 2026-12-03  5:33 Prasanth R
  2026-12-03  5:33 ` [PATCH 2/2] improve_kernel_cve_report: use the zstd tool if zstandard is missing Prasanth R
  0 siblings, 1 reply; 4+ messages in thread
From: Prasanth R @ 2026-12-03  5:33 UTC (permalink / raw)
  To: openembedded-core; +Cc: Daniel Turull, Prasanth R

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 <prasanth.r@lineo.co.jp>
---
 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):
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-04 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  5:33 [PATCH 1/2] improve_kernel_cve_report: stop when debug sources list no files Prasanth R
2026-12-03  5:33 ` [PATCH 2/2] improve_kernel_cve_report: use the zstd tool if zstandard is missing Prasanth R
2026-12-04 13:26   ` Paul Barker
2026-12-04 13:42     ` Prasanth R

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox