Add more checks to enhance security (#446)

add more checks to enhance security
clear "wasi proc exit" exception before return to caller in wasm/aot call functions
fix memory profiling issue
change movdqa to movdqu in simd invokeNative asm codes to fix issue of unaligned address access
move setjmp/longjmp from libc-builtin to libc-emcc
fix zephyr platform compilation issue in latest zephyr version
This commit is contained in:
Wenyong Huang
2020-11-24 14:00:09 +08:00
committed by GitHub
parent f4770ae8c8
commit 74be7a0b7c
24 changed files with 397 additions and 216 deletions

View File

@ -265,6 +265,10 @@ call_key_destructor(wasm_exec_env_t exec_env)
WASMCluster *cluster = wasm_exec_env_get_cluster(exec_env);
ClusterInfoNode *info = get_cluster_info(cluster);
if (!info) {
return;
}
value_node = bh_list_first_elem(info->thread_list);
while (value_node) {
if (value_node->exec_env == exec_env)
@ -435,6 +439,11 @@ get_thread_info(wasm_exec_env_t exec_env, uint32 handle)
{
WASMCluster *cluster = wasm_exec_env_get_cluster(exec_env);
ClusterInfoNode *info = get_cluster_info(cluster);
if (!info) {
return NULL;
}
return bh_hash_map_find(info->thread_info_map, (void *)(uintptr_t)handle);
}
@ -524,6 +533,8 @@ pthread_create_wrapper(wasm_exec_env_t exec_env,
WASIContext *wasi_ctx = get_wasi_ctx(module_inst);
#endif
bh_assert(module);
if (!(new_module_inst =
wasm_runtime_instantiate_internal(module, true, 8192, 0,
NULL, 0)))