* Add bpf2c_plugin
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix CMake so that it builds correctly
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Remove bpf_conformance as a submodule
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Download bpf_conformance artifact
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Extract bpf_conformance\
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix path
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Execute bpf_conformance in CI/CD
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Pickup latest artifacts"
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
* Refactor netebpfext (#1351)
* refactor netebpfext to allow unit and fuzzing
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Normalize parameter casing
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Normalize types
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix release build
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix CMake build
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix NetEbpfExt_headers CMake target
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Rename unit to user
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Switch netebpfext_unit -> netebpfext_user
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Flesh out kernel thunk
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* More canonical naming and W4 clean
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix prefast issue
* Fix CMake
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix code analysis
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Clean up fw_thunk.h (#1369)
* Clean up fw_thunk.h
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix SAL annotations
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Netebpf ext unit test (#1365)
* Add netebfpext start/stop unit tests
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Update NMR thunk and expand netebpf_ext helper
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix code-analysis issues
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Remove duplicate NMR includes (#1370)
* Remove duplicate NMR includes
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback and more header cleanup
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Refactor NMR user mode to be thread safe (#1371)
* Refactor NMR user mode to be thread safe
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Add a unit test that tests classify_packet in user mode (#1379)
* Add packet test scaffolding
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More of test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add dummy packet to test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add dummy program
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Cleanup
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix mock NMR bug
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Temporarily add printfs
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Incorporate fix for 1378
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix test bug
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add a packet-drop case to the test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Try fixing include path
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix double free of workitem
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Revert unrelated changes in ebpfcore and ebpfapi
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
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>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
* Update release data
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add NSIS support to generate a setup exe
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More of the implementation
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add net start/stop actions to the msi
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Cleanup
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* First step in conversion to common install script
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Convert to common setup script
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Snapshot before cleanup
this version does install the netsh helper
it does not delete the files from system32 on uninstall
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Cleanup
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More cleanup
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix build
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix driver test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Drop verifier fuzzer test to 15 mins
Same as the bpf2c fuzzer. This removes 15 mins from the long pole
for CI/CD.
Signed-off-by: Dave Thaler <dthaler@microsoft.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>
* 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>
* Add libfuzzer based fuzzer.
See: https://www.llvm.org/docs/LibFuzzer.html
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix ELF parsing bugs found by fuzzer
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Make verifier fuzzer compile in Debug configuration
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Cleanup fuzzer code
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Setup/cleanup state for fuzzing
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix debug build of execution_context_fuzzer
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix verifier
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Pickup latest ebpf-verifier
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Remove corpus from git
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix CR/LF mangling in ELF files
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Remove corpus from git
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix build break
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Enable debug fuzzer build
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Update to latest verifier
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update test based on latest verifier changes
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix execution context fuzzer
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
Tests are failing because they cannot complete in 30 minutes.
Temporarily increase the test timeout value.
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Build self-contained Convert-BpfToNative.ps1
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Update cmake build with code to generate Convert-BpfToNative.ps1
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Skip checkout of repo for ossar scan
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix broken yaml
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix ossar dependency on git
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Set CMAKE_SYSTEM_VERSION and CMAKE_CXX_STANDARD
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Switch to currently supported SDK version
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Upload build output as artifact.
Resolves: #1030
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Switch fuzzing to run on sanitizer build
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Remove fuzzing coverage from blocking reporting
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Run the CI/CD on push to main (after merge of a PR)
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Enable capturing triage dump on test crash
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Use LLVM version 11.0.1
Fixes#962
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Updated expected bpf2c output from LLVM 11
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
* Add ETW tracing to CI/CD test run
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Add ETW tracing to CI/CD test run
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Add ETW tracing to CI/CD test run
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix yaml
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix yaml
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Limit etw to where it makes sense
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Remove ebpf_verify_program API
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Remove old test
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Cleanup runners
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Cleanup old artifacts
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Switch from verbose success logging to just duration
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* Enable verification on supported file and disable for map.o
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* Gather code coverage from within self-hosted runner
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* Add short haul stress test
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* Don't log success assertions in stress test
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
* Put back permission security-events: write to permit codeql to run
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
* CodeQL build takes > 30 minutes
* Cancel workflows if PR is updated with a new commit
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix typos
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>