]> git.baikalelectronics.ru Git - kernel.git/commit
vhost-vdpa: fix vm_flags for virtqueue doorbell mapping
authorJason Wang <jasowang@redhat.com>
Tue, 13 Apr 2021 09:15:57 +0000 (17:15 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 3 May 2021 08:55:52 +0000 (04:55 -0400)
commit0b7f18258d44d4cc4cf30ef185e8da9439ecd83d
tree8b83161de05cb4baee183657ea0c5dbf0f051d1b
parent016bad8bfaec792e0dee7cbd270ef6de8d6d0717
vhost-vdpa: fix vm_flags for virtqueue doorbell mapping

The virtqueue doorbell is usually implemented via registeres but we
don't provide the necessary vma->flags like VM_PFNMAP. This may cause
several issues e.g when userspace tries to map the doorbell via vhost
IOTLB, kernel may panic due to the page is not backed by page
structure. This patch fixes this by setting the necessary
vm_flags. With this patch, try to map doorbell via IOTLB will fail
with bad address.

Cc: stable@vger.kernel.org
Fixes: 4bbe1b545731 ("vhost_vdpa: support doorbell mapping via mmap")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20210413091557.29008-1-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vdpa.c