Skip to contentSkip to conversation

create-spdx-3.0: rerun do_create_recipe_spdx on patch changes

PATCH Superseded Peter Marko 3 participants 5 messages Apr 17

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 create-spdx-3.0: rerun do_create_recipe_spdx on patch changes

From: Peter Marko <[email protected]>

Valkyrie patchmetrics from 2026-04-17 is showing two CVEs where patches were merged the day before (2026-04-16) - inetutils/CVE-2026-32746 and re2c/CVE-2026-2903.
Root-cause is that the CVE patches are evaluated in task do_create_recipe_spdx which does not have any dependency on SRC_URI nor content of the patches, so it is taken from sstate-cache which contains old (stale) data.

Note that this will mean that running sbom-cve-check will run do_fetch task for all evaluated recipes, however that is necessary to catch also changes within patch content (e.g. adding additional CVE: tags) in addition to re-running when adding new patches if we would only add dependency on SRC_URI variable.

---
 meta/classes/create-spdx-3.0.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/create-spdx-3.0.bbclass +1 -1
index 432adb14cd..db1ccc0c81 100644
@@ -192,7 +192,7 @@ python do_create_recipe_spdx() {
     import oe.spdx30_tasks
     oe.spdx30_tasks.create_recipe_spdx(d)
 }
-addtask do_create_recipe_spdx
+addtask do_create_recipe_spdx after do_fetch
 
 SSTATETASKS += "do_create_recipe_spdx"
 do_create_recipe_spdx[sstate-inputdirs] = "${SPDXRECIPEDEPLOY}"
#1 lore raw
Quoted 31 lines · Peter Marko via lists.openembedded.org

From: Peter Marko <[email protected]>

Valkyrie patchmetrics from 2026-04-17 is showing two CVEs where patches were merged the day before (2026-04-16) - inetutils/CVE-2026-32746 and re2c/CVE-2026-2903.
Root-cause is that the CVE patches are evaluated in task do_create_recipe_spdx which does not have any dependency on SRC_URI nor content of the patches, so it is taken from sstate-cache which contains old (stale) data.

Note that this will mean that running sbom-cve-check will run do_fetch task for all evaluated recipes, however that is necessary to catch also changes within patch content (e.g. adding additional CVE: tags) in addition to re-running when adding new patches if we would only add dependency on SRC_URI variable.

---
 meta/classes/create-spdx-3.0.bbclass | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/create-spdx-3.0.bbclass +0 -0
index 432adb14cd..db1ccc0c81 100644
@@ -192,7 +192,7 @@ python do_create_recipe_spdx() {

     import oe.spdx30_tasks
     oe.spdx30_tasks.create_recipe_spdx(d)
 }

meta/classes/create-spdx-3.0.bbclass +1 -1
-addtask do_create_recipe_spdx
+addtask do_create_recipe_spdx after do_fetch
Quoted 3 lines


 SSTATETASKS += "do_create_recipe_spdx" do_create_recipe_spdx[sstate-inputdirs] = "${SPDXRECIPEDEPLOY}"

What data does do_create_recipe_spdx actually need?

Does it just need SRC_URI, or does it need to re-run if any of the contents of items in SRC_URI changes? Or does it actually need the patch contents?

If it needs to depend on more than the contents of SRC_URI, it should have a dependency but I think Joshua was trying to avoid that. The dependency would be on unpack or patch, not fetch as it shouldn't be poking into DL_DIR.

FWIW, the way do_fetch runs only if it needs to is:

do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}" do_fetch[file-checksums] += " ${@get_lic_checksum_file_list(d)}"

Cheers,

Richard

#2 lore raw
Quoted 47 lines

-----Original Message-----
From: Richard Purdie <[email protected]>
Sent: Friday, April 17, 2026 2:04 PM
To: Marko, Peter (FT D EU SK BFS1) <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [OE-core] [PATCH] create-spdx-3.0: rerun do_create_recipe_spdx on patch changes

Quoted 7 lines · Peter Marko via lists.openembedded.org

From: Peter Marko <[email protected]>

