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

389 Коммитов

Автор SHA1 Сообщение Дата
Dave Thaler c059112b78
Add advice to DevelopmentGuide about not using magic numbers (#244)
Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-06-02 13:50:20 -07:00
Dave Thaler bf7eef76c5
Make netsh "show verification" command display max instruction count (#242)
Fixes #193

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2021-06-02 12:22:06 -06:00
Dave Thaler 50a773d8dc
Fix bugs in netsh helper (#238)
* Pinning a program requires a name to pin to
* The load program API doesn't correctly deal with an empty section name
  (it does use the first section but then tells the execution context
  that the section name is empty instead of the chosen one), so for now
  require the section name in any "add program" command
* Allow netsh to hold references on multiple programs
* Fix handle leak in "show programs"
* Implement ability to pin a program, but unpinning requires
  a way to look up what a program was pinned to, and no such
  API exists currently.
* Implement filtering "show programs" output by filename and section

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

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2021-06-01 09:47:26 -06:00
Alan Jowett b5ee7c7259
Make JIT code pages read-only (#233)
* Add LLVM for code generation proposal

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

* Revert "Add LLVM for code generation proposal"

This reverts commit cd896afd94.

* Free program object on epoch end

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

* Fix log function

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

* Workaround for VS2019 update 16.10.0

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

* Use correct API to map pages to system va

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

* PR feedback & verifier bug fixes

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>
2021-05-28 16:59:08 -06:00
saxena-anurag 3a8e5dd7cd
remove duplicate windows_helpers.cpp, refactor (#236)
* remove duplicate windows_helpers.cpp, refactor

* remove commented code

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-28 15:29:41 -07:00
Alan Jowett 466e925e91
Add support for running work-item on epoch end (#231)
* Add LLVM for code generation proposal

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

* Revert "Add LLVM for code generation proposal"

This reverts commit cd896afd94.

* Add support for running work-item on epoch end

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

* PR feedback

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-27 15:41:26 -06:00
Dave Thaler f79e91422e
Fix doxygen error when there are no changes to commit (#232)
Previously the script worked when there were changes and
generates an error when there's actually nothing to do
because "git commit" returns exit code 1 when there's nothing to do.

This updates the github workflow to only commit when there's something
to commit.  For more discussion see
https://stackoverflow.com/questions/5139290/how-to-check-if-theres-nothing-to-be-committed-in-the-current-branch

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-27 14:28:28 -07:00
Alan Jowett 4c64214af7
Change resolve_maps_in_byte_code to send handles for resolution only when needed. (#230)
* Add LLVM for code generation proposal

* Revert "Add LLVM for code generation proposal"

This reverts commit cd896afd94.

* Eliminate duplicate map resolutions

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-27 13:56:06 -07:00
Alan Jowett 4b53d101aa
Add support for allocating pages for code that can be marked read/execute (#228)
* Add LLVM for code generation proposal

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

* Revert "Add LLVM for code generation proposal"

This reverts commit cd896afd94.

* Work in progress

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

* Add doxygen

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>

* PR feedback

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-26 14:37:04 -06:00
Dave Thaler 2bd9033b95
Fix doxygen errors (#229)
"git commit -am" only adds changes to existing files, not new files
and so was missing adding docs when new headers were added, resulting
in a failure.

Also some params were missing from doxygen which resulted in
a bunch of warnings.

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-26 12:01:58 -07:00
Dave Thaler d37e65801a
Fix netsh display of program type (#226)
Since the program type changed from int to GUID the display has been
broken (it displays a useless pointer value).  This fix makes it display
the string name of the type.

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-25 22:05:03 -07: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
Dave Thaler 85277df9d6
Add guidance to make sure all code is actually built (#221)
Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-25 11:29:24 -06:00
Alan Jowett 2a928a6c71
Document testing in Ebpf-For-Windows (#216)
* Add LLVM for code generation proposal

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

* Revert "Add LLVM for code generation proposal"

This reverts commit cd896afd94.

* Add description of tests in Ebpf-For-Windows

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

* Update docs/GettingStarted.md

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

* Update docs/GettingStarted.md

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

* Update docs/GettingStarted.md

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

* Update docs/GettingStarted.md

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

* Update docs/GettingStarted.md

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

* Update docs/GettingStarted.md

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

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-21 13:55:48 -06:00
Dave Thaler d9ee25f035
Add info on slack channel and zoom meeting (#209)
Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2021-05-21 11:32:50 -07:00
Dave Thaler a3f5150f91
Update CODEOWNERS list (#213)
So pull request notifications go to more people

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

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2021-05-21 10:16:59 -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
Dave Thaler 34de16f43b
Add guidance about order of header includes (#207)
Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-19 14:52:38 -06:00
Dave Thaler a33045073c
Improve clarify of eBPF extensions doc (#199)
Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-18 12:53:56 -07:00
Dave Thaler 1e8ed8af2c
Improve clarity of filesystem proposal doc (#200)
Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-18 12:37:16 -07:00
Alan Jowett d765bd616d
Increase stack size for eBPF programs to 512 bytes (#197)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-14 10:17:26 -06:00
Alan Jowett 704e70c6a6
Add proposal for FS filter hook (#196)
* Add proposal for FS filter hook
* Document ebpf ext model

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-13 13:36:24 -06:00
Alan Jowett d95e3d22eb
Document why we disable bounds check when using uBPF (#195)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-13 08:56:36 -07:00
Alan Jowett 19bbe366e8
Add prerequisite code for applying access check to pinning operations (#185)
* Add prerequisite code for applying access check to pinning operations

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-12 19:57:28 -06:00
Alan Jowett c59b072cd3
Add missing helperfunctions (#183)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-12 14:25:48 -07:00
Dave Thaler 656e7becc1
Add doxygen automation (#180)
Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-12 08:23:02 -06:00
theidexisted 2b2ea62dee
Minor fix, save a constructor (#165)
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-12 04:54:00 -07:00
Alan Jowett 38dae7294d
Switch to using https://github.com/iovisor/ubpf as the upstream branch for ubpf (#178)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-11 20:48:32 -07:00
Alan Jowett 1aedf620fc
Modify EBPF_OPERATION_GET_PROGRAM_INFORMATION to accept ebpf_program_type_t (#175)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-11 18:25:11 -07:00
Shankar Seal 445ba0faad
Update CONTRIBUTING.md (#176)
fix link
2021-05-11 17:51:22 -07:00
Alan Jowett 25f6253fb1
Eliminate need for _unwind_helper (#174)
* Eliminate need for _unwind_helper

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

* Fix build break

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

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-11 17:16:30 -06:00
Dave Thaler be2c2c31f0
Added html documentation folder to .gitignore (#172)
Step 1 of making doxygen generate html docs as part of issue #71

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-11 14:47:19 -07:00
Alan Jowett 1af5e65f65
Switch ebpf_program_type_descriptor_t::platform_specific_data to GUID (#171)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-11 14:46:00 -06:00
Alan Jowett bf6cb270ac
Update driver to return ebpf_program_data_t to verifier (#163)
* Update driver to return ebpf_program_data_t to verifier

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

* Fix typo in comment

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-11 09:53:12 -07:00
Dave Thaler fba10c87b3
Update verifier to get latest disassembly format (#164)
Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-11 09:25:47 -07:00
smiley 5bcb662939
Update README.md (#168)
Added missing close parenthesis.
2021-05-11 08:59:53 -07:00
Quentin Monnet 728699217f
Fix link to "eBPF assembly with LLVM" post in tutorial (#167)
The current link points to the binary for LLVM-7, instead of the blog
post mentioned. Let's fix the URL.
2021-05-11 07:30:42 -07:00
Alan Jowett 962ef5e03d
Split tests (#158)
* Create unit test for execution context
* Split out platform unit tests
* Call UT as part of CI/CD pipeline

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-10 15:14:49 -06:00
Dave Thaler a022da91cb
Fix README.md (#157)
HVCI requires the guest OS to enforce it so doesn't apply to Linux

Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-10 10:03:14 -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
Alan Jowett d9c8dc45a1
First draft of code to serialize EBPF program info (#152)
* First draft of code to serialize EBPF program info
* Add code to encode program information from extension

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-10 07:07:43 -07:00
Dave Thaler 7a34bb0c86
Make verifier and netsh use GUIDs instead of int program types (#150)
Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-08 10:45:50 -06:00
Alan Jowett e0dd3ce0e3
Set working directory so that end_to_end.exe finds the eBPF files (#149)
* Set working director so that end_to_end.exe finds the eBPF files

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

* PR feedback

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

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-07 17:24:36 -07:00
Dave Thaler 0f7a6b0c12
Update to latest verifier version (#148)
Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-07 17:02:54 -07:00
Alan Jowett 51b710b1f1
Simplify the bindmonitor.c eBPF program (#146)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-07 14:08:40 -06:00
Dave Thaler 7e36b792e2
More wording tweaks to README (#145)
Signed-off-by: Dave Thaler <dthaler@ntdev.microsoft.com>
2021-05-06 14:30:56 -07:00