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

Undefined behavior when a test attempts to compare values against stack pointers #293

Open
RaoNikitha opened this issue Aug 6, 2024 · 0 comments

Comments

@RaoNikitha
Copy link

The below test attempts to use r10 as a src register for JSLT. Libbpf and bpf2c both exhibit different undefined behavior. uBPF catches the error.

-- asm
mov %r1, 2
mov %r0, 1
jslt %r10, %r1, lbl
exit
lbl:
mov %r0, 0
exit
-- result
0x1

Test execution outcome across three different plugins:

bpf2c

PASS: Test succeeded

libbpf

FAIL: Plugin returned incorrect return value 0 expected 1

uBPF

ERROR: Plugin returned error code 1 and output Failed to load code: invalid destination register at PC 2
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

1 participant