[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.5] hvmloader: fix scratch_alloc to avoid overlaps



commit 820311c63d1dd713b7a50d31e92c5424fd791015
Author:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
AuthorDate: Wed Feb 17 16:49:49 2016 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Feb 17 16:49:49 2016 +0100

    hvmloader: fix scratch_alloc to avoid overlaps
    
    scratch_alloc() set scratch_start to the last byte of the current
    allocation.  The value of scratch_start is then reused as is (if it is
    already aligned) in the next allocation.  This result in a potential reuse
    of the last byte of the previous allocation.
    
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: 4ab3ac074cb1f101f42e02103fa263a1f4f422b5
    master date: 2016-02-10 14:46:45 +0100
---
 tools/firmware/hvmloader/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 80d822f..323c78a 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -450,7 +450,7 @@ void *scratch_alloc(uint32_t size, uint32_t align)
     if ( align < 16 )
         align = 16;
 
-    s = (scratch_start + align - 1) & ~(align - 1);
+    s = (scratch_start + align) & ~(align - 1);
     e = s + size - 1;
 
     BUG_ON(e < s);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.