Only permit jumps within sub-programs #581
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to improve the robustness and functionality of the eBPF verifier and the UBPF virtual machine. The most significant changes involve adding error handling to the fuzzer harness, updating the submodule for the eBPF verifier, and enhancing the UBPF VM to ensure the integrity of sub-programs.
Error Handling Improvements:
libfuzzer/libfuzz_harness.cc
: Added try-catch block inLLVMFuzzerTestOneInput
to catch and log exceptions, improving error handling during fuzz testing. [1] [2]Submodule Update:
external/ebpf-verifier
: Updated the submodule commit to a newer version, likely including various improvements and bug fixes.UBPF VM Enhancements:
vm/ubpf_vm.c
: Introduced a new functioncheck_for_self_contained_sub_programs
to ensure that sub-programs only enter via calls and exit properly, preventing jumps out of one program into another. This change includes several helper functions for sorting and deduplicating arrays. [1] [2] [3]Test Data Update:
tests/err-call0.data
: Added an error message to the test data to reflect the new validation logic for sub-programs.