ahci/siis/mvs: Fix panics after 3394d4239b.

Full CCB header overwrites made frees go into wrong zones, causing
kernel panics.  Instead of copying full header use xpt_setup_ccb(),
since the only field I see used from all the header is target_id.

PR:	262263
This commit is contained in:
Alexander Motin 2022-03-04 20:49:05 -05:00
parent d746ab215c
commit 25375b1415
3 changed files with 6 additions and 3 deletions

View File

@ -2178,7 +2178,8 @@ ahci_issue_recovery(struct ahci_channel *ch)
ahci_reset(ch);
return;
}
ccb->ccb_h = ch->hold[i]->ccb_h; /* Reuse old header. */
xpt_setup_ccb(&ccb->ccb_h, ch->hold[i]->ccb_h.path,
ch->hold[i]->ccb_h.pinfo.priority);
if (ccb->ccb_h.func_code == XPT_ATA_IO) {
/* READ LOG */
ccb->ccb_h.recovery_type = RECOVERY_READ_LOG;

View File

@ -1801,7 +1801,8 @@ mvs_issue_recovery(device_t dev)
mvs_reset(dev);
return;
}
ccb->ccb_h = ch->hold[i]->ccb_h; /* Reuse old header. */
xpt_setup_ccb(&ccb->ccb_h, ch->hold[i]->ccb_h.path,
ch->hold[i]->ccb_h.pinfo.priority);
if (ccb->ccb_h.func_code == XPT_ATA_IO) {
/* READ LOG */
ccb->ccb_h.recovery_type = RECOVERY_READ_LOG;

View File

@ -1396,7 +1396,8 @@ siis_issue_recovery(device_t dev)
siis_reset(dev);
return;
}
ccb->ccb_h = ch->hold[i]->ccb_h; /* Reuse old header. */
xpt_setup_ccb(&ccb->ccb_h, ch->hold[i]->ccb_h.path,
ch->hold[i]->ccb_h.pinfo.priority);
if (ccb->ccb_h.func_code == XPT_ATA_IO) {
/* READ LOG */
ccb->ccb_h.recovery_type = RECOVERY_READ_LOG;