diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-02-03 14:18:27 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-02-05 08:52:58 -0500 |
commit | 7c16b5bbb6c0f797945327d17e4be60f25a4427d (patch) | |
tree | 0e6282cdb510ac438890d0224a814c9f9ec72979 /include/hw/pci/pci.h | |
parent | 923abdb4bdfb6d93bfe6c941ead70f3ea6707e40 (diff) |
pci: reject too large ROMs
get_image_size() returns an int64_t, which pci_add_option_rom() assigns
to an "int" without any range checking. A 32-bit BAR could be up to
2 GiB in size, so reject anything above it. In order to accomodate
a rounded-up size of 2 GiB, change pci_patch_ids's size argument
to unsigned.
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210203131828.156467-2-pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: David Edmondson <david.edmondson@oracle.com>
Diffstat (limited to 'include/hw/pci/pci.h')
0 files changed, 0 insertions, 0 deletions