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

Missing boundary check for load/store in JIT compiler #435

Open
pcy190 opened this issue Apr 25, 2024 · 1 comment
Open

Missing boundary check for load/store in JIT compiler #435

pcy190 opened this issue Apr 25, 2024 · 1 comment

Comments

@pcy190
Copy link

pcy190 commented Apr 25, 2024

The current JIT compiler does not emit boundary checks for the load/store memory opcode. Hence, any program can perform an invalid memory operation.

e.g., the following PoC program can trigger invalid memory write:

mov %r0, 0
stxdw [%r0+96], %r0

Running it under JIT mode, we can get:

==173819==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x0000000000f8 (pc 0x7fd973a5e023 bp 0x7ffd906bec70 sp 0x7ffd906bea60 T173819)
==173819==The signal is caused by a WRITE memory access.
@Alan-Jowett
Copy link
Collaborator

@pcy190 bounds checking is not implemented at all for JIT.

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

No branches or pull requests

2 participants