]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve nvme: Fix Controller init error cases
authorChuck Tuffli <chuck@FreeBSD.org>
Sun, 14 Aug 2022 14:47:34 +0000 (07:47 -0700)
committerChuck Tuffli <chuck@FreeBSD.org>
Sun, 14 Aug 2022 14:47:34 +0000 (07:47 -0700)
commitd7d1becad4b692b97dd1f32706947aae5118294b
treecb724c638c7051c8b85374b27974854c6dc17644
parent3d3678627c3112c94d174a8c51d8c058d02befb3
bhyve nvme: Fix Controller init error cases

Fuzzing of bhyve uncovered an assertion failure in the NVMe emulation.
Investigation uncovered several corner cases the code did not handle.
This change handles several Controller initialization errors, including
 - bad AQ sizes
 - bad AQ vm_map_gpa
 - doorbell writes prior to RDY
 - doorbell writes to uninitialized queue
 - CSTS.RDY if CFS set

PR: 256317,256319,256320,256322
Reported by: Cheolwoo Myung <cwmyung@snu.ac.kr>
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D35453
usr.sbin/bhyve/pci_nvme.c