aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2017-01-30 19:49:08 +0000
committerAlan Somers <asomers@FreeBSD.org>2017-01-30 19:49:08 +0000
commit4e02badb1827514af03d7ca781d2c3c2b4e604eb (patch)
treea9cb4c64eba9aa8ff8fa5543eb3de08e8712f3ba
parentaa3650ea3695c8d29be1b5394195b27626bc9167 (diff)
Initialize a stack variable in mprsas_get_sas_address_for_sata_disk
Thought it's difficult to reproduce, I think this variable was responsible for a use-after-free panic when a SATA disk timed out responding to a SATA identify command during boot. Submitted by: slm Reviewed by: slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9364
Notes
Notes: svn path=/head/; revision=312995
-rw-r--r--sys/dev/mpr/mpr_sas_lsi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/mpr/mpr_sas_lsi.c b/sys/dev/mpr/mpr_sas_lsi.c
index 9796074f4b2f..3150dfc6a9ea 100644
--- a/sys/dev/mpr/mpr_sas_lsi.c
+++ b/sys/dev/mpr/mpr_sas_lsi.c
@@ -911,6 +911,7 @@ mprsas_get_sas_address_for_sata_disk(struct mpr_softc *sc,
u8 sas_status;
memset(&ata_identify, 0, sizeof(ata_identify));
+ memset(&mpi_reply, 0, sizeof(mpi_reply));
try_count = 0;
do {
rc = mprsas_get_sata_identify(sc, handle, &mpi_reply,