Page MenuHomeFreeBSD

Initialize a stack variable in mprsas_get_sas_address_for_sata_disk
ClosedPublic

Authored by asomers on Jan 27 2017, 10:58 PM.

Details

Summary

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 times out responding to a SATA
identify command during boot.

Submitted by: slm

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

asomers retitled this revision from to Initialize a stack variable in mprsas_get_sas_address_for_sata_disk.Jan 27 2017, 10:58 PM
asomers updated this object.
asomers edited the test plan for this revision. (Show Details)
asomers added a reviewer: slm.
asomers updated this revision to Diff 24514.
asomers added inline comments.Jan 27 2017, 10:58 PM
sys/dev/mpr/mpr_sas_lsi.c
930 ↗(On Diff #24514)

@slm Is this debug message to your liking? I don't want to commit it if it isn't exactly what you want.

slm added inline comments.Jan 30 2017, 6:40 PM
sys/dev/mpr/mpr_sas_lsi.c
930 ↗(On Diff #24514)

You shouldn't really need to print this message because mprsas_get_sata_identify will print a message already if there is a problem. You can see this message in your issue, "... request for page completed with error...". And, in fact, ioc_status and sas_status will not show anything useful if there is no reply.

asomers added inline comments.Jan 30 2017, 6:45 PM
sys/dev/mpr/mpr_sas_lsi.c
930 ↗(On Diff #24514)

I only added this because you asked for something like it in your email dated Jan-24. Do you want something different? Or should I just remove it?

slm added inline comments.Jan 30 2017, 6:49 PM
sys/dev/mpr/mpr_sas_lsi.c
930 ↗(On Diff #24514)

Oh, sorry. I only meant for you to add that for your own debugging purposes so that we could narrow down where the problem was. Now that we know that mpi_reply is not 0'd out, I think that's all we need and you can remove the print.

asomers edited edge metadata.Jan 30 2017, 6:55 PM
asomers updated this revision to Diff 24574.

Remove debugging printf

slm edited edge metadata.Jan 30 2017, 7:05 PM
slm accepted this revision.
This revision is now accepted and ready to land.Jan 30 2017, 7:05 PM
This revision was automatically updated to reflect the committed changes.