]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vmci: fix panic due to freeing unallocated resources
authorMark Peek <mp@FreeBSD.org>
Sat, 9 Oct 2021 21:21:16 +0000 (14:21 -0700)
committerMark Peek <mp@FreeBSD.org>
Sun, 17 Oct 2021 15:31:53 +0000 (08:31 -0700)
commitb5d236785dc352a65bc29d97c8a89b40387eb7a0
treef4bfe988045627703ba9328d5f97e1223fd9b4fa
parenta8dfac9caa7b7624fe2546efd47c217ad86e0085
vmci: fix panic due to freeing unallocated resources

Summary:
An error mapping PCI resources results in a panic due to unallocated
resources being freed up. This change puts the appropriate checks in
place to prevent the panic.

PR: 252445
Reported by: Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
Tested by: marcus
MFC after: 1 week
Sponsored by: VMware

Test Plan:
Along with user testing, also simulated error by inserting a ENXIO
return in vmci_map_bars().

Reviewed by: marcus
Subscribers: imp
Differential Revision: https://reviews.freebsd.org/D32016

(cherry picked from commit 0f14bcbe384091c729464cb770372aeb79061070)
sys/dev/vmware/vmci/vmci.c
sys/dev/vmware/vmci/vmci_event.c
sys/dev/vmware/vmci/vmci_kernel_if.c
sys/dev/vmware/vmci/vmci_kernel_if.h
sys/dev/vmware/vmci/vmci_queue_pair.c