Cherry-picks for 10.2.0 RC, round 5 (2026-08-10) - #13526
Merged
Merged
Conversation
) The ovector holds a fixed number of pairs regardless of the pattern, but pcre2_match() writes no further than the highest participating group. Indexing past that read the uninitialized remainder of the internal buffer and built a view from it, so checking PCRE2_UNSET was not by itself enough. Bound the index by the match size instead, and return an empty view built from "" rather than a default-constructed one. Callers pass the result straight to memcpy(), std::string::append() and "%.*s", none of which accept a null pointer. (cherry picked from commit 985642e)
…ure groups (apache#13352) Pattern::replace() rejected any $N whose index was >= the match's return value. That value is one past the highest capture group that *participated*, not the number of groups the pattern defines, so a trailing optional group such as "(\?.*)?" that did not participate made a valid $N look out of range. Every such request logged "invalid reference in replacement string" and silently dropped the prefetch. Validate $N once at config-load time against the pattern's actual capture-group count, and substitute an empty string at match time for a group that did not participate, per PCRE2 semantics. Also treat an unusable --fetch-path-pattern and invalid --fetch-count / --fetch-max / --fetch-overflow values as configuration errors, so the remap rule is refused at load rather than running with prefetch silently disabled. --fetch-count and --fetch-max now parse with std::from_chars(), which rejects a value above UINT_MAX instead of truncating it. Skip an empty expanded path rather than self- prefetching the original, and report that once per remap instance since the condition is request-dependent. Removes the now-dead Pattern::process() and Pattern::capture(). (cherry picked from commit adbd85d)
…pache#13523) HttpSM::state_watch_for_client_abort reached past the transaction to _ua.get_txn()->get_netvc() to half close the client read side on an early EOS. For HTTP/2 and HTTP/3 that NetVConnection is shared by every stream on the connection, so a single aborted stream stopped the session from reading frames for all of the others. Route the shutdown through the transaction instead: Http2Stream and HQTransaction already implement do_io_shutdown() as a deliberate no-op for exactly this reason, and HTTP/1.x is unaffected because ProxyTransaction forwards to the session's NetVConnection. This is the remaining half of apache#12529. That change was written to address two regressions from apache#12502, the second being "HTTP/2 connection is closed if a stream is reset even if other streams are alive", with the stated approach of calling ProxyTransaction::do_io_shutdown() instead of NetVConnection::do_io_shutdown(). It converted the two branches it added but left the pre-existing IO_SHUTDOWN_READ branch calling the NetVConnection directly, so the connection-wide shutdown survived for the case where the tunnel still has a consumer besides the client. A response transform reaches that case readily: the transform stage runs the whole body before anything is written back, so the stream has no write of its own and a client reset arrives as an EOS on the stream's read VIO. Clearing the session's read VIO buffer is not inert, because Http2CommonSession still holds that VIO and re-enables it every 128 frames through HTTP2_SESSION_EVENT_REENABLE. A release build then takes the ntodo() <= 0 path in net_read_io and the connection stalls silently, failing every in-flight stream; a debug build aborts on SSLNetVConnection's `ink_assert(buf.writer())`, the assertion reported in apache#9448. Co-authored-by: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 31eb68f)
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.
Fifth round of cherry-picks for the 10.2.0 release candidate, covering the PRs at "For v10.2.0" in the ATS v10.2.x project.
All picked with
git cherry-pick -xin master merge order; every pick applied cleanly with no conflicts, and each commit's diffstat matches its master commit exactly.RegexMatches::operator[]by what the match populatedMerge order is load-bearing here even though no files overlap. #13352's
replace()relies onmatches[replIndex]returning a non-null view for a capture group inside the match count that did not participate:std::string_view dst = (replIndex < matchCount) ? matches[replIndex] : std::string_view{""}; PrefetchDebug("replacing '$%d' with '%.*s'", replIndex, static_cast<int>(dst.length()), dst.data());The
""there covers only the out-of-range branch. The non-participating-but-in-range case is what #13517 fixes centrally, by returning""instead of a default-constructedstd::string_viewfromRegexMatches::operator[]. #13441 — already on this branch — introduced that null-data()return, so picking #13352 without #13517 first would leave a null pointer reaching"%.*s"andstd::string::append. #13517 merged four minutes before #13352 upstream, so master merge order gives the correct sequence.#13523 completes the other half of #12529:
state_watch_for_client_abortreached past the transaction to the sharedNetVConnectionto half-close the client read side, which for HTTP/2 and HTTP/3 stopped the whole session from reading frames for every other stream. #12529 converted the two branches it touched but left the pre-existingIO_SHUTDOWN_READcall, andHttpSM.ccwas the only site in the tree still doing that.Verified before pushing: every
Disk.*attribute,Test.*helper andCondition.*used by the new tests exists on this branch — includingTest.AddAwaitFileContainsTestRunandCondition.HasProxyVerifierVersion('2.8.0'), which this branch satisfies since it pins Proxy Verifier v3.1.3 — and all eightproxy.config.*records the new tests reference resolve inRecordsConfig.cc. No picked test reaches for a master-only config idiom (ssl_multicert_yamlorstorage_yaml).Local build is clean and
ctestis 167/167.cmake --build ... --target formatmakes no changes.Draft so the full CI matrix runs against the picked set before the release branch moves; it will be landed by fast-forward.