HomeFreeBSD

iscsi: Always free a cdw before its associated ctl_io.

Description

iscsi: Always free a cdw before its associated ctl_io.

cxgbei stores state about a target transfer in the ctl_private[] array
of a ctl_io that is freed when a target transfer (represented by the
cdw) is freed. As such, freeing a ctl_io before a cdw that references
it can result in a use after free in cxgbei. Two of the four places
freed the cdw first, and the other two freed the ctl_io first. Fix
the latter two places to free the cdw first.

Reported by: Jithesh Arakkan @ Chelsio
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D30270

Details

Provenance
jhbAuthored on May 20 2021, 4:58 PM
Reviewer
mav
Differential Revision
D30270: iscsi: Always free a cdw before its associated ctl_io.
Parents
rGf17a5900850b: ufs: Avoid M_WAITOK allocations when building a dirhash
Branches
Unknown
Tags
Unknown