Skip to content

Commit

Permalink
Remove the obsolete fuzz.exe (microsoft#1920)
Browse files Browse the repository at this point in the history
* Remove the obsolete fuzz.exe

The functionality was replaced by execution_context_fuzzer.exe.

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

* Fix cmake build

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

* Update fuzzing docs

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

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
  • Loading branch information
dthaler authored Jan 20, 2023
1 parent c46c354 commit fb7d886
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 493 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,6 @@ jobs:
build_artifact: Build-x64-Sanitize
build_options: /p:AddressSanitizer='True'

# Run the fuzzing tests in GitHub.
fuzzing:
needs: sanitize
# Always run this job.
if: github.event_name == 'schedule' || github.event_name == 'pull_request'
uses: ./.github/workflows/reusable-test.yml
with:
name: fuzzing
test_command: .\fuzz.exe -d yes
build_artifact: Build-x64-Sanitize
environment: windows-2022
code_coverage: false
gather_dumps: true

bpf2c_fuzzer:
needs: libfuzzer
if: github.event_name == 'pull_request'
Expand Down
30 changes: 4 additions & 26 deletions docs/Fuzzing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,9 @@ Fuzz testing is a test methodology that finds a class of bugs in the code-base
by generating random inputs and verifying that the code doesn't crash.

## Tests
The fuzzing tests are in the repo under tests/fuzz. Fuzz tests execute as part
of each CI/CD workflow. The tests generate a random block of bytes with a
length in the range from minimum input size for that method to minimum input
size + 1024. Many eBPF-For-Windows protocol messages contain a handle as their
first element, so the tests create several valid handles and insert them at
the beginning of the message.

## Reproducing a failure from CI/CD
At the start of each fuzzing run, the tests generate a random number seed and
prints it out to the console. The random seed appears similar to the following:
```
[Begin random seed]
6bcd4d9f e4be3204 66f59b19 fc13dfd0 49aee1d3 a9fec550 1a6aea17 b0bf0eb6
398939cd 565ea6ec 15e3c09d 1844f118 fcdf6860 1e892676 f8fa75af 84e23b43
..
02fc4779 15c10832 2c6a717c 79404590 7634d1fe f0ddd687 81d67357 091d3f2b
c447caca c0626a08 4c6c8656 0c88d48c e20e975b 5e7ff362 bd982986 6e50d38f
[End random seed]
```

To reproduce a failure observed in fuzzing, copy this random seed into a text
file (```random_seed.txt``` as an example) and then set the environment variable
```RANDOM_SEED``` to the path of the file containing the random seed. The tests
will then use the provided seed instead of generating a new one, which results
in the tests repeating the sequence of steps that resulted in the crash.
The fuzzing tests are in the repo under tests/libfuzzer. Fuzz tests execute as part
of each CI/CD workflow. The tests generate a random block of bytes that a fuzzer
uses as a test vector to determine what API to fuzz and what arguments to pass to it.

## Reproducing a failure from artifacts
When a crash happens, a folder containing the unique crash will be created. Click on *Summary* in the build section. The following example shows the process of debugging for *verifier_fuzzer* which can then be used for other CI/CD steps as well.
Expand All @@ -47,4 +25,4 @@ An alternative of running an admin CMD is to reproduce a crash to use the local
```
verifier_fuzzer.exe <crash-file-name>
```
This method will show the line of crash in the source file.
This method will show the line of crash in the source file.
18 changes: 0 additions & 18 deletions ebpf-for-windows.sln
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Catch2WithMain", "external\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Catch2", "external\Catch2\build\src\Catch2.vcxproj", "{8D538CBE-01BF-4A2E-A98A-6C368FDF13D7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fuzz", "tests\fuzz\fuzz.vcxproj", "{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "socket_tests", "tests\socket\socket_tests.vcxproj", "{EED9DAC6-8B98-4C33-969A-E8CEDE8E985E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bpftool_tests", "tests\bpftool_tests\bpftool_tests.vcxproj", "{8B5B061B-3170-4D1B-8C5B-E86B890C14B8}"
Expand Down Expand Up @@ -774,21 +772,6 @@ Global
{8D538CBE-01BF-4A2E-A98A-6C368FDF13D7}.RelWithDebInfo|ARM64.ActiveCfg = RelWithDebInfo|x64
{8D538CBE-01BF-4A2E-A98A-6C368FDF13D7}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
{8D538CBE-01BF-4A2E-A98A-6C368FDF13D7}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.Debug|ARM64.ActiveCfg = Debug|Win32
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.Debug|x64.ActiveCfg = Debug|x64
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.Debug|x64.Build.0 = Debug|x64
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.MinSizeRel|ARM64.ActiveCfg = Debug|Win32
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.MinSizeRel|ARM64.Build.0 = Debug|Win32
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.MinSizeRel|x64.ActiveCfg = Debug|x64
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.MinSizeRel|x64.Build.0 = Debug|x64
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.Release|ARM64.ActiveCfg = Release|x64
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.Release|ARM64.Build.0 = Release|x64
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.Release|x64.ActiveCfg = Release|x64
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.Release|x64.Build.0 = Release|x64
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.RelWithDebInfo|ARM64.ActiveCfg = Debug|Win32
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.RelWithDebInfo|ARM64.Build.0 = Debug|Win32
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31}.RelWithDebInfo|x64.Build.0 = Release|x64
{EED9DAC6-8B98-4C33-969A-E8CEDE8E985E}.Debug|ARM64.ActiveCfg = Debug|Win32
{EED9DAC6-8B98-4C33-969A-E8CEDE8E985E}.Debug|x64.ActiveCfg = Debug|x64
{EED9DAC6-8B98-4C33-969A-E8CEDE8E985E}.Debug|x64.Build.0 = Debug|x64
Expand Down Expand Up @@ -1066,7 +1049,6 @@ Global
{61DF9973-81B9-4006-9148-52F58259BBCF} = {492C9B22-9237-4996-9E33-CA14D3533616}
{8BD3552A-2CFB-4A59-AB15-2031B97ADA1E} = {492C9B22-9237-4996-9E33-CA14D3533616}
{8D538CBE-01BF-4A2E-A98A-6C368FDF13D7} = {492C9B22-9237-4996-9E33-CA14D3533616}
{D88F9CE2-8DA2-44FB-AF7C-06466A180F31} = {492C9B22-9237-4996-9E33-CA14D3533616}
{EED9DAC6-8B98-4C33-969A-E8CEDE8E985E} = {492C9B22-9237-4996-9E33-CA14D3533616}
{8B5B061B-3170-4D1B-8C5B-E86B890C14B8} = {492C9B22-9237-4996-9E33-CA14D3533616}
{8DD6577A-CBBE-43FE-9FC3-E42CB013CC60} = {492C9B22-9237-4996-9E33-CA14D3533616}
Expand Down
1 change: 0 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ add_subdirectory("bpf2c_plugin")
add_subdirectory("bpf2c_tests")
add_subdirectory("bpftool_tests")
add_subdirectory("cilium")
add_subdirectory("fuzz")
add_subdirectory("libs")
add_subdirectory("performance")
add_subdirectory("sample")
Expand Down
66 changes: 0 additions & 66 deletions tests/fuzz/CMakeLists.txt

This file was deleted.

184 changes: 0 additions & 184 deletions tests/fuzz/execution_context.cpp

This file was deleted.

Loading

0 comments on commit fb7d886

Please sign in to comment.