Valkyrie patchmetrics from 2026-04-17 is showing two CVEs where patches were merged the day before (2026-04-16) - inetutils/CVE-2026-32746 and re2c/CVE-2026-2903.
Root-cause is that the CVE patches are evaluated in task do_create_recipe_spdx which does not have any dependency on SRC_URI

nor

meta/classes/create-spdx-

Quoted 15 lines

content of the patches, so it is taken from sstate-cache which contains old (stale) data.

Note that this will mean that running sbom-cve-check will run do_fetch task for all evaluated recipes, however that is necessary to catch also changes within patch content (e.g. adding additional CVE: tags) in addition to re-running when adding new patches if we would only add dependency on SRC_URI variable.

---
 meta/classes/create-spdx-3.0.bbclass | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/create-spdx- renamed from meta/classes/create-spdx-3.0.bbclass +0 -0

3.0.bbclass

Quoted 10 lines

index 432adb14cd..db1ccc0c81 100644

meta/classes/create-spdx-3.0.bbclass +0 -0
@@ -192,7 +192,7 @@ python do_create_recipe_spdx() {

     import oe.spdx30_tasks
     oe.spdx30_tasks.create_recipe_spdx(d)
 }

meta/classes/create-spdx-3.0.bbclass +1 -1
-addtask do_create_recipe_spdx
+addtask do_create_recipe_spdx after do_fetch
Quoted 8 lines
Quoted 2 lines

 SSTATETASKS += "do_create_recipe_spdx" do_create_recipe_spdx[sstate-inputdirs] = "${SPDXRECIPEDEPLOY}"

What data does do_create_recipe_spdx actually need?

Does it just need SRC_URI, or does it need to re-run if any of the contents of items in SRC_URI changes? Or does it actually need the patch contents?

It reads file content as it scans the file for "CVE: xyz" strings.

Quoted 10 lines

If it needs to depend on more than the contents of SRC_URI, it should have a dependency but I think Joshua was trying to avoid that. The dependency would be on unpack or patch, not fetch as it shouldn't be poking into DL_DIR.

FWIW, the way do_fetch runs only if it needs to is:

do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}" do_fetch[file-checksums] += " ${@get_lic_checksum_file_list(d)}"

OK, in the evening I'll try to rework the patch to use this concept.

Quoted 5 lines

Cheers,

Richard

#3 lore raw
In reply to Richard Purdie
Quoted 39 lines · Richard Purdie
Quoted 26 lines · Peter Marko via lists.openembedded.org

From: Peter Marko <[email protected]>

Valkyrie patchmetrics from 2026-04-17 is showing two CVEs where patches were merged the day before (2026-04-16) - inetutils/CVE-2026-32746 and re2c/CVE-2026-2903.
Root-cause is that the CVE patches are evaluated in task do_create_recipe_spdx which does not have any dependency on SRC_URI nor content of the patches, so it is taken from sstate-cache which contains old (stale) data.

Note that this will mean that running sbom-cve-check will run do_fetch task for all evaluated recipes, however that is necessary to catch also changes within patch content (e.g. adding additional CVE: tags) in addition to re-running when adding new patches if we would only add dependency on SRC_URI variable.

---
 meta/classes/create-spdx-3.0.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/create-spdx-3.0.bbclass +0 -0
index 432adb14cd..db1ccc0c81 100644

