On Fri, Sep 18, 2020 at 02:38:59AM +0000, Vishnu Dasa wrote:
Avoid calling ib_dispatch_event on an inactive device in order to prevent writing to invalid I/O mapped addresses which could cause a guest crash.
Also, set the ib_active status to 'false' in pvrdma_pci_remove and in the failure path of pvrdma_pci_probe.
Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver") Acked-by: Adit Ranadive aditr@vmware.com Signed-off-by: Vishnu Dasa vdasa@vmware.com
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
To fix this bug you need to change pvrdma_netdevice_event to use ib_device_get_by_netdev() instead of the pvrdma_device_list global
And then use ib_device_put in the pvrdma_netdevice_event_work() once the pointer is no longer needed.
The core code handles all the required locking
Jason