-
Notifications
You must be signed in to change notification settings - Fork 639
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
Add runtime inited checks in Enclave command handlings to improve security #2416
Conversation
are you trying to make wasm_runtime_destroy idempotent? |
Good point, I added more checks in Enclave instead to fix some similar issues. |
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.
lgtm
Hello, I think If you only fix at |
the bug (calling if other platforms have similar bugs, they should be fixed too. (have they?) having double-free checks everywhere is not viable, IMO. |
It's different from However, in WAMR, API is I think it's hard to ensure we don't have double free in other platform |
i disagree. while it's ok to set wait_map to NULL, it's far from a "duty". |
All right |
…urity (bytecodealliance#2416) Call ecall commands arbitrarily from host when enclave's runtime isn't initialized may cause unexpected behavior, for example, load/instantiate wasm module. Add runtime inited status checks in enclave to improve the security. Also fix `wait_map` issue mentioned in bytecodealliance#2252 (comment)
As reported in #2252 (comment),
wait_map
may be referred again after free in linux-sgx ecall command if it isn't set NULL.