Adding package information to ELF objects
Adding package information to ELF objects
Posted Nov 5, 2021 7:35 UTC (Fri) by pabs (subscriber, #43278)In reply to: Adding package information to ELF objects by zuki
Parent article: Adding package information to ELF objects
Posted Nov 5, 2021 8:11 UTC (Fri)
by pabs (subscriber, #43278)
[Link] (6 responses)
As an example, the Debian project produces live image ISOs. Those images combine binaries from many packages in one file. Each of those ISO images has next to it a file containing the list of binary packages and package versions used to build it. This is the right way to go about solving this problem.
https://cdimage.debian.org/debian-cd/current-live/amd64/i...
Posted Nov 5, 2021 9:04 UTC (Fri)
by zuki (subscriber, #41808)
[Link] (1 responses)
As discussed in the proposal, attaching the information to the ELF files makes it visible in the place where it's is very useful: crash dumps. I'd say that having a flat text file somewhere is not as useful for this purpose.
Posted Nov 5, 2021 9:11 UTC (Fri)
by pabs (subscriber, #43278)
[Link]
Posted Nov 5, 2021 9:22 UTC (Fri)
by mjg59 (subscriber, #23239)
[Link] (2 responses)
I can think of one real-world (if corner) case that this probably does trip up, though:
If the fact that these are two separate packages were to result in different embedded data, the signature obviously wouldn't apply.
(This isn't a problem at the moment because the Debian shim-signed source package just contains the signed binaries, but it would be nice to have a world where the builds were reproducible enough to avoid that)
Posted Nov 5, 2021 9:38 UTC (Fri)
by zuki (subscriber, #41808)
[Link]
Posted Nov 5, 2021 12:07 UTC (Fri)
by BenHutchings (subscriber, #37955)
[Link]
Posted Nov 6, 2021 19:54 UTC (Sat)
by NYKevin (subscriber, #129325)
[Link]
In principle, you could use that provenance information for crash dumps. That's how we do it at Google, in fact - we can tell the exact version that was checked into source control, and display the exact line where the faulting instruction happened, because we built the container in the first place, and so we know where everything in it came from. This is one of the benefits* of having a monorepo without (much) branching, as we can just point to one CL number instead of, say, fifty, and it's also one of the reasons** that Bazel makes such a big fuss about exhaustively tracking and declaring your entire dependency hierarchy.
The problems only really arise when a crash dump gets separated from the orchestration system's provenance data, or when the orchestration system's provenance data is inadequate (or when you don't have an orchestration system and are just manually building Docker images from random crap, of course, which is an unfortunately common practice in some shops). You might also have the "my tools suck" problem, where you theoretically have all of the information (provenance data) you need, but converting it into a useful form (a Git hash or version number that upstream can recognize and deal with) is too hard.
* There are also drawbacks, which are irrelevant here, but somebody will bring them up if I don't acknowledge that they exist.
Adding package information to ELF objects
Adding package information to ELF objects
Having a text file with a list of package versions _somewhere_ is one workaround-slash-solution. Attaching this information directly to the ELF file is another workaround-slash-solution. Both approaches have their advantages and can coexist peacefully.
Adding package information to ELF objects
Adding package information to ELF objects
1) Have a shim-unsigned package that produces a binary
2) Upload that shim binary to Microsoft and obtain a signed copy
3) Strip that signature from the binary and add it to a shim-signed package
4) Build shim-signed in an identical environment to shim-unsigned, with the last step being to add the signature
Adding package information to ELF objects
Adding package information to ELF objects
Adding package information to ELF objects
** The main reason is "cache invalidation is hard, and rebuilding the entire universe from scratch is slow." But good provenance data is definitely important too.
