Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wip/hughsie/ifd #6644

Merged
merged 15 commits into from Jan 11, 2024
Merged

Wip/hughsie/ifd #6644

merged 15 commits into from Jan 11, 2024

Conversation

hughsie
Copy link
Member

@hughsie hughsie commented Jan 9, 2024

Type of pull request:

@superm1
Copy link
Member

superm1 commented Jan 9, 2024

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

@hughsie
Copy link
Member Author

hughsie commented Jan 9, 2024

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
Copy link
Member

superm1 commented Jan 9, 2024

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

@hughsie
Copy link
Member Author

hughsie commented Jan 9, 2024

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

@superm1
Copy link
Member

superm1 commented Jan 9, 2024

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
Copy link
Member Author

hughsie commented Jan 9, 2024

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
Copy link
Member

superm1 commented Jan 9, 2024

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
Copy link
Member Author

hughsie commented Jan 9, 2024

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.
contrib/check-ifd-firmware.py Outdated Show resolved Hide resolved
contrib/check-ifd-firmware.py Outdated Show resolved Hide resolved
contrib/check-ifd-firmware.py Show resolved Hide resolved
contrib/dump-mtd-ifd.py Outdated Show resolved Hide resolved
contrib/dump-mtd-ifd.py Show resolved Hide resolved
contrib/dump-mtd-ifd.py Outdated Show resolved Hide resolved
contrib/dump-mtd-ifd.py Outdated Show resolved Hide resolved
contrib/dump-mtd-ifd.py Outdated Show resolved Hide resolved
contrib/dump-mtd-ifd.py Outdated Show resolved Hide 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
@hughsie hughsie merged commit a696fbf into main Jan 11, 2024
14 checks passed
@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.

None yet

2 participants