Skip to content

9.2.x: INKVConnInternal::do_io_*: handle null buffer#13413

Open
bneradt wants to merge 1 commit into
apache:9.2.xfrom
bneradt:backport-11789-9.2.x
Open

9.2.x: INKVConnInternal::do_io_*: handle null buffer#13413
bneradt wants to merge 1 commit into
apache:9.2.xfrom
bneradt:backport-11789-9.2.x

Conversation

@bneradt

@bneradt bneradt commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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 7afd9e3)

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 7afd9e3)
@bneradt
bneradt requested a review from zwoop as a code owner July 21, 2026 15:50
@bneradt bneradt added this to the 9.2.15 milestone Jul 21, 2026
Copilot AI review requested due to automatic review settings July 21, 2026 15:50
@bneradt bneradt self-assigned this Jul 21, 2026
@bneradt bneradt added Core Crash Backport Marked for backport for an LTS patch release labels Jul 21, 2026
@bneradt bneradt linked an issue Jul 21, 2026 that may be closed by this pull request
@bneradt bneradt changed the title INKVConnInternal::do_io_*: handle null buffer 9.2.x: INKVConnInternal::do_io_*: handle null buffer Jul 21, 2026
@bneradt
bneradt requested a review from ezelkow1 July 21, 2026 15:54
@bneradt
bneradt removed the request for review from zwoop July 21, 2026 15:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the internal SDK VConnection implementation (INKVConnInternal) to safely handle common I/O cancellation patterns where plugins call do_io_read / do_io_write with nbytes == 0 and a null buffer/reader. This aligns behavior more closely with established NetVC handling (e.g., UnixNetVConnection) by avoiding null dereferences during cancellation flows (notably for HttpTunnel abort handling in the multiplexer plugin).

Changes:

  • Guard INKVConnInternal::do_io_read against null MIOBuffer* by clearing the VIO buffer accessor instead of dereferencing.
  • Guard INKVConnInternal::do_io_write against null IOBufferReader* by clearing the VIO buffer accessor instead of dereferencing.
  • Only schedule an immediate event when a non-null buffer/reader is provided (and, for writes, when there is data available).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-project-automation github-project-automation Bot moved this from In progress to Ready to Merge in 9.2.x Branch and Release Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport Marked for backport for an LTS patch release Core Crash

Projects

Status: Ready to Merge

Development

Successfully merging this pull request may close these issues.

ATS crash in MIOBufferAccessor::reader_for

3 participants