]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg: SataControllerDxe: SataControllerStop: fix use after free
authorLaszlo Ersek <lersek@redhat.com>
Tue, 26 Apr 2016 11:57:32 +0000 (13:57 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 26 Apr 2016 15:59:40 +0000 (17:59 +0200)
commit0b448dd8b27c9efac370576b18edada004ab560a
treeac7eb5a652c7d3100d71c524a1413914a193002b
parent81310a62be3190b2e49b7b188469d0f463c9a866
OvmfPkg: SataControllerDxe: SataControllerStop: fix use after free

It would be possible to remove the UAF without local variables, by calling
SataPrivateData->PciIo->Attributes() before releasing SataPrivateData.

However, by keeping the location of the call (for which temporary
variables are necessary), we continue to match the error path logic in
SataControllerStart(), which is always recommended.

Reported-by: wang xiaofeng <winggundum82@163.com>
Fixes: bcab71413407e61c144994925556725dd65eede9
Cc: wang xiaofeng <winggundum82@163.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OvmfPkg/SataControllerDxe/SataController.c