summaryrefslogtreecommitdiffstats
path: root/scripts/switch-timer-api
diff options
context:
space:
mode:
authorPaolo Bonzini2015-03-25 14:14:56 +0100
committerPaolo Bonzini2015-03-26 10:43:54 +0100
commitf18c69cfc554cf9776eb3c35b7510e17541afacb (patch)
tree9718fbc710164140315a97dd83e0d19d6b80f9f2 /scripts/switch-timer-api
parentsparc: memory: Replace memory_region_init_ram with memory_region_allocate_sys... (diff)
downloadqemu-f18c69cfc554cf9776eb3c35b7510e17541afacb.tar.gz
qemu-f18c69cfc554cf9776eb3c35b7510e17541afacb.tar.xz
qemu-f18c69cfc554cf9776eb3c35b7510e17541afacb.zip
exec: avoid possible overwriting of mmaped area in qemu_ram_remap
It is not necessary to munmap an area before remapping it with MAP_FIXED; if the memory region specified by addr and len overlaps pages of any existing mapping, then the overlapped part of the existing mapping will be discarded. On the other hand, if QEMU does munmap the pages, there is a small probability that another mmap sneaks in and catches the just-freed portion of the address space. In effect, munmap followed by mmap(MAP_FIXED) is a use-after-free error, and Coverity flags it as such. Fix it. Reviewed-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'scripts/switch-timer-api')
0 files changed, 0 insertions, 0 deletions