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

593 Коммитов

Автор SHA1 Сообщение Дата
saxena-anurag a956ce1749
Fix ZwUnloadDriver failure issue (#965)
* fix zwunloaddriver failure issue

* build break

* fix failing unit test
2022-04-16 11:39:03 -07:00
Alan Jowett 40f0f1fb65
Fix read past end of buffer in _ebpf_program_test_state::prepare_jit_program (#957)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-15 21:00:03 -06:00
Alan Jowett c1b546c024
Speed up driver phase by compressing artifacts (#958)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-15 19:12:51 -07:00
saxena-anurag 81a855e88f
Enable unit tests for native driver (#953)
* add native tests, bugfixes

* cr comments, fix test failures, fix bad merge

* fix analysis build break

* test failure
2022-04-15 18:26:41 -07:00
Alan Jowett 747b621e56
Document fuzz testing procedures (#949)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-15 17:54:55 -06:00
saxena-anurag 0df35e21ba
Add script to generate bpf2c expected files (#959)
* add script

* remove comment from script

* remove dead code

* change encoding

* change files to UTF8

* change utf8 to ascii

* recompile with LLVM13

* add comment about script usage, regenerate expected files

* fix test failures

* cr comments
2022-04-15 14:44:59 -07:00
Alan Jowett 8447884a91
Update README.md (#954) 2022-04-15 14:13:24 -06:00
Dave Thaler 8a3ff444a3
Remove checkboxes from issue template (#963)
The problem is that every bug report showed up as having "tasks" to be
done as can be seen at
https://github.com/microsoft/ebpf-for-windows/issues where a number of
bugs show "6 tasks". The checkboxes involved are not tasks, and indeed
they weren't providing us any value at present, so removed them.

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2022-04-15 12:57:12 -06:00
Shankar Seal a1a2c6ad92
Sockops 1 (#952)
* remove dependabot from the fork.

* Revert "remove dependabot from the fork."

This reverts commit c542c6cd44.

* add sock_ops program and attach types.

* PR Feedback.
2022-04-14 15:09:54 -07:00
Dave Thaler 1c2cae9e75
Update bpftool (#945)
Signed-off-by: Dave Thaler <dthaler@microsoft.com>

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-04-14 08:31:26 -06:00
Alan Jowett 42312e8d76
Add short haul stress test (#948)
* Add short haul stress test

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

* Don't log success assertions in stress test

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

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-13 18:29:05 -06:00
Alan Jowett a135c327a5
Rename .github/.codecov.yml -> .github/codecov.yml (#947)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2022-04-13 13:13:50 -06:00
Dave Thaler 4cd7d96b99
Fix doxygen output (#940)
Several fields were missing descriptions in the generated docs.
This PR fixes the docs to actually show the relevant descriptions.

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

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-04-13 12:29:41 -06:00
Alan Jowett 51aaa6c25a
Put back permission security-events: write to permit codeql to run (#943)
* Put back permission security-events: write to permit codeql to run

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

* CodeQL build takes > 30 minutes
2022-04-13 11:50:13 -06:00
Alan Jowett 5359c08cf1
Switch bpf2c to use the BTF parser in ebpf-verifier (#941)
* Switch to ebpf-verifier's BTF parser

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

* Unify BTF parsers

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

* Unify BTF parsers

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

* Add tests for bpf2c code gen

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

* Revert changes to ebpf-for-windows.sln

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

* Canonicalize paths in output

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

* PR feedback

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

* Generate ELF with llvm 13.0.0 and PR feedback

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

* Fix copyright header

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

* Fix release build of bpf2c_tests

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

* Update expected output

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2022-04-13 11:17:48 -06:00
Alan Jowett 2021126242
Update codeql-analysis.yml (#937)
* Update codeql-analysis.yml

* Merge codeql and cicd

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

* Merge codeql and cicd

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

* Update cicd.yml
2022-04-12 13:08:11 -06:00
Shankar Seal 745bac282e
Sock addr hook callout test (#922)
* remove dependabot from the fork.

* Revert "remove dependabot from the fork."

This reverts commit c542c6cd44.

* Program info and hook NPI providers for sock_addr.

* PR Feedback.

* PR Feedback 2.

* sock_addr hook tests.

* PR feedback.

* PR Feedback 2.

* fix.
2022-04-12 11:37:44 -07:00
Alan Jowett 11c7721f08
Integrate changes from upstream ubpf (#936)
* Integrate changes from upstream ubpf

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

* Suppress code analysis warning

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

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-11 22:08:29 -06:00
Dave Thaler 1108b0e761
Fix format-code.ps1 when only one file changed (#935)
Based on TechNet discussion at
https://social.technet.microsoft.com/Forums/Lync/en-US/ed6bbd2a-63a9-47d2-b63e-2fc4a2524625/systemcollectionsarraylist-problems-when-populated-with-one-row

Fixes #810

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

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
2022-04-11 20:41:38 -07:00
Alan Jowett 433d82564c
Retry codecov upload with delay on failure (#933)
* Retry codecov upload with delay on failure

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

* Fix powershell script bug

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2022-04-11 20:16:53 -07:00
Dave Thaler 39903d0870
Documentation for all prog types and attach types (#911)
Fixes #860

This PR will conflict with PR #891 which should be merged before this
one and conflicts resolved.

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

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-04-11 20:51:02 -06:00
dependabot[bot] 9f968b125e
Bump github/codeql-action from 2.1.6 to 2.1.8 (#924)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.6 to 2.1.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](28eead2408...1ed1437484)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-04-11 20:23:15 -06:00
Dave Thaler 64d1164e01
Cancel workflows if PR is updated with a new commit (#931)
* Cancel workflows if PR is updated with a new commit

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

* Fix typos

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

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-04-11 19:56:42 -06:00
dependabot[bot] 35bd9c6546
Bump external/Catch2 from `4b78157` to `f25236f` (#934)
Bumps [external/Catch2](https://github.com/catchorg/Catch2) from `4b78157` to `f25236f`.
- [Release notes](https://github.com/catchorg/Catch2/releases)
- [Commits](4b78157981...f25236ff43)

---
updated-dependencies:
- dependency-name: external/Catch2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-11 17:26:37 -06:00
Daniel M. Havey d281e61748
Update Readme.md (#833)
* Update README.md

* Add files via upload

* Update README.md

* Add files via upload

Added svg file to docs.

* Update README.md

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

* Update README.md

Changed FAQ section 3 to reflect that the interpreter is disabled in release mode.

* Update README.md

* Update README.md

* Update README.md

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

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-11 13:57:28 -07:00
Dave Thaler 2f5ac3fbe9
Add some header file names included by typical eBPF programs (#916)
* Add some header file names included by typical eBPF programs

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

* PR feedback

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

* Fix test

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

* Remove unneeded include

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

* Add _MSC_VER checks around pragma warnings in ebpf program headers

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

* Use full path to avoid requiring an include path

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

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-04-11 13:26:49 -07:00
Alan Jowett 11971e854e
Run code coverage baseline daily (#932)
* Only run code coverage related tests on each push

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

* Update cicd.yml

Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
2022-04-11 13:00:29 -07:00
dependabot[bot] 63ed1836c1
Bump codecov/codecov-action from 2.1.0 to 3 (#925)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.1.0 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](f32b3a3741...e3c560433a)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-11 11:36:24 -07:00
Alan Jowett 6e59d8ed18
Bump codecoverage failure threshold to 0.5% (#928)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-11 10:42:23 -07:00
Alan Jowett cfd451c64e
Refactor CI/CD to decrease iteration time (#919)
* Refactor CI/CD to decrease iteration time

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

* PR feedback

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

* Fix driver test

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

* Fix driver 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>

* 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>

* PR feedback

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

* Fix up driver tests

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

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-11 10:05:20 -07:00
dependabot[bot] 9218004626
Bump external/Catch2 from `797c3e7` to `4b78157` (#915)
Bumps [external/Catch2](https://github.com/catchorg/Catch2) from `797c3e7` to `4b78157`.
- [Release notes](https://github.com/catchorg/Catch2/releases)
- [Commits](797c3e7318...4b78157981)

---
updated-dependencies:
- dependency-name: external/Catch2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-08 15:52:25 -07:00
Dave Thaler e22fcdb281
Remove unused ebpf_get_next_map API (#910)
ebpf_get_next_map was obsoleted by standard libbpf apis
(specifically bpf_map_get_next_id and bpf_map_get_fd_by_id)
and isn't called by anything including test code.

This increases our code coverage percentage.

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

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-04-08 14:32:49 -07:00
Dave Thaler 04f6689b68
Make bpf_printk more cross-platform friendly (#909)
* Make bpf_printk more cross-platform friendly

* Add printk_legacy.c with the define that many eBPF programs
  seem to hard code.
* Updated bpf_helper_defs.h to include that exact define so
  a duplicate define will not cause an error, but programs
  that don't define bpf_printk can use it as they do now.

Fixes #903

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

* Add doxygen docs for bpf_trace_printk

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2022-04-08 13:46:10 -06:00
Dave Thaler d00377f074
Make map definition more cross-platform compatible (#904)
Fixes #903

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2022-04-07 18:53:21 -07:00
Shankar Seal a9ab3370d5
`bpf_prog_attach` API and other changes. (#891)
* remove dependabot from the fork.

* Revert "remove dependabot from the fork."

This reverts commit c542c6cd44.

* Program info and hook NPI providers for sock_addr.

* Program info and hook NPI providers for sock_addr.

* PR Feedback.

* PR Feedback 2.

* wfp callout for sock_addr hook.

* PR Feedback.

* fix build break.
2022-04-07 18:18:53 -07:00
Alan Jowett b06f6ac820
Remove Linux + parcon dependency (#906)
* Remove Linux + parcon dependency

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

* Remove Linux + parcon dependency

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

* Set path to compiler

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

* Fix the build

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

* Fix build

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

* PR feedbac

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

* PR feedback

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2022-04-07 17:19:04 -07:00
Alan Jowett 59716dfa16
Fuzz testing of execution context (#896)
* Fuzz testing of execution context

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

* Fix workflow

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

* Fix fuzzing workflow

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

* Fix formatting

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

* Fix tests

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

* PR feedbac

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

* Fix analysis failures

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

* Fixup edit

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

* Fix build

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

* Fix break found during fuzzing

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2022-04-07 10:50:52 -07:00
saxena-anurag 54516ec2c7
Add mock layer to run native module test cases in user mode (#889)
* add mock layer to test native module load

* Apply suggestions from code review

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

* make unit_test dependent on dll projects

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-04-06 17:43:28 -07:00
Alan Jowett aeddcca4bc
Only set codecoverage status after both bpf2c and build complete (#901)
* Only set codecoverage status after both bpf2c and build complete

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

* Only set codecoverage status after both bpf2c and build complete

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2022-04-06 13:49:59 -06:00
Shankar Seal 04582d3f50
Sock addr hook (#871)
* remove dependabot from the fork.

* Revert "remove dependabot from the fork."

This reverts commit c542c6cd44.

* Program info and hook NPI providers for sock_addr.

* fix analysis break.

* PR Feedback.

* PR Feedback 2.
2022-04-05 16:37:34 -07:00
saxena-anurag 68a740223c
bpf2c: emit maps in order they appear in ELF file (#883)
* bugfix

* Update tests/api_test/api_test.cpp

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

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-05 16:16:02 -06:00
Dave Thaler b9d46ae8e4
Use upstream main branch for ebpf-verifier (#894)
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2022-04-05 11:01:36 -07:00
Dave Thaler 8b9f390cdf
Fix grammar in README (#888)
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2022-04-04 18:55:17 -07:00
dependabot[bot] ee0d4e3a89
Bump external/Catch2 from `1a8a793` to `797c3e7` (#877)
Bumps [external/Catch2](https://github.com/catchorg/Catch2) from `1a8a793` to `797c3e7`.
- [Release notes](https://github.com/catchorg/Catch2/releases)
- [Commits](1a8a793178...797c3e7318)

---
updated-dependencies:
- dependency-name: external/Catch2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-02 18:03:53 -07:00
dependabot[bot] d576a19c53
Bump actions/upload-artifact from 2.2.4 to 3 (#878)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.2.4 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.2.4...6673cd052c4cd6fcf4b4e6e60ea986c889389535)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-04-02 16:15:03 -07:00
dependabot[bot] 03e79345d1
Bump github/codeql-action from 1.1.5 to 2.1.6 (#880)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.1.5 to 2.1.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1.1.5...28eead240834b314f7def40f6fcba65d100d99b1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
2022-04-02 14:24:21 -07:00
Alan Jowett fd9ea9cbf7
Update README.md (#876) 2022-04-02 12:17:36 -07:00
Alan Jowett 2f70bb4be8
Upload baseline for bpf2c tests (#874)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>

Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
2022-04-01 21:35:46 -06:00
saxena-anurag 9c0ca81d95
clean up printf statements from service_install_helper (#872)
* clean up printf statements

* fix an older failing test

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2022-04-01 17:14:44 -07:00
Alan Jowett 40e946037c
Only notify after all CI steps are complete (#873)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2022-04-01 17:47:10 -06:00