]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
cam(4): preserve alloc_flags when copying CCBs
authorEdward Tomasz Napierala <trasz@FreeBSD.org>
Tue, 6 Jul 2021 08:23:25 +0000 (09:23 +0100)
committerEdward Tomasz Napierala <trasz@FreeBSD.org>
Tue, 6 Jul 2021 08:27:22 +0000 (09:27 +0100)
commit13aa56fcd59674cd65afc8e9d6b0c15d32bf9f81
tree403d5bd11bc32b49e6439c9f530c947b062c7b2e
parent382376f39863d553808f96527bc53bf7149780fe
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
sys/cam/cam_periph.c