]> git.ipfire.org Git - thirdparty/systemd.git/commit
ukify: fix insertion of padding in merged sections
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 19 Aug 2025 09:02:44 +0000 (11:02 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 19 Aug 2025 09:08:35 +0000 (11:08 +0200)
commitec1d031f3de02f84beca89e2b402d085fba62be4
tree9141cb3b01e99eae92b56cc4b7fce2099343be7b
parent2ddbbb22dbaf14adc96f95950e5356b71ceb56f7
ukify: fix insertion of padding in merged sections

The padding was done to expand the new section contents to the expected size of
the new section. And this then would be used for the content in the existing
section. The new section cannot be larger than the old section, but it can be
smaller. If the new section was smaller, then we'd not write enough padding and
the output file would be corrupted.

This was observed in CI when the .sbat section in the stub was padded to 1k.
The UKI with an .sbat section that was merged and was fairly short would hit
this scenario and be corrupted.
src/ukify/ukify.py