Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
qemu.3557
0237-exec-Respect-as_tranlsate_internal-.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0237-exec-Respect-as_tranlsate_internal-.patch of Package qemu.3557
From 7bfb4dae630bc59750be8addf36bf36bc88460c5 Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Date: Mon, 16 Mar 2015 22:35:54 -0700 Subject: [PATCH] exec: Respect as_tranlsate_internal length clamp address_space_translate_internal will clamp the *plen length argument based on the size of the memory region being queried. The iommu walker logic in addresss_space_translate was ignoring this by discarding the post fn call value of *plen. Fix by just always using *plen as the length argument throughout the fn, removing the len local variable. This fixes a bootloader bug when a single elf section spans multiple QEMU memory regions. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-Id: <1426570554-15940-1-git-send-email-peter.crosthwaite@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit c3c1bb99d1c11978d9ce94d1bdcf0705378c1459) [BR: BSC#969121 CVE-2015-8817] Signed-off-by: Bruce Rogers <brogers@suse.com> --- exec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index 7d74973..a58be1a 100644 --- a/exec.c +++ b/exec.c @@ -358,7 +358,6 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr, IOMMUTLBEntry iotlb; MemoryRegionSection *section; MemoryRegion *mr; - hwaddr len = *plen; for (;;) { section = address_space_translate_internal(as->dispatch, addr, &addr, plen, true); @@ -371,7 +370,7 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr, iotlb = mr->iommu_ops->translate(mr, addr); addr = ((iotlb.translated_addr & ~iotlb.addr_mask) | (addr & iotlb.addr_mask)); - len = MIN(len, (addr | iotlb.addr_mask) - addr + 1); + *plen = MIN(*plen, (addr | iotlb.addr_mask) - addr + 1); if (!(iotlb.perm & (1 << is_write))) { mr = &io_mem_unassigned; break; @@ -382,10 +381,9 @@ MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr, if (memory_access_is_direct(mr, is_write)) { hwaddr page = ((addr & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE) - addr; - len = MIN(page, len); + *plen = MIN(page, *plen); } - *plen = len; *xlat = addr; return mr; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor