-
Notifications
You must be signed in to change notification settings - Fork 80
Add new Firmware TPM (fwTPM) #474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dgarske
wants to merge
9
commits into
wolfSSL:master
Choose a base branch
from
dgarske:fwtpm
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
578e0d4
Add new Firmware TPM (fwTPM)
dgarske 03fe730
Add fwTPM CMake support. Peer review fixes.
dgarske 918235e
CI build fixes
dgarske a2f52d4
Cleanups from copilot review. Fix m33mu test.
dgarske 5355074
Fixes from Skoll review.
dgarske df956fb
More peer review fixes
dgarske 658dbd4
Fix for m33mu NV
dgarske 8a34a17
Peer review fixes and m33mu improvements
dgarske 991fad6
More peer review fixes
dgarske File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| name: Fuzz Testing | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '0 4 * * 1' # Weekly Monday 4am UTC | ||
| workflow_dispatch: # Manual trigger | ||
| pull_request: | ||
| branches: [ '*' ] | ||
|
|
||
| jobs: | ||
| fuzz: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # Full fuzz run (weekly/manual) - 10 minutes | ||
| - name: fuzz-full | ||
| fuzz_time: 600 | ||
| smoke_only: false | ||
| # Quick smoke test (PR) - 60 seconds | ||
| - name: fuzz-smoke | ||
| fuzz_time: 60 | ||
| smoke_only: true | ||
|
|
||
| steps: | ||
| - name: Checkout wolfTPM | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Checkout wolfSSL | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: wolfssl/wolfssl | ||
| path: wolfssl | ||
|
|
||
| - name: ASLR workaround | ||
| run: sudo sysctl vm.mmap_rnd_bits=28 | ||
|
|
||
| - name: Build wolfSSL with fuzzer support | ||
| working-directory: ./wolfssl | ||
| run: | | ||
| ./autogen.sh | ||
| CC=clang ./configure --enable-wolftpm --enable-pkcallbacks --enable-keygen \ | ||
| CFLAGS="-fsanitize=fuzzer-no-link,address -fno-omit-frame-pointer -g -O1 -DWC_RSA_NO_PADDING" \ | ||
| LDFLAGS="-fsanitize=address" | ||
| make -j$(nproc) | ||
| sudo make install | ||
| sudo ldconfig | ||
|
|
||
| - name: Build fuzz target | ||
| run: | | ||
| ./autogen.sh | ||
| CC=clang ./configure --enable-fwtpm --enable-fuzz \ | ||
| CFLAGS="-fsanitize=fuzzer-no-link,address -fno-omit-frame-pointer -g -O1" \ | ||
| LDFLAGS="-fsanitize=address" | ||
| make -j$(nproc) | ||
|
|
||
| - name: Generate seed corpus | ||
| run: python3 tests/fuzz/gen_corpus.py | ||
|
|
||
| - name: Run fuzzer | ||
| env: | ||
| ASAN_OPTIONS: "detect_leaks=1:abort_on_error=1:symbolize=1" | ||
| run: | | ||
| echo "Fuzzing for ${{ matrix.fuzz_time }} seconds..." | ||
| timeout ${{ matrix.fuzz_time }} \ | ||
| ./tests/fuzz/fwtpm_fuzz \ | ||
| tests/fuzz/corpus/ \ | ||
| -dict=tests/fuzz/tpm2.dict \ | ||
| -max_len=4096 \ | ||
| -timeout=30 \ | ||
| -rss_limit_mb=2048 \ | ||
| -print_final_stats=1 \ | ||
| || FUZZ_RC=$? | ||
| # timeout returns 124 on normal expiry, fuzzer returns 0 on no crash | ||
| if [ "${FUZZ_RC:-0}" -eq 124 ] || [ "${FUZZ_RC:-0}" -eq 0 ]; then | ||
| echo "Fuzzer completed without crashes" | ||
| else | ||
| echo "Fuzzer found crashes (exit code $FUZZ_RC)" | ||
| ls -la crash-* 2>/dev/null || true | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Upload crash artifacts | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: fuzz-crashes-${{ matrix.name }} | ||
| path: | | ||
| crash-* | ||
| oom-* | ||
| timeout-* | ||
| retention-days: 30 | ||
| if-no-files-found: ignore | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.