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

Incorrect exit implementation in JIT compiler #436

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

Incorrect exit implementation in JIT compiler #436

pcy190 opened this issue Apr 25, 2024 · 1 comment

Comments

@pcy190
Copy link

pcy190 commented Apr 25, 2024

When we run PoC program in the JIT compiler, we get the return value as 224 after execution. While the correct return value should be 0.
The code generation implementation of EBPF_OP_EXIT in JIT compiler does not correctly handle the initial r0 value.

mov %r2, 0xFFFFFFFF
exit

We observed the following inconsistency:

// result after program execution
interpreter: 0
JIT: 224
@Alan-Jowett
Copy link
Collaborator

This is undefined behavior from a malformed program. I have a PR #445 to add a runtime check in the interpreter to reject this.

@pcy190 pcy190 closed this as completed May 28, 2024
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