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

34 Коммитов

Автор SHA1 Сообщение Дата
Gianni Trevisiol 99b7ece81f
Visual Studio 2022 porting (#1521)
* Draft

* wip - full build

* wip

* Docs & scripts update

* revert test

* Updates to overall GettingStarted.md guide.

* Updated CI/CD scripts

* Update ebpf-verifier cache key

* Fix #1513. Next action forwarded to #1563.

* Bump up epbfverifier to 05bca47

* Fix CRT path.

* Disable sanitizing

* fix cmake build

* Removed unsupported x86 and ARM configurations.

* Test address sanitizer off

* wip -full build w/asan

* asan enabled on ci/cd

* update wdk version to 22621

* wip - full build

* add mock asan

* Update CL param

* wip - proj sync

* wip - ltcg

* wip - driver settings

* wip-build props

* wip - asan opts

* wip-plat asan

* wip-asan

* wip

* wip

* wip-debug

* Branch resync

* Mitigate compiler OOM.

* remove asan mock

* doc update

* doc update

* Removed commented code.

* Added comments for pragma-s
2022-12-08 20:06:57 -07:00
Alan Jowett 58cdfdcf8a
Spelling (#1601)
* Fix spelling in docs

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

* Fix spelling in ebpfsvc

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

* Fix include

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

* Fix libs part 1

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

* Fix libs part 2

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

* Fix tests

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

* Fix tools

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

* Fix build

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

* PR feedback

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

* Fix generated files

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

* PR feedback

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

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com>
2022-11-16 14:06:14 -07:00
Dave Thaler bdd4df8c58
Fuzz test netebpfext helper(s) (#1467)
* Use netebpfext_user in fuzz testing

Address the helper function part of #1325

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

* Fix winsock inclusion issues

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

* Fix nmr implementation

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

* Update WDK path for more projects

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

* Disable ubpf warnings

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

* Cleanup

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

* Fix unit tests

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

* Make build install execution context fuzzer corpus

Filed #1505 to improve this

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

* Fix libfuzz harness

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

* Fix MBL use by core helper fuzzer

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

* Fix cmake build

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

* Fix user-mode NMR locking issue

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

* Extra debug statements

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

* More fixes

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

* Cleanup

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

* Fix bad merge

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

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
2022-11-08 09:31:04 +00:00
Alan Jowett b6fa3543f7
Update ubpf and fix build (#1293)
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
2022-07-25 10:32:35 -07:00
Dave Thaler 85b8fd974b
MSI should install drivers and services (#1271)
* 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>
2022-07-08 12:58:56 -07:00
saxena-anurag 1160f7914e
Registry changes for program and section data. (#1192)
* fix

* backup

* fix backup

* msbuild compiling

* fix release build

* fixes

* cmake build fix

* fix cmake build

* fix analyse build

* fix

Signed-off-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com>

* fix expected output

* add pre step for tests

* add pre step for tests

* add -s option, revert this later

* Revert "add -s option, revert this later"

This reverts commit 1f42d100e4.

* code cleanup

Signed-off-by: Anurag Saxena <anusa@microsoft.com>

* rename driver_registry_helper.h

* delete bpf_structs.h

* fix

* hardcode HKLM

* code cleanup

* fix

* backup

* fix backup

* msbuild compiling

* fix release build

* fixes

* cmake build fix

* fix cmake build

* fix analyse build

* fix

Signed-off-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com>

* add pre step for tests

* add pre step for tests

* add -s option, revert this later

* Revert "add -s option, revert this later"

This reverts commit 1f42d100e4.

* code cleanup

Signed-off-by: Anurag Saxena <anusa@microsoft.com>

* rename driver_registry_helper.h

* delete bpf_structs.h

* fix

* hardcode HKLM

* code cleanup

* fix build break

* fix build break, enable warning

* fix bad merge

* cleanup

* fix

* fix tests

* add tests, make ebpf_store_helper platform agnostic

* fixes, cleanup, common code for store APIs

* fix cmake build, driver tests

* cleanup

* code cleanup

* cr comments

* code cleanup

* cleanup

* bugfix

* Apply suggestions from code review

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

* cr comments

* fix build break

* move UM read store APIs to a different file

* cr comments

* cr comments

* cr comments

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-06-30 16:53:03 -07:00
Dave Thaler ee166b5717
Increase instruction count limit (#1152)
* 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>
2022-05-31 16:02:05 -07:00
Alessandro Gario 6a54714ec2
cmake: Add base targets (#882)
Signed-off-by: Alessandro Gario <alessandro.gario@gmail.com>
2022-04-26 05:39:37 -07:00
Alan Jowett 1989d26873
Remove ebpf_verify_program API (#997)
* 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>
2022-04-25 10:46:22 -06:00
Alan Jowett fd94c807a5
Centralize compiler options (#823)
* Centralize all compiler options

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2022-03-29 10:41:09 -06:00
Alan Jowett c6d36834f2
Add mutual auth for RPC client / server. (#804)
* Add mutual auth for RPC client / server.

RPC client and server should authenticate each other, to ensure:

Only admin client makes a call to ebpfsvc.
Client is talking only to ebpfsvc.

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2022-03-14 15:26:55 -06:00
Alan Jowett cdcf793a54
Move generated include to include (#564)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-09-17 17:13:14 -06:00
Alan Jowett 967990f700
Disable /ZI and incremental linking (#546)
* Disable /ZI and incremental linking

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-09-16 16:49:02 -06:00
Alan Jowett f5ba5c5d7c
Use CRT library to map handles to fds (#513)
* Use CRT library to map handles to fds

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-09-14 09:25:56 -06:00
Alan Jowett e553150b1b
Switch from MultiThreadedDebug to MultiThreadedDebugDll (#528)
* Switch from MultiThreadedDebug to MultiThreadedDebugDll
* Pull in latest ebpf-verifier

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-09-14 08:46:01 -06:00
Alan Jowett 74daa0fcec
Set ps unrestricted (#483)
* Set ExecutionPolicy Unrestricted for PS script in build

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-09-02 14:54:03 -06:00
Alan Jowett ac9b6282b8
Add version info to ebpfcore.sys, ebpfapi.dll, netebpfext.sys, and ebpfsvc.exe (#478)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-09-01 17:57:35 -06:00
Shankar Seal 16856deb0a
Pass program handle in GET_PROGRAM_INFO message. (#463)
* fix

* PR feedback.

* Apply suggestions from code review

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

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-08-30 20:15:09 -07:00
Shankar Seal c764977442
utility general helper functions. (#450) 2021-08-28 11:05:57 -07:00
Alan Jowett 4be43a7ea1
Include required Clang version (#431)
* Update Getting Started to recommend current release version of Clang/LLVM

Clang-format behaves differently depending on the version of Clang installed.
Update getting started guide to recommend Clang / LLVM 10.0.0.
Update the development guide to indicate that Clang 10 or higher is required for consistent formatting.
Reformat all code using Clang 10.0.0

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-08-25 09:01:16 -06:00
saxena-anurag 014ee34392
Add eBPF UM APIs (#368)
* parse map names from elf file
* add apis, change test code

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-08-10 17:04:07 -07:00
Shankar Seal 266578ee63
test extension - Part 1 (#336)
* test extension
2021-07-14 14:40:34 -07:00
Dave Thaler 4d0ac1bd4d
Replace "information" with "info" for consistency (#331)
Previously some places had "info" and some had "information".
Both appear in dictionaries, so guidance to avoid abbreviations does not apply.

Fixes #314

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2021-07-07 11:16:35 -07:00
Alan Jowett 7870921e02
Additional analysis fixes (#315)
* Fix C26110,C28023,C28193,C6001,C6031,C6054
* Fix C6101

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

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-06-29 15:51:41 -06:00
Dave Thaler a46b00c2e3
Add VM setup scripts and docs (#281)
* Create an install script rather than having to manually do lots
  of steps
* Make Debug build use vcruntime as static libs to avoid adding
  another prerequisite on a machine before installing eBPF.  This
  isn't required for Release builds as vcruntime release DLLs
  are part of Windows, unlike vcruntime debug DLLs

Fixes #248

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-06-15 08:44:43 -07:00
saxena-anurag 6fde4777e5
Change ebpfsvc to LocalService (#272)
* ebpfsvc should be localservice

* cr comments, change sidtype to restricted

* pr comments
2021-06-14 15:38:42 -07:00
saxena-anurag cf2ef87325
Move program load to ebpfsvc (#245)
* remove duplicate windows_helpers.cpp, refactor

* remove commented code

* move program load to service

* cleanup commented code

* remove commented code

* cr comments

* make device handle init optional

* cr comments

* change return type of some functions

* fix

* cr comments

* cr comments, cover more error conditions in windows_error_to_ebpf_result

* cr comments

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2021-06-07 15:22:04 -06:00
Dave Thaler e9e7133deb
Remove duplicate copy of helper prototypes from verifier (#220)
Fixes #67

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-25 16:22:29 -07:00
Dave Thaler faebbdd32a
Clean up compiler warnings (#225)
The IDL was generating MIDL2279 because it used const on an [out] param,
which is warned against since RPC marshaling copies the result into new
memory.  See https://marc.info/?l=ms-dcom&m=103440617317922 for some
discussion.

Other changes should hopefully be obvious.

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-25 15:36:19 -07:00
saxena-anurag 4b2384479d
refactor api.lib to api.lib, common.lib, service.lib (#219)
* refactor api.lib to api.lib, common.lib, service.lib

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-25 14:11:13 -07:00
saxena-anurag 2518e84e84
Integrate verifier with ebpfsvc (#198)
* call verifier from svc
* ebpfsvc verification support, rpc client
* change rpc api to take const char*, review comments
2021-05-20 18:04:36 -07:00
Dave Thaler 773b27d2c0
Merge error codes from ebpf_windows.h into ebpf_result_t (#210)
Fixes #151

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-20 12:38:58 -07:00
Alan Jowett c47617951a
Split public and internal headers (#154)
* Split public and internal headers

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-10 09:47:54 -06:00
saxena-anurag d724d3b079
Basic ebpfservice with RPC interface (#147)
* fix service based on new directory path
* fix x64 release build break
* add copyright headers
* cr comments
* address review comments
* cr comments, fix formatting
* Update comment
* Update comment

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-10 07:27:37 -07:00