diff --git a/hypervisor/arch/x86/trusty.c b/hypervisor/arch/x86/trusty.c index 85a2b1339..05f70cb45 100644 --- a/hypervisor/arch/x86/trusty.c +++ b/hypervisor/arch/x86/trusty.c @@ -34,6 +34,7 @@ #include #include #include +#include "rtl.h" _Static_assert(NR_WORLD == 2, "Only 2 Worlds supported!"); @@ -294,7 +295,8 @@ static bool setup_trusty_info(struct vcpu *vcpu, /* TODO: prepare vkey_info */ /* copy key_info to the first page of trusty memory */ - mem->first_page.key_info = g_key_info; + memcpy_s(&mem->first_page.key_info, sizeof(g_key_info), + &g_key_info, sizeof(g_key_info)); memset(mem->first_page.key_info.dseed_list, 0, sizeof(mem->first_page.key_info.dseed_list));