Граф коммитов

213 Коммитов

Автор SHA1 Сообщение Дата
Sharmi f23ab7def5
Support TraceLoggingBinary for map find, update and delete. (#3781)
* 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
2024-10-04 20:20:47 +00:00
Alan Jowett 5068110219
Centralize eBPF version to Directory.Build.props (#3893)
* Centralize eBPF version to Directory.Build.props

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Remove unused and failing builds

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>
2024-10-04 15:12:31 +00:00
Alan Jowett 735ec5277f
Refactor common platform and config into Directory.Build.props (#3891)
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
2024-10-02 19:14:14 +00:00
Alan Jowett f5195ecf63
Allow platform specific eBPF nuget packages to be created (#3892)
* Allow platform specific eBPF nuget packages to be created

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Specify version in output

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>
2024-10-02 18:56:45 +00:00
Anurag Saxena e1f4ce337c
run `api_tests` as system (#3857)
* add psexec tests

* update scripts

* update script, change store load order

* skip system tests from regression tests

* update test script
2024-09-30 04:00:17 +00:00
D. Michael Agun a41953dc62
remove --no-verify option from bpf2c and tests using it (#3673)
* remove --no-verify option from bpf2c and tests using it

Closes #3571

* remove builds for unsafe programs in sample.vcxproj

* remove unsafe test cases from netsh_test.cpp

* remove new noverify references

* Revert deletion of netsh tests.

* Add back compilation of unsafe programs (but not bpf2c call)

* remove invalid program tests which used noverify

* remove end_to_end tests using noverify

---------

Co-authored-by: Michael Agun <danielagun@microsoft.com>
2024-09-14 00:45:03 +00:00
Shankar Seal 6e8f47a7c0
update onebranch scripts. (#3824) 2024-09-09 19:40:42 +00:00
Matthew Ige 3a81409a4d
Add retry logic when scripts fail to extract a zip file (#3812)
* try logic with retry

* minor fixes

* param fix

* fix2

* fix

* add missing break
2024-09-09 15:19:27 +00:00
Michael Friesen 9a8244902d
relocate installer license to avoid "multiple licenses" text on GitHub (#3802) 2024-08-30 00:20:22 +00:00
Alan Jowett 8c838d1ab5
Stamp all tools with version information. (#3792)
* 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>
2024-08-27 16:30:12 +00:00
Alan Jowett 59c5f5d6a5
Add ADO pipelines (#3741)
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
2024-08-22 23:34:45 +00:00
Shankar Seal bde5a20dca
Override `bpf_get_current_pid_tgid` for sock_ops hook. (#3765)
* initial changes.

* sock_addr.

* fixes.

* Update include/ebpf_nethooks.h

Co-authored-by: Dave Thaler <dthaler1968@gmail.com>

---------

Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
2024-08-22 23:27:51 +00:00
Lorenz Bauer b7c6e9b24e
Fix Setup-DevEnv.ps1 (#3770)
Fix a missing " which breaks executing the setup script. Also add -y to
the wixtoolset installation.
2024-08-21 18:39:04 +00:00
Alan Jowett 3738c826c7
Switch to using Visual Studio's version of LLVM and Clang (#3754)
* Add VS Clang to path

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Fix tests

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Reformat using clang 17.0.3

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Account for git_commit_id.h dependency

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Revert https://github.com/microsoft/ebpf-for-windows/pull/3756 from this branch

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Make LLVM path dependent on cl.exe path

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Use VCINSTALLDIR as root of LLVM path

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Update hash and set path to use environment variable

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>
2024-08-07 16:43:47 +00:00
Shankar Seal 5ecb5ee8c6
Update post-build.ps1 (#3755) 2024-08-06 16:14:12 +00:00
Shankar Seal c7efd73451
Remove undocked solution. (#3739)
* fix undocked solution.

* update.

* PR feedback.
2024-08-05 15:24:23 +00:00
Shankar Seal b9d6cb6b7e
update version to 0.18.0 (#3690) 2024-07-15 18:43:20 +00:00
D. Michael Agun 2efce152dc
Set empty program name to hash of instructions (#3493)
* Move C++ hashing lib from tests/libs/util/ to libs/shared/

This puts hash.cpp/hash.h in a more central location for use by other project files.

* Set empty program name to hash of instructions

ebpf_program_load_bytes now hashes the instructions and uses that for the name
instead of generating a random number.

Closes #3443

* fix signed/unsigned warning (and ensure windows helper id >= 0)

* add bcrypt.dll dependency for ebpfapi.dll

* WIP new test case for ebpf_program_load_bytes with nullptr program name

* WIP ebpf_program_load_bytes testing

* truncate SHA256 hash to 63 bytes to stay under BPF_OBJ_NAME_LEN

* remove bcrypt from release dependencies and suppress analyze warning

* PR feedback - fix comment and bpf2c include paths

---------

Co-authored-by: Michael Agun <danielagun@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2024-07-02 14:47:03 +00:00
Alan Jowett 95060af117
Enable building and signing eBPF for Windows (#3651)
* Enable building and signing eBPF for Windows

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>
2024-06-19 22:01:26 +00:00
Anurag Saxena a4a82aeeaf
Update regression tests to 0.17 (#3642)
* update regression tests

* script path changes

* skip test

* skip tests
2024-06-19 06:18:19 +00:00
Anurag Saxena ebf0a32d29
Multiple MSVC related fixes (#3623)
* skip test

* fix test

* update tests to accept both old and new values

* include vc redist in MSI
2024-06-12 17:06:58 +00:00
Dave Thaler d096b21ac5
Update copyright to be eBPF for Windows contributors (#3508)
* 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>
2024-05-04 19:55:56 +00:00
Anurag Saxena cf05004d7b
Implement `bpf_get_socket_cookie()` (#3464)
* implement bpf_get_socket_cookie

* fix tests

* fix more tests

* fix tests

* cleanup

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler1968@gmail.com>

* fix regression tests

---------

Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
2024-04-24 23:39:57 +00:00
Shankar Seal 4b40f9f6e9
Various fixes to the extension version logic. (#3432)
* various fixes.

* fix mem leak.

* fix double free/

fix one more leak.

* PR feedback.

s# Please enter the commit message for your changes. Lines starting
2024-04-19 19:36:02 +00:00
D. Michael Agun bbaa3660e7
Update install script to refresh Path (#3462)
Co-authored-by: Michael Agun <danielagun@microsoft.com>
2024-04-18 18:24:23 +00:00
Alan Jowett e3dc614044
Add script to forcefully remove ebpf-for-windows (#3441)
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
2024-04-12 18:36:21 +00:00
Shankar Seal 73647f801b
Reallocate packet (#3344)
* reallocate_packet.

* PR Feedback.
2024-04-04 00:49:27 +00:00
Anurag Saxena 37b7cc5970
Add kernel regression tests (#3421)
* add tests

* fix

* add traces to scripts

* add temp test

* Revert "add temp test"

This reverts commit 9ca282a62e.

* code cleanup

* pass version as param

* fix

* fix.

---------

Co-authored-by: Shankar Seal <sseal@microsoft.com>
Co-authored-by: Shankar Seal <74580197+shankarseal@users.noreply.github.com>
2024-04-03 18:52:02 +00:00
Shankar Seal fc973542c9
extension_header (#3326)
* 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
2024-03-30 17:27:09 +00:00
Gianni Trevisiol a0aa7c5aba
Update manual deploy process. (#3380)
* draft

* wip

* tested

* cli doc

* nit

---------

Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
2024-03-28 07:50:02 +00:00
Dhiren Vispute e82fa1a992
Fix user, kernel dump harvesting regression (#3398)
Co-authored-by: Dhiren Vispute <Dhiren.Vispute@microsoft.com>
2024-03-27 22:28:03 +00:00
Igor Klemenski 39874fb083
Swallow wpr cancel error in uninstallation path. (#3400)
* Swallow wpr failure code in msi uninstall apth.

* override exit code

* wrap wpr cancel in process

---------

Co-authored-by: Igor Klemenski <igklemen@microsoft.com>
2024-03-27 21:25:52 +00:00
Gianni Trevisiol 1eaa5681d3
Refactor all deployments to use the MSI package. (#3284)
* draft

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* test

* wip

* wip

* test

* test

* wip

* test

* wip

* wip

* wip

* test

* wip

* wip

* fix debug installation

* update VM install doc

* wip

* wip

* wip

* wip

* wip

* improve msi log readability

* wip

* debug

* nits

* feedback

* nl

* updates

* add extra stop-check

* wip

* wip

* nit

* fix

* doc

* exclude doc

* sync
2024-03-21 21:08:57 +00:00
Dhiren Vispute b494058832
Rework dump handling, add trace messages, fix process id for user mode dump (#3355)
Co-authored-by: Dhiren Vispute <Dhiren.Vispute@microsoft.com>
2024-03-21 17:40:56 +00:00
Gianni Trevisiol 5e84f5c914
draft (#3333) 2024-03-12 22:58:51 +00:00
Dhiren Vispute 00c6428dd5
Use custom script wrapper for all km tests to capture user, km dumps on hangs (#3163)
Co-authored-by: Dhiren Vispute <Dhiren.Vispute@microsoft.com>
2024-03-08 16:36:10 +00:00
Alan Jowett bf2a7c3eb5
Add support for statically initializing BPF_MAP_TYPE_HASH_OF_MAPS (#3211)
* Add support for statically initializing BPF_MAP_TYPE_HASH_OF_MAPS

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Update installer and add code gen tests

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Add files to expected install list

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>
2024-01-31 00:18:28 +00:00
Alan Jowett f4e3bc79cf
Add malformed ELF files to bpf2c corpus (#3198)
* Add crashing ELF file to corpus

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Resolve merge conflict

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Overhaul of malformed ELF file tests

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Fix build break

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Fix build failure

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>
2024-01-29 00:18:01 +00:00
Anurag Saxena f6a478842a
Remove store km lib and code (#3109)
* 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>
2023-12-12 13:53:04 +00:00
Gianni Trevisiol 911cefc1bd
Automate repo init & reset (#3108)
* add init script & doc update

* Update doc

Co-authored-by: Dave Thaler <dthaler1968@gmail.com>

* Update docs/GettingStarted.md

Co-authored-by: Igor Klemenski <Igor.Klemenski@microsoft.com>

* modify ci/cd script

* optimize

* nit

* fix break from #3104

* Revert "optimize"

This reverts commit 611bf6e59c.

* sync

* check exit code

* nit

---------

Co-authored-by: Dave Thaler <dthaler1968@gmail.com>
Co-authored-by: Igor Klemenski <Igor.Klemenski@microsoft.com>
2023-12-08 23:08:42 +00:00
Anurag Saxena 3f5e0ba1ba
Separate out undocked components. (#3055)
* remove not-needed includes

* fix

* fix

* update sample extension

* change include path

* export store APIs from ebpfapi.dll

* fix analyze build

* update dependencies

* add undocked projects

* undock sample_ext driver

* fix build

* more undocking

* fix build

* remove undocked projects from fuzzerdebug

* fix nuget

* remove usersim from export_program_info

* fix configuration manager

* fix tests

* skip building undocked samples for FuzzerDebug builds

* fix build

* try cicd changes

* fix cicd yml

* update export_program_info to not clean up all entries

* code cleanup

* delete global helpers from the store

* code cleanup

* export *delete* store APIs from ebpfapi

* code cleanup

* CR comments

* cr comments

* remove ansi APIs

* CR comments

* cr comments

* fix CI failure

* fix rebase build issues

* change default custom type to bind

* some more fixes

* fix tests

* fix tests

* update expected files

* fix bpf2c tests

* run export_program_info

* fix headers

* CR comments
2023-12-07 21:10:19 +00:00
Alan Jowett 041d402eeb
Fix build break from VS 2022 17.8.2 (#3104)
* Fix build break from VS 2022 17.8.2

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Fix conflicting C++ versions

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* New depenedency on kernel32.dll

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Pickup latests usersim

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>
2023-12-07 00:58:33 +00:00
Matthew Ige 2000dafc4e
Remove XDP hook support from netebpfext.sys (#3040)
* 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
2023-12-06 17:12:17 +00:00
Igor Klemenski 675f0d2557
Compress KM dumps and perf ETLs before upload. (#3029)
* Compress Km dumps and perf ETLs before upload.

* Force run on PR.

* run just perf test release

* print out etls before zip

* fix up etl path

* uncomment CI

* cleanup

---------

Co-authored-by: Igor Klemenski <igklemen@microsoft.com>
2023-11-09 00:41:09 +00:00
Pengfei Ni 4b9ba35173
chore: fix the hash for setup scripts (#3009)
* chore: fix the hash for setup scripts

* chore: fix the hash in the getting started guide
2023-11-07 22:36:34 +00:00
Sharmi 41e686d267
Fix ASAN linker error (#3027)
* Remove enable asan

* Test

* Test 2

* Change /spgo

* Add LTCG and WPO asan condition
2023-11-07 21:02:16 +00:00
Dhiren Vispute ed0435b130
Add support for in-memory etl traces (#2946)
Co-authored-by: Dhiren Vispute <Dhiren.Vispute@microsoft.com>
2023-10-26 19:01:46 +00:00
Igor Klemenski 708a1b623f
Restore VM after driver job finishes. (#3000)
Co-authored-by: Igor Klemenski <igklemen@microsoft.com>
2023-10-26 18:57:37 +00:00
Gianni Trevisiol ac75163cdf
Add MSI testing in the CI/CD pipeline. (#2953)
* draft - tested

* nit

* typo
2023-10-23 15:14:30 +00:00
Igor Klemenski 39704888f2
Test error fix (#2924)
* fixx COnnectRedirect test error reporting

* fix error pasring in api_test

* differential comparison - force api_test failure, should not be detected

* try conn_redir error catch

* restore

---------

Co-authored-by: Igor Klemenski <igklemen@microsoft.com>
2023-10-02 17:28:53 +00:00