corna / me_cleaner

Tool for partial deblobbing of Intel ME/TXE firmware images
GNU General Public License v3.0
4.49k stars 278 forks source link

Backport IFD-related features to coreboot's ifdtool #58

Open persmule opened 7 years ago

persmule commented 7 years ago

For ifdtool has been integrated into coreboot's build process, I believe it is better to have ifdtool handle all IFD-related operations, so I am going to backport those IFD-related features to ifdtool.

@corna I remember that you have said that ifdtool's manipulation may somtimes breaks IFD. Could you point out which data get broken, and how me_cleaner prevents this, please?

corna commented 7 years ago

Also _mecleaner is integrated in the build process, I don't know if ifdtool should handle ME-specific flags.

With a modifed layout where the me region has been shrinked (the end of the region has moved to a lower address, even just by 4 kB), ifdtool -n newlayout image.rom corrupts the me region. The descriptor is fine, however it seems that the starting chunk of the me region has been cut off. _mecleaner doesn't have this problem as it doesn't move regions at all: -D generates a descriptor with a modified layout, while -M extracts the me region (and, if the -t flag has been passed, it just extracts the region up to _endaddr).

persmule commented 7 years ago

That is because ifdtool uses "right-align" scheme when moving region (seen from commit 4eabe1e, when feature new-layout was implemented), though such scheme is only valid for the BIOS region.

I am going to fix this.

corna commented 7 years ago

Makes sense. Thank you.

persmule commented 7 years ago

Could you help me review this change? It may help to resolve the issue mentioned above.

corna commented 7 years ago

Of course. However I'm a bit busy these weeks, I'll try to review it ASAP.