Repository navigation
fuzz: clear the uber filter's destroy callback on reset - #48794
Merged
RyanTheOptimist merged 1 commit intoNov 2, 2026
Merged
RyanTheOptimist merged 1 commit into
RyanTheOptimist merged 1 commit into
Conversation
UberFilterFuzzer is a static reused across every input, and reset() ran destroy_filters_ without clearing it. An input whose config adds no filter, such as an empty FilterChainConfig, then had its reset() call onDestroy() through the previous input's callback on a filter that reset() had already released, a null dereference. The Fuzz coverage CI job has hit this as a UBSan SEGV on that input on main and on unrelated PRs since late September. The empty filter_chain input is added to the corpus, so the corpus test crashes without the fix whenever any filter-adding input runs before it. Signed-off-by: Derek Argueta <[email protected]>
derekargueta
marked this pull request as ready for review
November 2, 2026 18:55
RyanTheOptimist
approved these changes
Nov 2, 2026
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 12, 2026
…8794) Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
jwendell
pushed a commit
that referenced
this pull request
Nov 12, 2026
Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…8794) Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit ec5e188) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…8794) Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit ec5e188) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…8794) Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit ec5e188) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…8794) Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit ec5e188) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 16, 2026
…8794) Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit ec5e188) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…8794) Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit ec5e188) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…8794) Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit ec5e188) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 17, 2026
…8794) Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit ec5e188) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
that referenced
this pull request
Nov 17, 2026
Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit ec5e188) Signed-off-by: Ryan Northey <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 18, 2026
…8794) Commit Message: fuzz: clear the uber filter's destroy callback on reset `UberFilterFuzzer` is a static that gets reused for every input, and `reset()` ran `destroy_filters_` without clearing it. When an input's config adds no filter, such as an empty `FilterChainConfig` (a valid pass-through), its `reset()` then called `onDestroy()` through the previous input's callback, on a filter pointer `reset()` had already released. That's a null dereference. This clears the callback in `reset()` and adds the empty `filter_chain` input to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it. Additional Description: The Fuzz coverage job has hit this as `UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000` 19 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same empty `FilterChainConfig`. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: the `filter_chain` filter handles an empty config fine. `envoy_cc_fuzz_test` is a dummy main on macOS, so to check this locally I used a throwaway `envoy_cc_test` that runs `buffer1` and then `filter_chain_empty_config` through one `UberFilterFuzzer`. Without the fix it segfaulted 3/3, in the `addStreamDecoderFilter` lambda's `onDestroy()`. With the fix it passed 3/3. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after `buffer1`, in the corpus replay of the regular test jobs and the Fuzz coverage job Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> (cherry picked from commit ec5e188) Signed-off-by: Ryan Northey <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Commit Message: fuzz: clear the uber filter's destroy callback on reset
UberFilterFuzzeris a static that gets reused for every input, andreset()randestroy_filters_without clearing it. When an input's config adds no filter, such as an emptyFilterChainConfig(a valid pass-through), itsreset()then calledonDestroy()through the previous input's callback, on a filter pointerreset()had already released. That's a null dereference.This clears the callback in
reset()and adds the emptyfilter_chaininput to the corpus, so the corpus test catches a regression whenever a filter-adding input runs before it.Additional Description:
The Fuzz coverage job has hit this as
UndefinedBehaviorSanitizer: SEGV on unknown address 0x00000000000019 times since 09-28, on main postsubmit and on unrelated PRs. All 14 crash inputs that libFuzzer printed carry the same emptyFilterChainConfig. It looks flaky because that input wasn't in the seed corpus: the job only replays it when its 60s fuzzing phase happens to generate it, and it only crashes when an earlier input in the same process added a filter. It's a fuzz harness bug: thefilter_chainfilter handles an empty config fine.envoy_cc_fuzz_testis a dummy main on macOS, so to check this locally I used a throwawayenvoy_cc_testthat runsbuffer1and thenfilter_chain_empty_configthrough oneUberFilterFuzzer. Without the fix it segfaulted 3/3, in theaddStreamDecoderFilterlambda'sonDestroy(). With the fix it passed 3/3.AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening.
Risk Level: Low (test only)
Testing: throwaway two-input repro above, 3/3 SEGV before and 3/3 pass after (macOS arm64, fastbuild); the new corpus file runs, after
buffer1, in the corpus replay of the regular test jobs and the Fuzz coverage jobDocs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A