]> git.baikalelectronics.ru Git - kernel.git/commit
vhost: do not try to access device IOTLB when not initialized
authorJason Wang <jasowang@redhat.com>
Tue, 23 Jan 2018 09:27:26 +0000 (17:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jan 2018 21:55:38 +0000 (16:55 -0500)
commit1de411ee4255e9d840d504469d71b9a9b620f2e4
tree79691386ba561416fd16ef230077f913782f84a0
parent441c5a6fb78fa3623c33c832d765a1a0f164e27c
vhost: do not try to access device IOTLB when not initialized

The code will try to access dev->iotlb when processing
VHOST_IOTLB_INVALIDATE even if it was not initialized which may lead
to NULL pointer dereference. Fixes this by check dev->iotlb before.

Fixes: 89cd651c320dc ("vhost: new device IOTLB API")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/vhost.c