cam: add missing zeroing of a stack-allocated CCB.

This could cause a panic at boot.

Reported By:	Shawn Webb <shawn.webb AT hardenedbsd.org>
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
This commit is contained in:
Edward Tomasz Napierala 2021-05-16 10:28:04 +01:00
parent 5365af662c
commit 0f206cc912
2 changed files with 2 additions and 0 deletions

View File

@ -2187,6 +2187,7 @@ ata_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb)
struct ccb_trans_settings cts;
u_int speed, mb;
bzero(&cts, sizeof(cts));
_ata_announce_periph(periph, &cts, &speed);
if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
return;

View File

@ -3154,6 +3154,7 @@ scsi_announce_periph(struct cam_periph *periph)
struct ccb_trans_settings cts;
u_int speed, freq, mb;
memset(&cts, 0, sizeof(cts));
_scsi_announce_periph(periph, &speed, &freq, &cts);
if (cam_ccb_status((union ccb *)&cts) != CAM_REQ_CMP)
return;