Skip to content

Added 1rtt fuzzing - #5727

Merged
gaurav2699 merged 17 commits into
mainfrom
user/gaurasingh/1rtt-fuzz
Apr 8, 2026
Merged

Added 1rtt fuzzing#5727
gaurav2699 merged 17 commits into
mainfrom
user/gaurasingh/1rtt-fuzz

Conversation

@gaurav2699

@gaurav2699 gaurav2699 commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

Description

Implemented 1rtt fuzzing in recvfuzz tool

Fixes #5721 .

Purpose

Fuzzing is done to find vulnerabilites

Testing

Locally

Documentation

No

@gaurav2699
gaurav2699 requested a review from a team as a code owner January 19, 2026 19:32
@codecov

codecov Bot commented Jan 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.93%. Comparing base (f2e5689) to head (2ce2954).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5727      +/-   ##
==========================================
- Coverage   86.37%   83.93%   -2.44%     
==========================================
  Files          60       60              
  Lines       18731    18731              
==========================================
- Hits        16178    15721     -457     
- Misses       2553     3010     +457     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@guhetier guhetier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please expend the PR description to explain more specifically what you added / what is not implemented for now.

Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp
Comment thread src/tools/recvfuzz/recvfuzz.cpp
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
@gaurav2699
gaurav2699 requested a review from guhetier February 18, 2026 12:34
guhetier
guhetier previously approved these changes Feb 24, 2026

@guhetier guhetier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nitpicks, but the logic seems largely good to me.

Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
@gaurav2699
gaurav2699 requested a review from guhetier March 23, 2026 12:09
@anrossi

anrossi commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

@copilot Could you help review this? Check the field ordering of the generated frames is consistent with RFC 9000 and RFC 9001, if you have RFC 9000 and 9001 in your training data.

@anrossi

anrossi commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

@copilot Could you help review this? Check the field ordering of the generated frames is consistent with RFC 9000 and RFC 9001, if you have RFC 9000 and 9001 in your training data.

Copilot AI commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

@copilot Could you help review this? Check the field ordering of the generated frames is consistent with RFC 9000 and RFC 9001, if you have RFC 9000 and 9001 in your training data.

Reviewed in 7b1f022: frame field ordering in recvfuzz appears consistent with RFC 9000/9001 for the implemented frame types. Specifically, STREAM (type, stream_id, offset?, length?, data), RESET_STREAM (type, stream_id, app_error_code, final_size), STOP_SENDING (type, stream_id, app_error_code), MAX_DATA (type, maximum_data), MAX_STREAM_DATA (type, stream_id, maximum_stream_data), CRYPTO (via QuicCryptoFrameEncode), ACK (via QuicAckFrameEncode), PING, and HANDSHAKE_DONE are ordered correctly. CONNECTION_CLOSE is encoded as transport close (0x1c) with error_code, frame_type, reason_length, reason_phrase, which matches RFC 9000 for that variant.

Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated

@guhetier guhetier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me once the style is fixed.

Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp Outdated
Comment thread src/tools/recvfuzz/recvfuzz.cpp
@gaurav2699 gaurav2699 closed this Apr 2, 2026
@gaurav2699 gaurav2699 reopened this Apr 2, 2026
@gaurav2699
gaurav2699 merged commit cc81b15 into main Apr 8, 2026
497 checks passed
@gaurav2699
gaurav2699 deleted the user/gaurasingh/1rtt-fuzz branch April 8, 2026 17:53
guhetier added a commit that referenced this pull request Jun 16, 2026
## Description

`QuicCryptoFrameEncode` legitimately returns `FALSE` when the CRYPTO
frame would not fit in the remaining QUIC INITIAL packet payload. On
`release/2.5`, `recvfuzz`'s `WriteCryptoFrame` wraps this call in
`CXPLAT_FRE_ASSERT`, which crashes the process with
`STATUS_ASSERTION_FAILURE` (0xC0000420) before any actual fuzzing
happens.

This is currently firing deterministically on the `recvfuzz (Debug,
windows, WinServerPrerelease, x64, schannel, -Test)` stress job: the
schannel ClientHello on the WinServerPrerelease image is ~1521 bytes
(offers ML-KEM keyshares), which does not fit in the ~1170-byte INITIAL
payload `recvfuzz` budgets for it.

A fuzzer should not assert on the return value of an encode helper
anyway. This change just drops the `CXPLAT_FRE_ASSERT` wrapper, matching
the behavior already present on `main` (commit `cc81b151b`, PR #5727).
The TODO on `main` about properly fragmenting CRYPTO frames across
multiple INITIAL packets still applies and is tracked separately.

Root-cause analysis was done from a process dump captured via diagnostic
PR #6101 (now closed).

## Testing

Existing CI matrix (Stress workflow recvfuzz job) is the test: it
crashes deterministically on `release/2.5` today and should stop
crashing with this change. Verified locally that the Debug x64 schannel
build succeeds.

## Documentation

No documentation impact.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement 1rtt fuzzer

4 participants