From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Mon, 16 Jul 2018 16:51:48 -0600 Subject: [U-Boot] [PATCH] binman: ensure temp filenames don't collide Message-ID: <20180716225148.9136-1-swarren@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Stephen Warren The U-Boot Makefile can invoke binman multiple times in parallel. This is problematic because binman uses a static hard-coded temporary file name. If two instances of binman use that filename at the same time, one writing one reading, they may silently read the wrong content or actively detect missing signatures and error out the build process. Fix this by using a PID-specific filename instead. Signed-off-by: Stephen Warren --- tools/binman/control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/binman/control.py b/tools/binman/control.py index a40b300fdacb..515999278949 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -121,7 +121,7 @@ def Binman(options, args): # output into a file in our output directly. Then scan it for use # in binman. dtb_fname = fdt_util.EnsureCompiled(dtb_fname) - fname = tools.GetOutputFilename('u-boot-out.dtb') + fname = tools.GetOutputFilename('u-boot-out.dtb') + str(os.getpid()) with open(dtb_fname) as infd: with open(fname, 'wb') as outfd: outfd.write(infd.read()) -- 2.18.0