git: 5b81e2e1bcdc - main - virtio_scsi: Zero stack-allocated CCBs
Mark Johnston
markj at FreeBSD.org
Mon May 17 02:25:36 UTC 2021
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=5b81e2e1bcdc2692044873e147f84b67e35e8dcd
commit 5b81e2e1bcdc2692044873e147f84b67e35e8dcd
Author: Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-05-17 02:14:41 +0000
Commit: Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-05-17 02:20:39 +0000
virtio_scsi: Zero stack-allocated CCBs
Fixes: 3394d4239b ("cam: allocate CCBs from UMA for SCSI and ATA IO")
Reported by: syzbot+2e9ce63919709feb3d1c at syzkaller.appspotmail.com
Reviewed by: trasz
Sponsored by: The FreeBSD Foundation
---
sys/dev/virtio/scsi/virtio_scsi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sys/dev/virtio/scsi/virtio_scsi.c b/sys/dev/virtio/scsi/virtio_scsi.c
index 51d9e5f532f7..adf4fd17fc5b 100644
--- a/sys/dev/virtio/scsi/virtio_scsi.c
+++ b/sys/dev/virtio/scsi/virtio_scsi.c
@@ -700,6 +700,7 @@ vtscsi_register_async(struct vtscsi_softc *sc)
{
struct ccb_setasync csa;
+ memset(&csa, 0, sizeof(csa));
xpt_setup_ccb(&csa.ccb_h, sc->vtscsi_path, 5);
csa.ccb_h.func_code = XPT_SASYNC_CB;
csa.event_enable = AC_LOST_DEVICE | AC_FOUND_DEVICE;
@@ -716,6 +717,7 @@ vtscsi_deregister_async(struct vtscsi_softc *sc)
{
struct ccb_setasync csa;
+ memset(&csa, 0, sizeof(csa));
xpt_setup_ccb(&csa.ccb_h, sc->vtscsi_path, 5);
csa.ccb_h.func_code = XPT_SASYNC_CB;
csa.event_enable = 0;
More information about the dev-commits-src-all
mailing list