-
Notifications
You must be signed in to change notification settings - Fork 806
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
INKVConnInternal::do_io_*: handle null buffer #11789
Merged
bneradt
merged 1 commit into
apache:master
from
bneradt:fix_inkvconninternal_do_io_for_canceled_io
Oct 1, 2024
Merged
INKVConnInternal::do_io_*: handle null buffer #11789
bneradt
merged 1 commit into
apache:master
from
bneradt:fix_inkvconninternal_do_io_for_canceled_io
Oct 1, 2024
Conversation
This file contains 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
It's common for users of VC's to cancel io via a 0 byte, nullptr read or write on the VC. INKVConnInternal::do_io_read and INKVConnInternal::do_io_write were not prepared to handle such cancellations. This updates them to handle this gracefully rather than crashing on a nullptr dereference. This change is was found to be needed for the multiplexer plugin for handling HttpTunnel aborts. For reference, see, for example, UnixNetVConnection::do_io_read which handles a nullptr MIOBuffer. This basically copies that logic into INKVConnInternal so it handles cancellation gracefully.
cmcfarlen
approved these changes
Oct 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, makes sense! Thanks!
bneradt
pushed a commit
to bneradt/trafficserver
that referenced
this pull request
Oct 1, 2024
It's common for users of VC's to cancel io via a 0 byte, nullptr read or write on the VC. INKVConnInternal::do_io_read and INKVConnInternal::do_io_write were not prepared to handle such cancellations. This updates them to handle this gracefully rather than crashing on a nullptr dereference. This change is was found to be needed for the multiplexer plugin for handling HttpTunnel aborts. For reference, see, for example, UnixNetVConnection::do_io_read which handles a nullptr MIOBuffer. This basically copies that logic into INKVConnInternal so it handles cancellation gracefully.
This didn't backport cleanly to 10.0.x, so I created a separate PR for it: |
cmcfarlen
pushed a commit
that referenced
this pull request
Oct 1, 2024
It's common for users of VC's to cancel io via a 0 byte, nullptr read or write on the VC. INKVConnInternal::do_io_read and INKVConnInternal::do_io_write were not prepared to handle such cancellations. This updates them to handle this gracefully rather than crashing on a nullptr dereference. This change is was found to be needed for the multiplexer plugin for handling HttpTunnel aborts. For reference, see, for example, UnixNetVConnection::do_io_read which handles a nullptr MIOBuffer. This basically copies that logic into INKVConnInternal so it handles cancellation gracefully. Co-authored-by: bneradt <bneradt@yahooinc.com>
bneradt
added a commit
to bneradt/trafficserver
that referenced
this pull request
Nov 13, 2024
This is a very similar change as apache#11789. With this patch, TransformTerminus properly supports a 0 byte read to cancel VIO. Without this patch, the logic naively scheduled an event which called the handler which would crash on what was often a canceled continuation or otherwise invalid continuation.
bneradt
added a commit
to bneradt/trafficserver
that referenced
this pull request
Nov 26, 2024
This is a very similar change as apache#11789. With this patch, TransformTerminus properly supports a 0 byte read to cancel VIO. Without this patch, the logic naively scheduled an event which called the handler which would crash on what was often a canceled continuation or otherwise invalid continuation.
bneradt
pushed a commit
to bneradt/trafficserver
that referenced
this pull request
Nov 26, 2024
) It's common for users of VC's to cancel io via a 0 byte, nullptr read or write on the VC. INKVConnInternal::do_io_read and INKVConnInternal::do_io_write were not prepared to handle such cancellations. This updates them to handle this gracefully rather than crashing on a nullptr dereference. This change is was found to be needed for the multiplexer plugin for handling HttpTunnel aborts. For reference, see, for example, UnixNetVConnection::do_io_read which handles a nullptr MIOBuffer. This basically copies that logic into INKVConnInternal so it handles cancellation gracefully. (cherry picked from commit b848a2e)
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.
It's common for users of VC's to cancel io via a 0 byte, nullptr read or write on the VC. INKVConnInternal::do_io_read and
INKVConnInternal::do_io_write were not prepared to handle such cancellations. This updates them to handle this gracefully rather than crashing on a nullptr dereference. This change was found to be needed for the multiplexer plugin for handling HttpTunnel aborts.
For reference, see, for example, UnixNetVConnection::do_io_read which handles a nullptr MIOBuffer. This basically copies that logic into INKVConnInternal so it handles cancellation gracefully.
For Review
Hiding whitespace when viewing the diff makes this patch more understandable.