Skip to content

wasi-nn WASINNContext management seems broken #4313

@yamt

Description

@yamt

wasm_runtime_get_wasi_nn_ctx associates WASINNContext to wasm_module_inst_t
with a hash, using the pointer value of wasm_module_inst_t as a key.
the context and association is left as they are until runtime shutdown. (wasm_runtime_destroy)
it seems unsafe because a wasm_module_inst_t pointer does not identify a module instance.
once the pointer is freed by wasm_runtime_deinstantiate, the same pointer value can be used for an unrelated module instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions