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

Assertion failed: !intv.is_bottom(), file E:\ebpf-verifier\src\crab\split_dbm.cpp, line 953 #736

Open
Alan-Jowett opened this issue Oct 16, 2024 · 2 comments · May be fixed by #737
Open

Comments

@Alan-Jowett
Copy link
Contributor

Test case:

test-case: repro

pre: [r0.type=number]

code:
  <start>: |
    if r0 s< 0x8000 goto <exit>
    r0 %= 0x808
  <exit>: |
    exit

post:
  - r0.type=number

This was found while fuzzing using uBPF libfuzzer. Issue appears to be in the mod operation.

@Alan-Jowett
Copy link
Contributor Author

Some more debugging info:
Range for r0 at start of "r0 %= 0x808" = [32768, 9223372036854775807]
Lower bound: dividend=32768, divisor=2056
Upper bound: dividend=9223372036854775807, divisor=2056

Resulting range:
[1928,1927]

Which turns into bottom.

@Alan-Jowett
Copy link
Contributor Author

A more complete test case:

---
test-case: Inverted range after modulo

pre: [r0.type=number]

code:
  <start>: |
    if r0 s< 0x8000 goto <reset>
    r0 %= 0x808 
    goto <exit>
  <reset>: |
    r0 = 0
  <exit>: |
    exit

post:
  - r0.type=number
  - r0.svalue=[0, 2055]
  - r0.uvalue=[0, 2055]
  - r0.svalue=r0.uvalue

The issues are:

  1. This asserts.
  2. It ends up with the wrong range afterwards. It claims that r0=2055 is not possible, when it clearly is.

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 a pull request may close this issue.

1 participant