On Thu, Dec 22, 2022 at 04:24:11PM +0100, Lennart Poettering wrote:
On Do, 22.12.22 14:49, Daniel P. Berrangé (berrange(a)redhat.com)
wrote:
> When you say it dooesn't get the offsets right, can you elaborate ?
dracut uses fixed offsets for the sections to be placed in memory
in. The values are simply hardcoded, literally specified address
offsets, that worked for the original authors. This typically works –
as long as your sections are not much larger than they were for the
people wo came up with these offsets initially. But as it turns out
this doesn't work for some cases. In such cases the sections will be
loaded into memory overlapped and bad things happen.
ukify hence calculates the offsets manually (by adding up the section
sizes so that this cannot happen.
The issue was detected in CI [1]. Some code changes made the .text
section bigger, causing other sections to overlap, causing an actual
failure during boot. But it seems that the problem is more widespread and
we were just being lucky ;( We're figuring out the details,
See the attached program:
$ dracut --uefi /tmp/initrd 6.0.13-300.fc37.x86_64
$ python info.py /tmp/initrd
...
# 4 .rela 000010c8 000000000001f000 000000000001f000 00017f40 2**2
start=126976 end=131272
# 5 .osrel 000002df 0000000000020000 0000000000020000 00019140 2**2
start=131072 end=131807
vma overlap with previous section: 200 bytes
...
I plan to return to this after the holidays.
Zbyszek
[1]
https://github.com/systemd/systemd/pull/23706#issuecomment-1354729112