]> git.baikalelectronics.ru Git - kernel.git/commit
virtio: mmio-v1: Validate queue PFN
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Wed, 18 Jul 2018 09:18:44 +0000 (10:18 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 21 Aug 2018 21:56:56 +0000 (00:56 +0300)
commit4974f8f7061fcf2cb40625543c569b8b65fe4823
treef3e5cfc2cd07fb8ac3745c26d3583fc38bf79a63
parent3abb723f464dd8d59798be79b96143e741dd723a
virtio: mmio-v1: Validate queue PFN

virtio-mmio with virtio-v1 uses a 32bit PFN for the queue.
If the queue pfn is too large to fit in 32bits, which
we could hit on arm64 systems with 52bit physical addresses
(even with 64K page size), we simply miss out a proper link
to the other side of the queue.

Add a check to validate the PFN, rather than silently breaking
the devices.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Christoffer Dall <cdall@kernel.org>
Cc: Peter Maydel <peter.maydell@linaro.org>
Cc: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_mmio.c