thesofproject / sof

Sound Open Firmware
Other
541 stars 309 forks source link

[FEATURE] debug: fault injection: sign firmware with invalid key #681

Open plbossart opened 5 years ago

plbossart commented 5 years ago

To make sure the Linux driver error flows get tested in a regular basis, add an invalid key to check how the driver probe releases all allocated resources.

lbetlej commented 5 years ago

driver may respond with a meaningful dmesg entry on a specific ROM error code documented in sof-docs

lgirdwood commented 5 years ago

Test key should be generated and added to git alongside public dev key. rimage already takes the key location as an argument so it would be easy enough to add a make target to sign with the test key.

jajanusz commented 5 years ago

It will just add unnecessary burden to the codebase. It's something that just CI/occasional checks should do - some check with invalid key and try to load it. For sure it shouldn't be placed next to valid keys. The most we can add to the repo for that is some script with its invalid key, but somwhere in scripts/tools/tests.

@mengdonglin Probably @xiulipan is the best person to be assigned for this one.

xiulipan commented 5 years ago

@jajanusz @plbossart @lgirdwood What would this key used for? Do you mean add some fail case test in CI? I will take that as a new feature request.

lgirdwood commented 5 years ago

@xiulipan this is to test driver handling paths for FW boot/signing failure. Maybe best option is to have rimage cmd line option that signs with random data. This way we don't have to carry "testing keys" and rimage can still sign using random data (as the private key). I've marked it down for v1.4

jajanusz commented 5 years ago

@lgirdwood I prefer to clutter some deep folder that no1 looks into instead of rimage codebase. Also CI should be deterministic, I know it's near to impossible to match valid key, but still, it makes CI non-deterministic.

lgirdwood commented 5 years ago

@jajanusz I'm also fine with signing with an empty or 0 key (as long as driver error flow is tested)

lgirdwood commented 4 years ago

@plbossart did you manage to have a solution for testing kernel boot flow for signing ?

kv2019i commented 1 year ago

@mengdonglin @plbossart I think this should be moved to validation backlog, assigning to TBD milestone until then.