Skip to content
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

Make boundary check behavior configurable #2289

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

no1wudi
Copy link
Collaborator

@no1wudi no1wudi commented Jun 13, 2023

Notice: This is a non standard behavior, in this patch, boundary check can be disabled.

Known issues:

  • Unavailable on 64 bit platform

@no1wudi no1wudi marked this pull request as draft June 13, 2023 06:35
core/iwasm/interpreter/wasm_runtime.h Outdated Show resolved Hide resolved
core/iwasm/compilation/aot_llvm.h Outdated Show resolved Hide resolved
core/iwasm/common/wasm_memory.c Outdated Show resolved Hide resolved
@yamt
Copy link
Collaborator

yamt commented Jun 14, 2023

what's the purpose of this?

@no1wudi
Copy link
Collaborator Author

no1wudi commented Jun 15, 2023

what's the purpose of this?

Let the wasm app access the host memory directly, in some application we bypass the libc to the host side, raw pointer from host maybe accessed in the wasm app.

For this case, @wenyongh noticed that maybe we can implement https://github.com/WebAssembly/memory-control/blob/main/proposals/memory-control/Overview.md proposal.

@yamt
Copy link
Collaborator

yamt commented Jun 15, 2023

what's the purpose of this?

Let the wasm app access the host memory directly, in some application we bypass the libc to the host side, raw pointer from host maybe accessed in the wasm app.

ok

For this case, @wenyongh noticed that maybe we can implement https://github.com/WebAssembly/memory-control/blob/main/proposals/memory-control/Overview.md proposal.

the "preferred" option there is based on multi-memory.
it means you can't access it via ordinary C pointers in wasm.
is it ok for your purpose?

@no1wudi
Copy link
Collaborator Author

no1wudi commented Jun 15, 2023

the "preferred" option there is based on multi-memory. it means you can't access it via ordinary C pointers in wasm. is it ok for your purpose?

I'm investigating the possibility of it, this proposal is in early stage, and compiler also need to implement it.

@no1wudi no1wudi force-pushed the main branch 19 times, most recently from 9d155fa to 428e7dd Compare June 27, 2023 15:39
core/config.h Outdated Show resolved Hide resolved
core/iwasm/aot/aot_runtime.c Outdated Show resolved Hide resolved
core/iwasm/common/wasm_memory.c Outdated Show resolved Hide resolved
core/iwasm/common/wasm_runtime_common.c Outdated Show resolved Hide resolved
core/iwasm/interpreter/wasm_runtime.c Outdated Show resolved Hide resolved
core/iwasm/interpreter/wasm_interp_fast.c Show resolved Hide resolved
wamr-compiler/CMakeLists.txt Outdated Show resolved Hide resolved
core/iwasm/common/wasm_runtime_common.h Outdated Show resolved Hide resolved
@no1wudi no1wudi force-pushed the main branch 3 times, most recently from edefb64 to 2110f11 Compare June 29, 2023 06:52
core/config.h Outdated Show resolved Hide resolved
core/config.h Outdated Show resolved Hide resolved
core/iwasm/aot/aot_runtime.h Outdated Show resolved Hide resolved
core/iwasm/common/wasm_memory.c Outdated Show resolved Hide resolved
core/iwasm/common/wasm_memory.c Outdated Show resolved Hide resolved
core/iwasm/include/wasm_export.h Outdated Show resolved Hide resolved
core/iwasm/include/wasm_export.h Outdated Show resolved Hide resolved
core/iwasm/interpreter/wasm_runtime.h Outdated Show resolved Hide resolved
core/iwasm/include/wasm_export.h Outdated Show resolved Hide resolved
product-mini/platforms/posix/main.c Outdated Show resolved Hide resolved
@no1wudi no1wudi force-pushed the main branch 2 times, most recently from 74e3cb9 to 05cb853 Compare July 3, 2023 09:17
@no1wudi no1wudi force-pushed the main branch 11 times, most recently from eb43da0 to cd3b528 Compare July 4, 2023 03:51
Change-Id: Id06b5f9f8b9ef4e29ed0bf70d9b48c5a70ea2853
Copy link
Contributor

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenyongh wenyongh merged commit 18092f8 into bytecodealliance:main Jul 4, 2023
368 checks passed
no1wudi added a commit to no1wudi/nuttx-apps that referenced this pull request Jul 4, 2023
no1wudi added a commit to no1wudi/nuttx-apps that referenced this pull request Jul 4, 2023
no1wudi added a commit to no1wudi/nuttx-apps that referenced this pull request Jul 5, 2023
xiaoxiang781216 pushed a commit to apache/nuttx-apps that referenced this pull request Jul 5, 2023
anchao pushed a commit to anchao/nuttx-apps that referenced this pull request Jul 14, 2023
VELAPLATFO-10411

Works with bytecodealliance/wasm-micro-runtime#2289

Change-Id: I00308f799ab3e713d665df9a4d4077b51365776e
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
victoryang00 pushed a commit to victoryang00/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…ance#2289)

Allow to use `cmake -DWAMR_CONFIGURABLE_BOUNDS_CHECKS=1` to
build iwasm, and then run `iwasm --disable-bounds-checks` to disable the
memory access boundary checks.

And add two APIs:
`wasm_runtime_set_bounds_checks` and `wasm_runtime_is_bounds_checks_enabled`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants