-
Notifications
You must be signed in to change notification settings - Fork 349
Add library authentication feature for MTL and LNL #8741
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
Conversation
2875328 to
fa78e53
Compare
fa78e53 to
3d56f8a
Compare
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Not 100% sure what is the right place to put the auth headers to. This is not specific to RTOS, but is specific to targets. Platform seems the right place to put these.
3d56f8a to
a1d1936
Compare
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API is mostly generic but has some Intel specific flows, I think we can solve all this in the short term by renaming the header files to auth/intel.h and auth/intel_iface.h. Short term we need the fix, long term we need to look at Zephyr auth driver API as this code should really be in RTOS as a system driver.
| ret = auth_api_result(&ext_lib->auth_ctx); | ||
|
|
||
| if (ret != AUTH_IMAGE_TRUSTED) { | ||
| tr_err(&lib_manager_tr, "lib_manager_auth_proc() Untrasted library!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
untrusted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jxstelter can we fix the typo in a follow up?
ad16ee6 to
a0e476d
Compare
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there. Two things:
-
@lgirdwood proposed a bit different approach, to keep the headers in sof/zephyr/include but rename the interface with Intel prefix. I think the current V2 version imlements the platform option cleanly (a few nits inline), but granted the interface is likely fairly Intel specific. But yeah, Liam, preference which way to go?
-
Missing rfree on error path, Guennadi's comment.
a0e476d to
7a5f264
Compare
@lgirdwood Should I change names according to Your first review input? |
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me!
Yeah - just for the implementation side with Intel IP code. I think the interface is quite generic so hopefully can be lifted into Zephyr in the future without too many changes. |
For ACE platforms library authentication could be done using external entity - rom_ext. This module reside in L3 memory space and provides verification functionality. Following code expose that API to SOF. Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
This patch adds usage of authentication API to check library signature. If feature enabled it will block loading of library without valid signature. Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
This enables library authentication on MTL platforms. Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
This enables library authentication on LNL platforms. Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
7a5f264 to
55a520a
Compare
kv2019i
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refresh +1
| man_tmp_buffer = (__sparse_force void __sparse_cache *) | ||
| rballoc_align(0, SOF_MEM_CAPS_DMA, | ||
| MAN_MAX_SIZE_V1_8, dma_ext->addr_align); | ||
| MAN_MAX_SIZE_V1_8, CONFIG_MM_DRV_PAGE_SIZE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is this related? Can we add a comment in a follow-up? Or, if this wasn't intended, revert this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Authentication engine in ROM_EXT requires page aligned buffer. Otherwise it fails.
| struct ext_library *ext_lib = ext_lib_get(); | ||
| int ret; | ||
|
|
||
| ret = auth_api_init_auth_proc(&ext_lib->auth_ctx, buffer_data, buffer_size, phase); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this also needed in the LAST stage? A bit asymmetric
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how reference code uses this API.
These changes will enable loadable library authentication before load.
Untrusted libraries will be not loaded.
Feature is available only on Intel platforms since it uses rom_ext module interface to
perform validation.
Signed-off-by: Jaroslaw Stelter Jaroslaw.Stelter@intel.com