meta/classes/create-spdx-3.0.bbclass python do_create_recipe_spdx() { · line 198

Quoted 8 lines
meta/classes/create-spdx-3.0.bbclass +1 -1
@@ -192,7 +192,7 @@ python do_create_recipe_spdx() {
     import oe.spdx30_tasks
     oe.spdx30_tasks.create_recipe_spdx(d)
 }
-addtask do_create_recipe_spdx
+addtask do_create_recipe_spdx after do_fetch
 
 SSTATETASKS += "do_create_recipe_spdx"
 do_create_recipe_spdx[sstate-inputdirs] = "${SPDXRECIPEDEPLOY}"

What data does do_create_recipe_spdx actually need?

Quoted 8 lines

Does it just need SRC_URI, or does it need to re-run if any of the contents of items in SRC_URI changes? Or does it actually need the patch contents?

If it needs to depend on more than the contents of SRC_URI, it should have a dependency but I think Joshua was trying to avoid that. The dependency would be on unpack or patch, not fetch as it shouldn't be poking into DL_DIR.

Correct, we do not want a dependency on do_fetch as that would make the "fast" CVE check very slow. I'm curious if this is a problem with the old cve_check.bbclass also, or if not how it solved the problem

Quoted 11 lines

FWIW, the way do_fetch runs only if it needs to is:

do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}" do_fetch[file-checksums] += " ${@get_lic_checksum_file_list(d)}"

Cheers,

Richard

#4 lore raw
Quoted 59 lines

-----Original Message-----
From: Joshua Watt <[email protected]>
Sent: Friday, April 17, 2026 4:01 PM
To: Richard Purdie <[email protected]>
Cc: Marko, Peter (FT D EU SK BFS1) <[email protected]>; [email protected]
Subject: Re: [OE-core] [PATCH] create-spdx-3.0: rerun do_create_recipe_spdx on patch changes

Quoted 2 lines · Richard Purdie

On Fri, 2026-04-17 at 10:30 +0200, Peter Marko via lists.openembedded.org

Quoted 7 lines · wrote:
Quoted 7 lines

From: Peter Marko <[email protected]>

Valkyrie patchmetrics from 2026-04-17 is showing two CVEs where patches were merged the day before (2026-04-16) - inetutils/CVE-2026-32746 and re2c/CVE-2026-2903.
Root-cause is that the CVE patches are evaluated in task do_create_recipe_spdx which does not have any dependency on SRC_URI

nor

Quoted 9 lines
Quoted 9 lines

content of the patches, so it is taken from sstate-cache which contains old (stale) data.

Note that this will mean that running sbom-cve-check will run do_fetch task for all evaluated recipes, however that is necessary to catch also changes within patch content (e.g. adding additional CVE: tags) in addition to re-running when adding new patches if we would only add dependency on SRC_URI variable.

Quoted 6 lines

meta/classes/create-spdx-

Quoted 6 lines
---
 meta/classes/create-spdx-3.0.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/create-spdx- renamed from meta/classes/create-spdx-3.0.bbclass +0 -0

3.0.bbclass

Quoted 19 lines

meta/classes/create-spdx-3.0.bbclass python do_create_recipe_spdx() { · line 198

Quoted 12 lines

index 432adb14cd..db1ccc0c81 100644

meta/classes/create-spdx-3.0.bbclass +1 -1
@@ -192,7 +192,7 @@ python do_create_recipe_spdx() {
     import oe.spdx30_tasks
     oe.spdx30_tasks.create_recipe_spdx(d)
 }
-addtask do_create_recipe_spdx
+addtask do_create_recipe_spdx after do_fetch
 
 SSTATETASKS += "do_create_recipe_spdx"
 do_create_recipe_spdx[sstate-inputdirs] = "${SPDXRECIPEDEPLOY}"

What data does do_create_recipe_spdx actually need?

Does it just need SRC_URI, or does it need to re-run if any of the contents of items in SRC_URI changes? Or does it actually need the patch contents?

Quoted 8 lines
Quoted 4 lines

If it needs to depend on more than the contents of SRC_URI, it should have a dependency but I think Joshua was trying to avoid that. The dependency would be on unpack or patch, not fetch as it shouldn't be poking into DL_DIR.

Correct, we do not want a dependency on do_fetch as that would make the "fast" CVE check very slow. I'm curious if this is a problem with the old cve_check.bbclass also, or if not how it solved the problem

The old cve-check did that in single nostamp task, so there was no dependency on sstate-cached objects. Peter

Quoted 12 lines
Quoted 12 lines

FWIW, the way do_fetch runs only if it needs to is:

do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}" do_fetch[file-checksums] += " ${@get_lic_checksum_file_list(d)}"

Cheers,

Richard