Copilot commented on code in PR #13213:
URL: https://github.com/apache/trafficserver/pull/13213#discussion_r3366292752


##########
src/proxy/http3/Http3App.cc:
##########
@@ -131,6 +131,10 @@ Http3App::on_stream_open(QUICStream &stream)
 void
 Http3App::on_stream_close(QUICStream &stream)
 {
+  if (auto *txn = this->_ssn->get_transaction(stream.id()); txn != nullptr) {
+    SCOPED_MUTEX_LOCK(lock, txn->mutex, this_ethread());
+    txn->stream_closed();
+  }
   this->_streams.erase(stream.id());

Review Comment:
   `Http3Transaction` stores a reference to `QUICStreamVCAdapter::IOInfo` (from 
`Http3App::_streams`). In `on_stream_close()` the IOInfo is erased 
unconditionally after calling `txn->stream_closed()`. If the transaction cannot 
delete immediately (e.g. `_event_handler_active` is true, or 
`_transaction_done` is still false), the transaction can continue to access 
`_info` after the map erase, causing a use-after-free of the IOInfo and its 
VIO/buffers.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to