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

38 Коммитов

Автор SHA1 Сообщение Дата
Gianni Trevisiol 9f16dd94e2
Fix CVE 2024 29188 (#3406)
* update Wix to 3.14.1

* update links
2024-03-28 06:11:38 +00:00
Matthew Ige a995522b68
update release version to 0.15.0 (#3389) 2024-03-25 23:53:46 +00:00
Gianni Trevisiol 5e84f5c914
draft (#3333) 2024-03-12 22:58:51 +00:00
Gianni Trevisiol fbeb01923e
Fix CVE-2024-24810 (#3304)
* upgrade Wix to 3.14

* wip
2024-02-27 06:04:45 +00:00
Sharmi 537a66ffa1
Release v0.14.0 (#3240)
* Release v0.14.0

* Fixed names in Release-manager section

* Remove pre-commit file

* Updated doc

* Revert the changes in ReleaseProcess.md
2024-02-07 18:41:45 +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
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
Gianni Trevisiol 40822e69cd
Update sources to v0.13.0 (#3030) 2023-11-08 16:59:16 +00:00
Gianni Trevisiol b6ef96334a
Release v0.12.0 (#2937)
* Update sources to v0.12.0

* refresh
2023-10-05 20:03:03 +00:00
Gianni Trevisiol 59587f3196
Release v0.11.0 (#2846)
* Update version to 0.11.0

* Revert formatting rule.
2023-09-12 21:36:08 +00:00
Sharmi 5cc488fb08
Increase MAX_TAIL_CALL_CNT to 33 tail calls (#2826)
* Initial Commit

* Added tail call max exceed native test case

* Initial commit

* Initial commit

* Added bpf2c_tests/expected changed files

* Fixed the return value in bind_tailcall_max_native_test

* Addressed PR comments

* Update tests/unit/libbpf_test.cpp

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* Update tests/unit/libbpf_test.cpp

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* tests/unit/libbpf_test.cpp

* Moved MAX_TAIL_CALL_CNT to ebpf_structs.h as suggested

* Removed MAX_TAIL_CALL_CNT in api_test and stress_tests_km file

* Add the generated expected file for tail_call_max_exceed

* Removed MAX_TAIL_CALL_CNT from bpf_helpers.h

---------

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2023-09-11 16:55:56 +00:00
Dave Thaler c947ca63b9
Make runtime binaries not depend on usersim (#2783)
* 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>
2023-09-05 17:57:21 +00:00
Dave Thaler 4e6bed34e8
Build ebpfcore as a DLL for testing (#2744)
* Update to use latest usersim

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* build ebpfcore under usersim

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update usersim to latest

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix compilation

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>

* Fix memory issues in libbpf implementation

Found my latest usersim code

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update usersim to latest

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix mismatched calloc/free function in ubpf_user.c

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix mismatched alloc/free in verifier_fuzzer

The verifier_fuzzer used ebpf_allocate() but then called free()

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Temporarily use ubpf branch with memory fix

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix memory issues in ebpfsvc

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>
2023-08-17 22:55:15 +00:00
Gianni Trevisiol 7c050eba90
Update src to v0.10.0 (#2741) 2023-08-08 01:48:48 +00:00
Gianni Trevisiol 4cb79e547d
Isolate eBPF store APIs into atomic km & um libraries. (#2690)
* draft

* wip

* wip

* wip

* wip

* wip - km & um compile

* fix

* fix include order

* wip

* wip

* wip

* wip - api_common

* wip - updated projects

* wip

* wip

* fix merge issues

* wip

* fix C28196/C6387

* wip

* wip

* fix SAL

* cleanup

* fix SAL bugs

* wip - cmake

* add cmake files

* wip

* wip

* update msi artifacts

* wip

* cleanup

* collapse null-checks

* clean-up headers

* refactor return types to ebpf_result_t

* replace ebpf_registry_result_t with ebpf_result_t

* update header

* remove cpp wrapper, misc cleanup.

* rename um/km registry helpers

* cleanup

* cleanup

* update

* nit

* fix

* Added KERNEL_MODE var, so to default to USER_MODE.

* fix cmake

* align result var names with ebpf_result_t

* pr feedback

* add project refs

* Add NativeOnly* cfgs to ebpf_store_helper_km

* Update docs, API reordering in source.

* pr feedback

* Rename types to abstract use of registry

* Normalize all registry API names.

* rename

* merge sln

* fix var typo

* refactor store root keys

* feedback

* doc/comments

* remove KERNEL_MODE

* Force ignore format on all preprocessor code paths.
2023-08-07 19:53:24 +00:00
Dave Thaler a29064a1fe
Convert usersim to a DLL (#2683)
* Use usersim as DLL

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Convert usersim to a DLL

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Make cmake build clear program info state like VS build does

PR #1192 updated the vcxproj file but not the corresponding CMakeLists.txt file
for export_program_info

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Pick up latest usersim fix

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix deadlock in epoch_test_stale_items test

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Don't throw exceptions in unit tests

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix single instance hook initialization in test cases

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix deadlock in performance test

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Add usersim.dll to installer files

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-07-27 18:36:05 +00:00
Dave Thaler 8fecc2e376
Make bpf2c maps parser match verifier's maps parser (#2543)
* Add map_in_map_legacy.c

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Make bpf2c maps parser match verifier's maps parser

The verifier will parse "maps/*" sections, and is able to deal with
maps sections with various record sizes.  This PR updates bpf2c to
use the same algorithm.  In the future it would be good to refactor
the verifier so the same code can be used.

Fixes #900

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Make tests pass

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* PR feedback

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Rename map_in_map_* samples

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix BTF ID resolution

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* PR feedback

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Cleanup

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Bug fixes

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Add doc fix

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update verifier

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Updates for libbtf

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Use libbtf

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix sanitize build by using updated libbtf

Temporarily point to fork until https://github.com/vbpf/ebpf-verifier/pull/515
is merged, so we can verify the fix in CI/CD.

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update ebpf-verifier

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* PR feedback

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-06-28 18:32:13 +00:00
Dave Thaler 87b6520c34
Remove JIT and interpreter code from NativeOnly builds (#2475)
* Remove JIT and interpreter code from NativeOnly builds

Fixes #2030
Fixes #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>
2023-06-07 15:49:03 +00:00
Sharmi 8adab0de10
stress test for tail calls (#2518)
* Add stress test for tail calls

* Added the code generated bindmonitor_mt_tailcall files

* Added the test case description to readme.md

* Update tests/stress/km/stress_tests_km.cpp

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* Update tests/stress/km/stress_tests_km.cpp

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* Addressed PR comments and Fixed merge conflicts with latest

* Fixed function name

* Regenerated the expected files, after the macro MAX TAIL CNT change done yesterday

* Update tests/stress/readme.md

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* Removed clean_up tail call

* Add bind in loop

* updated the readme

* Addressed PR comments

* Changed LOG_VERBOSE to LOG_ERROR

* Updated readme and addressed PR comment

---------

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2023-06-07 05:21:47 +00:00
Alan Jowett 396412bc56
Add recursive tail call test (#2504)
* Add recursive tail call test

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

* Add sequential tail call test

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

* PR feedback

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

* PR feedback

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

* Fix code analysis failure

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

* Document workaround for bpf_helpers.h conflict

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

---------

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2023-05-24 20:01:01 +00:00
Gianni Trevisiol 4f41426bf1
Release v0.9.0 (#2425)
* Release 0.9.0

* nit newline
2023-05-03 03:17:59 +00:00
Dhiren Vispute c0e0804456
Ensure non-zero helper function count before using it in allocation computations. (#2393) 2023-05-02 00:50:34 +00:00
Alan Jowett 8b1a8e4e0f
Update NuGet packages (#2386)
Co-authored-by: Alan-Jowett <Alan-Jowett@users.noreply.github.com>
2023-04-28 15:57:08 +00:00
Dhiren Vispute 83567d6270
Add Multi-threaded stress tests (kernel mode). (#2240) 2023-04-25 21:00:44 +00:00
Gianni Trevisiol 8b016be1fd
Improve MSI UX, Wix project update (#2221)
* Reinforce installation policies.

* wip

* wip
2023-03-22 20:51:15 +00:00
Sharmi 282134fc34
Added cgroup_sock_addr2 related files to deploy-ebpf and Product.wxs script (#2193)
* Added cgroup_sock_addr2 related files to deploy script

* Added bpf2c_tests in wixproj file
2023-03-15 23:48:01 +00:00
Alan Jowett 14580fd5e3
Move extension definitions to their own file (#2172)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2023-03-10 21:39:46 +00:00
Gianni Trevisiol 9f58bcb653
Release v0.7.0 (#2169)
* wip

* wip

* wip

* doc

* Fix bpftoc generation script
2023-03-09 18:44:06 +00:00
Gianni Trevisiol 9a2e8ee331
Sync msi's libbpf directory tree to nuget (#2149)
* draft

* include sync

* doc

* doc - release step

* remove pdb
2023-03-07 01:22:09 +00:00
Gianni Trevisiol 5f4a933f43
Complement artifacts in msi testing feature & PS deploy script's input. (#2088)
* Add testing artifacts, doc tweaks

* doc mods

* Add missing artifacts in deployment script.

* wip

* doc update

* Update docs/InstallEbpf.md

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

---------

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2023-02-22 01:34:44 +00:00
Gianni Trevisiol 7d6880ad54
Add missing libbpf includes. 2023-02-10 14:05:57 -08:00
Gianni Trevisiol 65997905b9
Add restricted SID to JIT+artifacts for api_tests (#2057)
Co-authored-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com>
2023-02-09 19:15:17 +00:00
Gianni Trevisiol c3325dc961
Add Wix Toolset as a `nuget` package. 2023-02-07 21:55:35 +00:00
Gianni Trevisiol 64e6812784
Add JIT option for MSI Release bits and CI/CD. (#1986) 2023-01-31 10:03:20 -08:00
Gianni Trevisiol 83ddc74d1d
Fix eBPF store clear/setup and add logs to `export_program_info.exe` (#1975)
* fix ebpf store & tool logs

* bare vm pass
2023-01-30 07:53:19 -08:00
Gianni Trevisiol 715715520c
Added Wix installer native project. (#1960)
* Added Wix native installer.

* Update docs/InstallEbpf.md

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* Update docs/InstallEbpf.md

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* typos

* Change ebpfsvc as a "JIT" option for Debug-only.

* misc fixes and improvements

* fix env path

* upload the msi package as a separate artifact

* fix sample driver uninstall, added log doc

* tests passed

* Doc update

* conditional MSI upload for regular/release only

* Upload dual installer version

* Set all drivers to auto start.

* update hash in doc

* Add check for VC++ redist

* doc update

* workaround for WixQuietExec64

* doc update

* Update scripts/run_tests.bat

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2023-01-26 21:25:23 -08:00