-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add more negative unmarshaling tests #591
Conversation
Does this need a rebase now? |
Done, just in case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general; see some style comments below.
Other style points:
- This is an opportunity to have uniform capitalization too. I suggest all-lowercase.
.c_str()
is never needed here. We can also use std::format() for simplification, either now or in a future PR.
Signed-off-by: Dave Thaler <[email protected]>
Signed-off-by: Dave Thaler <[email protected]>
Signed-off-by: Dave Thaler <[email protected]>
Signed-off-by: Dave Thaler <[email protected]>
Signed-off-by: Dave Thaler <[email protected]>
Github's "ubuntu-latest" runner supports clang 15. |
Done |
Signed-off-by: Dave Thaler <[email protected]>
Signed-off-by: Dave Thaler <[email protected]>
This change is table-based, using a table of all instructions based on the table in the BPF ISA specification.
It implements an algorithm to walk the table and test invalid variations of such instructions, thus catching more cases that were not previously validated.
A few things that were validated but gave inconsistent error messages for different opcodes are updated to be consistent throughout.
Instructions that are only defined where 0 is in some field are no longer treated as part of the same instruction, since there could be other instructions in the future that use other values. For example, "nonzero src for register" used to be shown as the error when passing src > 0 for some opcodes that are only defined for src = 0, which is now a "bad instruction" since it's available for use by a new separate instruction, per the ISA spec.