* Initial commit
* Initial commit
* Added _DEBUG around tail call display
* Renamed key to data
* Removed _DEBUG
* Added SAL annotation, as per the comments
* Added SAL annotation, as per the comments
* Fix crash
* make data non-optional
* Added the check for .key_size != 0
* Removed additional tracing in EBPF_LOG_MESSAGE_BINARY macro
* Merged with main
* Trying 16KB of stack size
* Addressed PR comment
* Added macro with combined traces
* Increased stack size to 32K for DEBUG image
* Fix the string concatenation in macro
* Increase the stack size to 64, and added some logs to check the crashdumps during hangs
* Added retry when the dump file cannot be compressed because it is used by another process
* Expanded stack size for all netebpf wfp callouts
* Addressed PR comments
* Added _DEBUG back
* Increased stack size to 20K for DEBUG
* Add optimatization
* With 4K stack expansion size
* Final commit
* Stamp all tools with version information.
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Add commit id to nuget package
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Move versioning to Directory.Build.props
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Set correct project type in sample.vcxproj
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Add version info to fuzz tests
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Update tests/socket/resource.h
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
* Revert editor change
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 <dthaler1968@gmail.com>
* change ebpf_extension_header_t to ebpf_version_header_t
* revert to ebpf_version_header_t
* revert to ebpf_version_header_t
* update header
* update doc
* update doc
* use total_size to get the actual struct size
* Apply suggestions from code review
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
---------
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
* Update copyright to be eBPF for Windows contributors
Fixes#3507
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
* Undo gratuitous formatting changes in expected files
---------
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
* extension_header
* fix logic error.
* Re-purposing the size field to act as the "minor version". Additional validation checks are added.
* PR Feedback.
* fix break due to bad merge with PR #3372
* Set required_irql in sockops and sockaddr program information
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Update docs/eBpfExtensions.md
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
---------
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
* add connected UDP Tests
* ensure we do not issue two connect calls
* minor updates
* add debug traces
* temporarily remove connected udp tests
* add connected UDP tests for non-dual stack sockets
* enable v4 tests only
* only test redirect temporarily
* temporarily remove TCP tests
* fix connected udp issue by removing stale contexts
* remove debug tracing, add if check for free
* skip setting redirect context for connected udp
* update ebpf program
* update ebpf program for v6
* remove debug logs
* fix compiler error with incorrect enum
* update to use connection instead of protocol
* update to use connection instead of protocol
* update tests with CR feedback
* update expected
* update to using different key and value types to allow for proper usage of protocol vs connection type
* remove store km lib and code
* fix
* more cleanup
* Apply suggestions from code review
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
---------
Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
* replace XDP guids with XDP_TEST guids
* updated missde instance
* update bpf2c
* leave xdp_hook as is
* remove extra files
* update with new XDP_TEST guid, update other tests to use sample_ext
* update some tests, update test_helper
* update fuzzer
* temporarily remove bpftool tests
* update execution context test
* replace XDP guids with XDP_TEST guids
* updated missde instance
* update bpf2c
* leave xdp_hook as is
* remove extra files
* update with new XDP_TEST guid, update other tests to use sample_ext
* update some tests, update test_helper
* update fuzzer
* temporarily remove bpftool tests
* update execution context test
* build failures
* update sample ext with context_allocate and destroy
* update vm script to use xdp_test
* switch api tests to use sample program
* rename to xdp_Test
* update sample ext
* update incorrect SAL, update netsh tests
* update sample, update tests to use sample where applicable
* update tests
* fix up tests
* fix libbpf tets
* revert unnecessary changes
* remove extra prints
* add back in bpftool tests
* update to use xdp instead of xdp_test for bpftool test
* update atomic_instructions_others.o
* extra debug logs
* updated expected, update bpftool tests
* correct bpftool tests
* more debug logs
* add reg debug
* clear program info
* Attempt fix of buffer overrun
* remove debug logs, minor cleanup, set XDP guids back to their original names
* update docs with xdp_test
* fix guid usage
* CR: remove program, update comments, fix commented out tests, update bpf_program__attach_xdp
* revert changes in libbpf, as they need to use the actual XDP guids
* update comment
* update some XDP tests to use sample ext, comment out some expected failing tests
* update bpftool tests
* fix up bpf prog test run expected output, move to #if instead of comments
* fix up return code issue
* fix bpftool testes
* add some failed xdp tests, set some params to null for sample tests
* update comment
* tmp commit - move to xdp mock
* update unit tests to use mock XDP where possible
* made some samples back to XDP type
* netebpfext unit tests should use xdp_test
* CR
* Update to use latest usersim
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update to latest usersim
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Use NonPagedPoolNx instead of NonPagedPool for netebpfext state
NonPagedPool is executable, which we don't want
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update usersim
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
---------
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* build ebpfcore under usersim
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Work around analysis warnings
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix installer project
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Temporarily use ubpf branch with memory fix
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* WIP
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* WIP
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Create project for files shared between ebpfapi and the ebpf runtime
Move existing files from libs/platform either to:
* libs/shared, if meant to be common between user-mode and ebpf runtime
* libs/runtime, if meant to be used by the ebpf runtime only (whether in
user or kernel mode)
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Move ebpf_tracelog.c to shared
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Create shared_user and shared_kernel projects
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* WIP
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* WIP
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Remove usersim from ebpfsvc
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update to cxplat branch of usersim
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Use cxplat_utf8_string
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Cleanup
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix build errors
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix ebpf_allocate_with_tag
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fixes
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Bug fixes
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix use of ebpf_reallocate to not pass a null pointer
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix printf tests
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix memory leaks
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Temporary change to help debug double-free in test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update to latest usersim
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix analysis warnings
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update to latest usersim
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update usersim to latest
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Change native module to use latest usersim
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update nuget package
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Only call cxplat_cleanup if cxplat_initialize succeeds
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Revert setup_build.vcxproj change
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update usersim to latest
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
---------
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
Other projects can now consume ebpf-for-windows in binary form,
using either nuget or MSI install. We no longer need to build
ebpf-for-windows both ways, so removing the cmake build to free
up build resources and reduce the development cost of maintaining
both msbuild and cmake builds.
Fixes#2743
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update usersim library for DPC API support
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Flush queued DPCs before terminating usersim platform
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix fault injection test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix test bugs found by fault injection
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Use usersim Ke*Timer apis
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix bad uses of REQUIRE in netebpfext_unit constructors/destructors
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix mismatched initiate/terminate calls
Move Test-FaultInjection.ps1 to the usersim repo
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Use REQUIRE instead of throwing exceptions from unit tests
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Don't use REQUIRE in constructors
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix memory leak bug in netebpf_ext_helper destructor
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix reference count leak in net_ebpf_extension_sock_ops_flow_established_classify
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
---------
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More usersim library cleanup
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix analyze warning
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Use TraceLogging for printk
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix analysis warnings
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix deadlock in core_helper_fuzzer
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update usersim library
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix call to RpcStringFreeA
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
---------
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Use usersim repo
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Remove DISPATCH test code from _preprocess_load_native_module
Per Anurag: the code was added earlier to execute the 2 paths in
native module, and it is not needed anmore IIRC, as the "DISPATCH"
code has been removed now from the native module
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Bug fixes
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Unify some APIs
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix warnings and clean up code
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* updated
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
---------
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Remove JIT and interpreter code from NativeOnly builds
Fixes#2030Fixes#2488
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Try conditional project references
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Various test fixes
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Native-only fixes to deploy-ebpf.ps1
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Native-only support for setup-ebpf.ps1
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Native-only support for api_test.exe
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add connect_redirect_tests to deploy-ebpf.ps1
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* PR feedback from Anurag
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
---------
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add Fault Injection in Kernel OS APIs in kernel_um.cpp
* Removed fault injection from RtlCreateAcl and RtlULongAdd
* Removed fault injection from RtlCreateSecurityDescriptor and RtlSetDaclSecurityDescriptor
* Fixed codecov coverage
* fix SeAccessCheckFromState for the reported Code coverage warnings
* Addressed PR comment
* To get AddressSanitizer build
* Removed fault injection from FwpmFilterDeleteById0
* Added fault injection to fwp OS APIs
* Analyze fix
* Removed FI from Commit api
* Removed fault injection in FwpsFlowRemoveContext0