Add more security checks for libc wrapper API's (#105)

This commit is contained in:
wenyongh
2019-08-28 15:06:04 +08:00
committed by GitHub
parent 92cbecbec8
commit c808aa2ebb
3 changed files with 187 additions and 24 deletions

View File

@ -391,6 +391,38 @@ int32_t
wasm_runtime_addr_native_to_app(wasm_module_inst_t module_inst,
void *native_ptr);
/**
* Get the app address range (relative address) that a app address belongs to
*
* @param module_inst the WASM module instance
* @param app_offset the app address to retrieve
* @param p_app_start_offset buffer to output the app start offset if not NULL
* @param p_app_end_offset buffer to output the app end offset if not NULL
*
* @return true if success, false otherwise.
*/
bool
wasm_runtime_get_app_addr_range(wasm_module_inst_t module_inst,
int32_t app_offset,
int32_t *p_app_start_offset,
int32_t *p_app_end_offset);
/**
* Get the native address range (absolute address) that a native address belongs to
*
* @param module_inst the WASM module instance
* @param native_ptr the native address to retrieve
* @param p_native_start_addr buffer to output the native start address if not NULL
* @param p_native_end_addr buffer to output the native end address if not NULL
*
* @return true if success, false otherwise.
*/
bool
wasm_runtime_get_native_addr_range(wasm_module_inst_t module_inst,
uint8_t *native_ptr,
uint8_t **p_native_start_addr,
uint8_t **p_native_end_addr);
#ifdef __cplusplus
}
#endif