* Build ELF parse at compile time using EverParse
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix build
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Add interface luid to bpf_sock_addr and bpf_sock_ops
And also add compartment id to bpf_sock_ops for consistency with
bpf_sock_addr, so that it is available to eBPF programs.
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Expose interface luid and compartment id to sock_ops and sock_addr hooks
* compartment_id was exposed to sock_addr but not sock_ops
* interface_luid was not exposed to either
Exposing the interface_luid should be a performant way to compensate for
lack of scope_id in the hooks, since the interface luid is available
in the WFP callout, and is more specific than a scope id (so a scope id
can always be looked up from the interface luid in the future if
needed).
Fixes#1129
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update expected bpf2c output
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add SAL
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Test helper's _net_ebpf_xdp_adjust_head shouldn't permit unbounded memory allocations
This bug only affected the tests, not the actual runtime.
Also fix some annotations found while debugging this
Fixes#1218
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Mark unsafe strings via unsafe_string class
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Cleanup string handling
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Update expected output in tests
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Build break
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
* Enable verifier fuzzer in github CI/CD
This is another piece split out from PR #1153
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add -artifact_prefix=Artifacts\
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
* WIP: core helper fuzzer scaffolding
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Initial chunk of business logic
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
More business logic
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Add initial helper fuzzer corpus
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Fix code analysis warning
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Update docs and CI/CD
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Update README.md
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Fix analysis warning
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Add verifier_fuzzer step to github CI/CD
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Add core helper and bpf2c fuzzers to CI/CD
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Fix fuzzers in CI/CD
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Remove changes for other fuzzers from cicd file
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Cleanup
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix bug in _find_lpm_map_entry() hit by fuzzer
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* port quota
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix port_quota load
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
* Reject malformed ELF file with bad section size
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Reject empty sections
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Validate all sections before use
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Enable bpf2c fuzzer and execution context fuzzer in CI/CD
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Create bpf2c fuzzer corpus
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Make absolute path and strip trailing slash from it. (#1175)
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Add libsancov.lib when building fuzzer (#1179)
* Add libsancov.lib when building fuzzer
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* upload artifacts as dumps
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Bpf2c fuzzer fix build (#1180)
* Disable caching of verifier cmake project for now
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix dump upload path
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix dump upload path
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix crash dump upload
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Add Execution Context corpus
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Limit fuzzing to 15 minutes
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix artifact path
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix yaml to corectly upload artifacts
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix yaml to corectly upload artifacts
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix yaml to corectly upload artifacts
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Bpf2c fuzzer fix build (#1182)
* Disable caching of verifier cmake project for now
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Limit fuzzing memory
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Validate symbols offset
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Reject maps that have no associated symbols
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Create bpf_map structures from bpf_object__open() on a native file
Fixes#1140
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix map update when loading native object
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update tests
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix for test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More test fixes
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More test fixes
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* PR feedback
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* PR feedback
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* WIP: core helper fuzzer scaffolding
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Initial chunk of business logic
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More business logic
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add initial helper fuzzer corpus
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix code analysis warning
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update docs and CI/CD
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update README.md
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix analysis warning
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add verifier_fuzzer step to github CI/CD
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add core helper and bpf2c fuzzers to CI/CD
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix fuzzers in CI/CD
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Temporarily revert cicd.yml changes
To see if tests pass or not
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Temporarily revert more files
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update to latest libbpf and bpftool
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update to latest verifier commit
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Increase bound on instruction count
And align more with other platforms
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix compiler error
Signed-off-by: Dave Thaler <dthaler@microsoft.com>