git: 0f206cc91279 - main - cam: add missing zeroing of a stack-allocated CCB.
Edward Tomasz Napierala
trasz at FreeBSD.org
Sun May 16 10:45:36 UTC 2021
The branch main has been updated by trasz:
URL: https://cgit.FreeBSD.org/src/commit/?id=0f206cc91279e630ad9e733eb6e330b7dbe6c70e
commit 0f206cc91279e630ad9e733eb6e330b7dbe6c70e
Author: Edward Tomasz Napierala <trasz at FreeBSD.org>
AuthorDate: 2021-05-16 09:28:04 +0000
Commit: Edward Tomasz Napierala <trasz at FreeBSD.org>
CommitDate: 2021-05-16 10:38:26 +0000
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.
---
sys/cam/ata/ata_xpt.c | 1 +
sys/cam/scsi/scsi_xpt.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c
index c13c7b493c78..2e3f862cbf41 100644
--- a/sys/cam/ata/ata_xpt.c
+++ b/sys/cam/ata/ata_xpt.c
@@ -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;
diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c
index bdc23e4b51b7..5097802c4063 100644
--- a/sys/cam/scsi/scsi_xpt.c
+++ b/sys/cam/scsi/scsi_xpt.c
@@ -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;
More information about the dev-commits-src-all
mailing list