Page MenuHomeFreeBSD

cam(4): preserve alloc_flags when copying CCBs
ClosedPublic

Authored by trasz on Jul 5 2021, 1:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 6, 6:03 AM
Unknown Object (File)
Sun, Sep 6, 4:02 AM
Unknown Object (File)
Fri, Sep 4, 10:48 AM
Unknown Object (File)
Fri, Sep 4, 9:20 AM
Unknown Object (File)
Thu, Sep 3, 8:32 PM
Unknown Object (File)
Wed, Sep 2, 9:42 AM
Unknown Object (File)
Wed, Sep 2, 9:01 AM
Unknown Object (File)
Tue, Sep 1, 9:47 PM
Subscribers

Details

Summary

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>
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable