From owner-dev-commits-src-main@freebsd.org Sun May 16 10:45:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1700A63D917; Sun, 16 May 2021 10:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fjf7404Wrz3Gv9; Sun, 16 May 2021 10:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E051F1760E; Sun, 16 May 2021 10:45:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14GAjZ1S093218; Sun, 16 May 2021 10:45:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14GAjZIL093217; Sun, 16 May 2021 10:45:35 GMT (envelope-from git) Date: Sun, 16 May 2021 10:45:35 GMT Message-Id: <202105161045.14GAjZIL093217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 0f206cc91279 - main - cam: add missing zeroing of a stack-allocated CCB. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f206cc91279e630ad9e733eb6e330b7dbe6c70e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2021 10:45:36 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=0f206cc91279e630ad9e733eb6e330b7dbe6c70e commit 0f206cc91279e630ad9e733eb6e330b7dbe6c70e Author: Edward Tomasz Napierala AuthorDate: 2021-05-16 09:28:04 +0000 Commit: Edward Tomasz Napierala 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 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;