mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
balloon: Don't balloon roms
A broken guest can specify physical addresses that correspond to any memory region, but it shouldn't be able to change ROM. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Cc: qemu-stable@nongnu.org Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
e66bcc4081
commit
f2fd57db36
2 changed files with 8 additions and 1 deletions
|
@ -228,8 +228,13 @@ static void virtio_balloon_handle_output(VirtIODevice *vdev, VirtQueue *vq)
|
|||
|
||||
/* FIXME: remove get_system_memory(), but how? */
|
||||
section = memory_region_find(get_system_memory(), pa, 1);
|
||||
if (!int128_nz(section.size) || !memory_region_is_ram(section.mr))
|
||||
if (!int128_nz(section.size) ||
|
||||
!memory_region_is_ram(section.mr) ||
|
||||
memory_region_is_rom(section.mr) ||
|
||||
memory_region_is_romd(section.mr)) {
|
||||
trace_virtio_balloon_bad_addr(pa);
|
||||
continue;
|
||||
}
|
||||
|
||||
trace_virtio_balloon_handle_output(memory_region_name(section.mr),
|
||||
pa);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue