pci: assert configuration access is within bounds
commitf7d6a635fa3b7797f9d072e280f065bf3cfcd24d
authorPrasad J Pandit <pjp@fedoraproject.org>
Thu, 4 Jun 2020 11:35:25 +0000 (4 17:05 +0530)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 9 Jun 2020 18:18:04 +0000 (9 14:18 -0400)
tree9e43e03f7f27fbda33da15a70a0bc8a74e69094b
parent0dabc0f6544f2c0310546f6d6cf3b68979580a9c
pci: assert configuration access is within bounds

While accessing PCI configuration bytes, assert that
'address + len' is within PCI configuration space.

Generally it is within bounds. This is more of a defensive
assert, in case a buggy device was to send 'address' which
may go out of bounds.

Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <20200604113525.58898-1-ppandit@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pci.c