Skip to content

Commit 4ac9d39

Browse files
authored
Windows kernel fuzzing docs (#70)
1 parent 6695934 commit 4ac9d39

File tree

134 files changed

+2200
-241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+2200
-241
lines changed

.github/linters/.markdown-lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ MD029: false # Ordered list item prefix
3232
MD033: false # Allow inline HTML
3333
MD036: false # Emphasis used instead of a heading
3434
MD041: false # HTML can be at the top of the file for the image and such
35+
MD045: false # Do not require alt text
3536

3637
#################
3738
# Rules by tags #

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ jobs:
8383
- name: Generate SIMICS Documentation
8484
run: |
8585
ispm projects "$(pwd)" --create --ignore-existing-files --non-interactive
86-
./documentation -o docs/book/simics --dont-open --project "$(pwd)"
86+
./documentation -o docs/book/html/simics --dont-open --project "$(pwd)"
8787
8888
- name: Generate Crate Documentation
8989
run: |
9090
SIMICS_BASE="${HOME}/simics/simics-${{ env.PUBLIC_SIMICS_PACKAGE_VERSION_1000 }}" RUSTDOCFLAGS="--enable-index-page -Zunstable-options" TSFFS_TESTS_SKIP_BUILD=1 cargo doc --document-private-items --workspace --no-deps
91-
cp -a target/doc/ docs/book/crates/
91+
cp -a target/doc/ docs/book/html/crates/
9292
9393
- name: Set Documentation Permissions
9494
run: |
@@ -104,7 +104,7 @@ jobs:
104104
- name: Upload artifact
105105
uses: actions/upload-pages-artifact@v2
106106
with:
107-
path: "./docs/book/"
107+
path: "./docs/book/html/"
108108

109109
- name: Deploy to GitHub Pages
110110
id: deployment

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ version = "0.2.1"
2222
[package.metadata.simics]
2323
package-number = 31337
2424

25-
version = "6.0.6"
25+
version = "7.0.1"
2626

2727
[lib]
2828
crate-type = ["cdylib", "rlib"]

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<p align="center"><img src="docs/images/logo.png" alt="TSFFS Logo"></p>
2-
31
# TSFFS: Target Software Fuzzer For SIMICS
42

53
TSFFS is a snapshotting, coverage-guided fuzzer built on the
@@ -67,9 +65,10 @@ TSFFS is focused on several primary use cases:
6765

6866
However, TSFFS is also capable of fuzzing:
6967

70-
- Kernel & kernel drivers
71-
- User-space applications
68+
- Kernel & kernel drivers on Windows Linux, and more
69+
- User-space applications on Windows, Linux, and more
7270
- Network applications
71+
- Hypervisors and bare-metal systems
7372

7473
## Contact
7574

docs/book.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ language = "en"
77
multilingual = false
88
src = "src"
99
title = "TSFFS: Target Software Fuzzer for SIMICS"
10+
11+
[output.html]
12+
13+
[output.linkcheck]

docs/src/SUMMARY.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,27 @@
4949
- [Configuring the Fuzzer](tutorials/edk2-simics-platform-bios/configuring.md)
5050
- [Running the Fuzzer](tutorials/edk2-simics-platform-bios/running.md)
5151
- [Optimizing the Fuzzer](tutorials/edk2-simics-platform-bios/optimizing.md)
52+
- [Fuzzing a Windows Kernel Mode Driver (KMD)](tutorials/windows-kernel/README.md)
53+
- [Building a Windows Image](tutorials/windows-kernel/building-windows-image/README.md)
54+
1. [Install VirtualBox](tutorials/windows-kernel/building-windows-image/install-virtualbox.md)
55+
2. [Download Windows](tutorials/windows-kernel/building-windows-image/download-windows.md)
56+
3. [Create a VM](tutorials/windows-kernel/building-windows-image/create-a-vm.md)
57+
4. [Install Windows](tutorials/windows-kernel/building-windows-image/install-windows.md)
58+
5. [Set Up SSH](tutorials/windows-kernel/building-windows-image/set-up-ssh.md)
59+
6. [Enable SSH Port Forwarding in VirtualBox](tutorials/windows-kernel/building-windows-image/enable-ssh-port-forwarding-in-virtualbox.md)
60+
7. [Change Default Shell to PowerShell](tutorials/windows-kernel/building-windows-image/change-default-shell-to-powershell.md)
61+
8. [Installing the EWDK](tutorials/windows-kernel/building-windows-image/installing-the-ewdk.md)
62+
9. [Installing Development Tools](tutorials/windows-kernel/building-windows-image/installing-development-tools.md)
63+
10. [Install Simics Agent](tutorials/windows-kernel/building-windows-image/install-simics-agent.md)
64+
11. [Clone and Build HEVD](tutorials/windows-kernel/building-windows-image/clone-and-build-hevd.md)
65+
12. [Install the Code Signing Certificate](tutorials/windows-kernel/building-windows-image/install-the-code-signing-certificate.md)
66+
13. [Install HEVD Driver](tutorials/windows-kernel/building-windows-image/install-hevd-driver.md)
67+
14. [Create a Fuzz Harness](tutorials/windows-kernel/building-windows-image/create-a-fuzz-harness.md)
68+
15. [Compile the Fuzz Harness](tutorials/windows-kernel/building-windows-image/compile-the-fuzz-harness.md)
69+
16. [Convert the Image to CRAFF](tutorials/windows-kernel/building-windows-image/convert-image.md)
70+
- [Create a Simics Project](tutorials/windows-kernel/create-a-project.md)
71+
- [Run and Set Up the Simulation](tutorials/windows-kernel/run-the-simulation.md)
72+
- [Run the Fuzzer](tutorials/windows-kernel/run-the-fuzzer.md)
5273

5374
## Reference Guide
5475

docs/src/config/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
# Configuration
22

33
Before TSFFS can fuzz target software, it must be configured. The configuration API is
4-
kept as simple as possible, with sane defaults.
4+
kept as simple as possible, with sane defaults. TSFFS exposes all of its configuration
5+
options as Simics *attributes* which means that you can list its configuration options
6+
by running the following in a Simics CLI prompt in a project with TSFFS installed (see
7+
[Installing in Projects](installing-in-projects.md)).
8+
9+
```simics
10+
load-module tsffs
11+
list-attributes tsffs
12+
```
13+
14+
You'll see a list of attributes, each of which has help documentation available through
15+
the Simics CLI like:
16+
17+
```simics
18+
help tsffs.exceptions
19+
```
20+
21+
To read about all of the TSFFS options in detail, including methods for setup,
22+
installation, and configuration:
523

624
- [Installing In Projects](installing-in-projects.md)
725
- [Loading The TSFFS Module](loading-module.md)

docs/src/config/common-options.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ is desired.
99
- [Setting Exception Solutions](#setting-exception-solutions)
1010
- [Setting Breakpoint Solutions](#setting-breakpoint-solutions)
1111
- [Fuzzer Settings](#fuzzer-settings)
12-
- [Using Snapshots](#using-snapshots)
1312
- [Using CMPLog](#using-cmplog)
1413
- [Set Corpus and Solutions Directory](#set-corpus-and-solutions-directory)
1514
- [Enable and Set the Checkpoint Path](#enable-and-set-the-checkpoint-path)
@@ -122,23 +121,6 @@ heap.
122121

123122
## Fuzzer Settings
124123

125-
### Using Snapshots
126-
127-
SIMICS 6.0.175 introduced an experimental snapshots feature that is not dependent on
128-
reverse execution micro-checkpoints. In some cases, this snapshot method is faster and
129-
in some cases resolves issues with model incompatibility with micro-checkpoints. This
130-
feature is not enabled by default.
131-
132-
To use reverse-execution micro-checkpoints instead, use:
133-
134-
```python
135-
@tsffs.use_snapshots = False
136-
```
137-
138-
Micro-checkpoints cannot be used by when compiling the module against versions of SIMICS
139-
which do not support them, and a runtime panic will occur when attempting to take a
140-
snapshot if enabled on an older version of SIMICS.
141-
142124
### Using CMPLog
143125

144126
Comparison logging greatly improves the efficiency of the fuzzer by making each

docs/src/config/installing-in-projects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ when creating projects.
1414

1515
Projects are created using `ispm` (Intel Simics Package Manager). The command below
1616
would create a project with packages numbered 1000 (SIMICS Base), 2096 (Quick Start
17-
Platform [QSP] x86), 8112 (QSP CPU), and 31337 (TSFFS), each with the latest version
17+
Platform, or QSP, x86), 8112 (QSP CPU), and 31337 (TSFFS), each with the latest version
1818
except SIMICS base, which here is specified as 6.0.169. All that is required to create
1919
a new project with the TSFFS package included is to add it after the `--create` flag
2020
to `ispm`. Using the `-latest` version is recommended for simplicity, but if you are a

docs/src/fuzzing/compatibility.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Supported Architectures:
3232
If your model's target architecture is one of these, it is supported by TSFFS. If not,
3333
file an issue or pull request. Adding new architectures is easy, and can be a good
3434
first contribution to the fuzzer. See the generic and specific architecture information
35-
[here](../../../modules/tsffs/src/tsffs/src/arch).
35+
[here](https://github.com/intel/tsffs/tree/main/src/arch).
3636

3737
## Micro Checkpoints
3838

@@ -51,8 +51,10 @@ model with a simple test.
5151
### Testing Micro Checkpoints
5252

5353
As an example, let's consider the x86 QSP platform model that ships with SIMICS and the
54-
Hello World EFI [example](../../../examples/tests/x86_64-uefi/). The process for fuzzing
55-
this target software follows the basic flow:
54+
Hello World EFI [resource
55+
example](https://github.com/intel/tsffs/tree/main/tests/rsrc/x86_64-uefi) which you can
56+
build by running `./build.sh` in the resource directory. The process for fuzzing this
57+
target software follows the basic flow:
5658

5759
1. Boot the x86 QSP BIOS with the QSP x86 hdd boot script, with a minimal boot disk
5860
2. Upload the test.efi EFI app using the SIMICS agent (for most real targets, we
@@ -210,7 +212,7 @@ running>
210212
You'll see several automatic actions on the SIMICS GUI, and you will end up with the
211213
console screen below.
212214

213-
![The EFI console, with the prompt FS0: \\>](../../images/REQUIREMENTS_Test_Micro_Checkpoints_Pre.png)
215+
![The EFI console, with the prompt FS0: \\>](../images/REQUIREMENTS_Test_Micro_Checkpoints_Pre.png)
214216

215217
First, we'll run our EFI app to make sure all is well.
216218

@@ -220,7 +222,7 @@ running> $system.console.con.input "test.efi\n"
220222

221223
You should see "Working..." print out on the console.
222224

223-
![The EFI console, after test run](../../images/REQUIREMENTS_Test_Micro_Checkpoints_TestRun.png)
225+
![The EFI console, after test run](../images/REQUIREMENTS_Test_Micro_Checkpoints_TestRun.png)
224226

225227
Now, we'll go ahead stop the simulation and take our micro checkpoint.
226228

@@ -242,7 +244,7 @@ running> stop
242244
We stopped our execution after the app executed, so you should see the output from the
243245
second time we ran it ("Working...") printed on the GUI console.
244246

245-
![The EFI console, after running again](../../images/REQUIREMENTS_Test_Micro_Checkpoints_Post.png)
247+
![The EFI console, after running again](../images/REQUIREMENTS_Test_Micro_Checkpoints_Post.png)
246248

247249
Now, we will restore our micro checkpoint and clear the recorder. The second step is
248250
important, because if we did not clear the recorder we would *replay* the execution of
@@ -259,7 +261,7 @@ simics> continue
259261
The console should be back to the state it was before you ran the second app execution,
260262
and will look like this:
261263

262-
![The EFI console, after test run](../../images/REQUIREMENTS_Test_Micro_Checkpoints_TestRun.png)
264+
![The EFI console, after test run](../images/REQUIREMENTS_Test_Micro_Checkpoints_TestRun.png)
263265

264266
#### Testing for Your App
265267

@@ -279,12 +281,12 @@ somewhat depending on your project. In general, try to follow this flow:
279281

280282
## Snapshots
281283

282-
Newer versions of SIMICS (>= 6.0.175) support a new feature called snapshots, which are
284+
Newer versions of SIMICS (>= 7.0.0) support a new feature called snapshots, which are
283285
similar to micro checkpoints but do not rely on underlying rev-exec support. If your
284286
model supports a new version of SIMICS, follow the same instructions as for micro
285287
checkpoints, but replace:
286288

287-
* `VT_save_micro_checkpoint("origin", 0)` with `VT_take_snapshot("origin")`
289+
* `VT_save_micro_checkpoint("origin", 0)` with `VT_save_snapshot("origin")`
288290
* `VT_restore_micro_checkpoint(0)` with `VT_restore_snapshot("origin")`
289291

290292
And do not call `CORE_discard_future`.

0 commit comments

Comments
 (0)