Page MenuHomeFreeBSD

nvmft: Cancel and drain any existing terminate task when enabling a controller
Needs ReviewPublic

Authored by jhb on Thu, Oct 8, 3:51 PM.
Tags
None
Referenced Files
F175269245: D60472.id189063.diff
Fri, Oct 9, 2:49 PM
F175219815: D60472.diff
Fri, Oct 9, 5:09 AM
F175181197: D60472.diff
Thu, Oct 8, 10:19 PM
F175173493: D60472.id189063.diff
Thu, Oct 8, 8:58 PM
F175160249: D60472.diff
Thu, Oct 8, 6:28 PM
Subscribers

Details

Reviewers
markj
Summary

If a remote host initiates a shutdown or controller reset by setting
the CC property but leaves the admin queue connected at the transport
level, a timeout task is scheduled to drop the association after 2
minutes.

Previously, if the remote host re-enabled the controller after the
shutdown or reset had completed by setting CC.EN=1, the timeout task
was left queued. If the association remained active when the task
ran, the task handler recognized this case and exited without doing
anything. However, if the admin queue disconnected at the transport
level (e.g. closed the TCP socket), the memory backing the queue was
freed while the task was still queued leading to a use-after-free when
the task eventualy ran.

To fix, explicitly cancel and drain the terminate task when enabling a
controller before sending the response back acknowledging the request
to alter CC.

Reported by: Myeonghun Pak <mhun512@gmail.com>
Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77856
Build 74739: arc lint + arc unit