diff mbox series

[nanbield,16/21] reproducible: Fix race with externalsrc/devtool over lockfile

Message ID 6bb824019fd7335a10fdcebf7d301c101d60ad61.1708012696.git.steve@sakoman.com
State Accepted
Delegated to: Steve Sakoman
Headers show
Series [nanbield,01/21] tiff: fix CVE-2023-6228 | expand

Commit Message

Steve Sakoman Feb. 15, 2024, 4:17 p.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

We occasionally see races over the lockfile used by externalsrc/devtool
when walking files for the source_date_epock calculation. Skip this file
if present to avoid the issues and fix a real issue where SDE could be
contaminated too.

[YOCTO #14921]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 4bc0eb4bd90e6e6e46581a8ed367212bdd910a26)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/lib/oe/reproducible.py | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oe/reproducible.py b/meta/lib/oe/reproducible.py
index 9ac75c02e3..448befce33 100644
--- a/meta/lib/oe/reproducible.py
+++ b/meta/lib/oe/reproducible.py
@@ -131,6 +131,9 @@  def get_source_date_epoch_from_youngest_file(d, sourcedir):
         files = [f for f in files if not f[0] == '.']
 
         for fname in files:
+            if fname == "singletask.lock":
+                 # Ignore externalsrc/devtool lockfile [YOCTO #14921]
+                 continue
             filename = os.path.join(root, fname)
             try:
                 mtime = int(os.lstat(filename).st_mtime)