lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 15 Mar 2023 21:09:33 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Masahiro Yamada <masahiroy@...nel.org>
Cc:     Leon Romanovsky <leonro@...dia.com>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Nicolas Schier <nicolas@...sle.eu>,
        linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
        Riad Abo Raed <riada@...dia.com>
Subject: [PATCH -rc] kbuild: properly exclude linux.tar.gz from tar archive

From: Leon Romanovsky <leonro@...dia.com>

Attempt to build rpm-pkg randomly fails in tar stage, with same error
as was reported by Nicolas [1]

tar -c -f linux.tar.gz -I pigz --exclude=./linux.tar.gz --exclude-from=.tmp_filelist_exclude --owner=0 --group=0 --sort=name --transform 's:^\.:linux:S' -C . .
tar: .: file changed as we read it
make[1]: *** [scripts/Makefile.package:58: linux.tar.gz] Error 1
make[1]: *** Deleting file 'linux.tar.gz'
make: *** [Makefile:1657: rpm-pkg] Error 2

The reason to it that tar is dependent on order of command line
arguments and needs to have excluded file before creating it. So as a
solution, touch that file to create it and move --exclude list before
any tar arguments.

[1] https://lore.kernel.org/all/Y%2Fk+v%2FYj8VQ6q32H@fjasle.eu/
Cc: Nicolas Schier <nicolas@...sle.eu>
Fixes: 7bf4582d7aad ("kbuild: deb-pkg: create source package without cleaning")
Signed-off-by: Riad Abo Raed <riada@...dia.com>
Signed-off-by: Leon Romanovsky <leonro@...dia.com>
---
 scripts/Makefile.package | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index b941e6341b36..be4623481ca2 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -44,7 +44,7 @@ filechk_filelist = \
 # ---------------------------------------------------------------------------
 
 quiet_cmd_tar = TAR     $@
-      cmd_tar = tar -c -f $@ $(tar-compress-opt) $(tar-exclude-opt) \
+      cmd_tar = touch ./$@ && tar $(tar-exclude-opt) -c -f $@ $(tar-compress-opt) \
                 --owner=0 --group=0 --sort=name \
                 --transform 's:^\.:$*:S' -C $(tar-rootdir) .
 
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