Skip to content

Wip/hughsie/ifd - #6644

Merged
hughsie merged 15 commits into
mainfrom
wip/hughsie/ifd
Jan 11, 2024
Merged

hughsie merged 15 commits into
mainfrom
wip/hughsie/ifd

Conversation

@hughsie

@hughsie hughsie commented Jan 9, 2024

Copy link
Copy Markdown
Member

Type of pull request:

@superm1

superm1 commented Jan 9, 2024

Copy link
Copy Markdown
Member

Can you pull some already redistributable binaries from LVFS and tear them apart as part of CI perhaps?

@hughsie

hughsie commented Jan 9, 2024

Copy link
Copy Markdown
Member Author

Those aren't going to be IFD images -- those will be at best IFD partitions -- and probably also wrapped up in other container formats (looking at you Dell) -- they're also not going to have all the local-only NVRAM junk populated either.

@superm1

superm1 commented Jan 9, 2024

Copy link
Copy Markdown
Member

Got it; so these are basically a collection of dediprog dumps you run it through.

@hughsie

hughsie commented Jan 9, 2024

Copy link
Copy Markdown
Member Author

Yes -- and I'm crowd-sourcing some more! https://blogs.gnome.org/hughsie/2024/01/09/looking-for-logofail-on-your-local-system/

@superm1

superm1 commented Jan 9, 2024

Copy link
Copy Markdown
Member

Yes -- and I'm crowd-sourcing some more! https://blogs.gnome.org/hughsie/2024/01/09/looking-for-logofail-on-your-local-system/

Ah. I think your 99% statement is probably wrong - it's only vendors that allow changing the logo isn't it? Others might have parser problems but if you can't change the logo they're not affected.

So I think any hsi check for logo fail needs to also check availability of the interfaces used to change.

@hughsie

hughsie commented Jan 9, 2024

Copy link
Copy Markdown
Member Author

it's only vendors that allow changing the logo isn't it?

I think more support it than you might immediately realize; Lenovo is affected for example. But yes, 100% agreed on parsing the NVRAM for the keys to indicate the image data before failing HSI tests.

@superm1

superm1 commented Jan 9, 2024

Copy link
Copy Markdown
Member

But notably I recall reading in some logo fail article that Dell isn't affected because they don't offer any logo changing interface. They're a pretty sizable chunk too :)

@hughsie

hughsie commented Jan 9, 2024

Copy link
Copy Markdown
Member Author

Dell isn't affected

Ohh, TIL. I've updated the blog post, thanks.

    check-ifd-firmware.py:
    ../libfwupdplugin/tests/ifd/lenovo-p1-gen3.bin
    FuEfiFirmwareFile                   : 536 -> 1338
    FuEfiFirmwareFilesystem             : 6 -> 32
    FuEfiFirmwareSection                : 9 -> 35
    FuEfiFirmwareVolume                 : 6 -> 33
    FuIfdFirmware                       : 1 -> 1
    ../libfwupdplugin/tests/ifd/lenovo-x1-nano.bin
    FuEfiFirmwareFile                   : 0 -> 578
    FuEfiFirmwareFilesystem             : 0 -> 21
    FuEfiFirmwareSection                : 0 -> 35
    FuEfiFirmwareVolume                 : 0 -> 22
    FuIfdBios                           : 0 -> 1
    FuIfdFirmware                       : 0 -> 1
    FuIfdImage                          : 0 -> 3
    check-ifd-firmware.py:
    ../libfwupdplugin/tests/ifd/lenovo-p1-gen3.bin
    ../libfwupdplugin/tests/ifd/lenovo-x1-nano.bin
    Lines                               : 5289 -> 5290
    check-ifd-firmware.py:
    ../libfwupdplugin/tests/ifd/lenovo-p1-gen3.bin
    FuEfiFirmwareSection                : 35 -> 4629
    Lines                               : 11570 -> 48265
    ../libfwupdplugin/tests/ifd/lenovo-x1-nano.bin
    FuEfiFirmwareSection                : 35 -> 2027
    Lines                               : 5290 -> 21206
    check-ifd-firmware.py:
    ../libfwupdplugin/tests/ifd/lenovo-p1-gen3.bin
    Lines                               : 48265 -> 49354
    ../libfwupdplugin/tests/ifd/lenovo-x1-nano.bin
    Lines                               : 21206 -> 21686
Also, split up fu_efi_firmware_section_parse() as it's getting a bit wild.
@hughsie
hughsie requested a review from superm1 January 11, 2024 17:06
@hughsie hughsie self-assigned this Jan 11, 2024
Comment thread contrib/check-ifd-firmware.py Resolved
Comment thread contrib/check-ifd-firmware.py Resolved
Comment thread contrib/check-ifd-firmware.py Resolved
Comment thread contrib/dump-mtd-ifd.py Resolved
Comment thread contrib/dump-mtd-ifd.py Resolved
Comment thread contrib/dump-mtd-ifd.py Resolved
Comment thread contrib/dump-mtd-ifd.py Resolved
Comment thread contrib/dump-mtd-ifd.py Resolved
Comment thread contrib/dump-mtd-ifd.py Resolved
This can be run on a a directory of BIOS dumps, and only returns success if
there are no regressions in parsing. The old parsing stats are stored in json
files in the same directory.

This cannot be run in CI or precommit as the big directory of firmware is
100% non-redistributable, and may even contain user secrets.
    check-ifd-firmware.py:
    ../libfwupdplugin/tests/ifd/lenovo-p1-gen3.bin
    FuEfiFirmwareSection                : 4629 -> 4727
    Lines                               : 49354 -> 50162
    ../libfwupdplugin/tests/ifd/lenovo-x1-nano.bin
    FuEfiFirmwareSection                : 2027 -> 2076
    Lines                               : 21686 -> 22090
Comment thread contrib/dump-mtd-ifd.py Resolved
@hughsie
hughsie merged commit a696fbf into main Jan 11, 2024
@hughsie
hughsie deleted the wip/hughsie/ifd branch January 11, 2024 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants