Skip to content

Commit

Permalink
kheaders: explicitly define file modes for archived headers
Browse files Browse the repository at this point in the history
[ Upstream commit 3bd27a8 ]

Build environments might be running with different umask settings
resulting in indeterministic file modes for the files contained in
kheaders.tar.xz. The file itself is served with 444, i.e. world
readable. Archive the files explicitly with 744,a+X to improve
reproducibility across build environments.

--mode=0444 is not suitable as directories need to be executable. Also,
444 makes it hard to delete all the readonly files after extraction.

Cc: [email protected]
Signed-off-by: Matthias Maennich <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
metti authored and gregkh committed Jun 27, 2024
1 parent f0b5d1d commit 5efe0b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/gen_kheaders.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ find $cpio_dir -type f -print0 |

# Create archive and try to normalize metadata for reproducibility.
tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \
--owner=0 --group=0 --sort=name --numeric-owner \
--owner=0 --group=0 --sort=name --numeric-owner --mode=u=rw,go=r,a+X \
-I $XZ -cf $tarfile -C $cpio_dir/ . > /dev/null

echo $headers_md5 > kernel/kheaders.md5
Expand Down

0 comments on commit 5efe0b5

Please sign in to comment.