HomeFreeBSD

cam(4): preserve alloc_flags when copying CCBs

Description

cam(4): preserve alloc_flags when copying CCBs

Before UMA CCBs, all CCBs were of the same size, and could
be trivially copied using bcopy(9). Now we have to preserve
alloc_flags, otherwise we might end up attempting to free
stack-allocated CCB to UMA; we also need to take CCB size
into account.

This fixes kernel panic which would occur when trying to access
a stopped (as in, SCSI START STOP, also "ctladm stop") SCSI device.

Reported By: Gary Jennejohn <gljennjohn@gmail.com>
Tested By: Gary Jennejohn <gljennjohn@gmail.com>
Reviewed By: imp
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31054

Details

Provenance
traszAuthored on Jul 6 2021, 8:23 AM
Reviewer
imp
Differential Revision
D31054: cam(4): preserve alloc_flags when copying CCBs
Parents
rG382376f39863: enetc: Add support for 2.5G fixed-link speed
Branches
Unknown
Tags
Unknown