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

[Xen-changelog] [xen stable-4.7] memory: exit early from memory_exchange() upon write-back error



commit 4ed855857633fcd38bafa82976296be9718a4bac
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed May 3 17:11:04 2017 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed May 3 17:11:04 2017 +0200

    memory: exit early from memory_exchange() upon write-back error
    
    There's no point in continuing if in the end we'll return -EFAULT
    anyway. It also seems wrong to report a chunk for which at least one
    write-back failed as successfully exchanged (albeit the indication of
    an error is also not fully correct, as the exchange happened in that
    case at least partially - retrieving the GFN to assign the memory to
    and/or handing back the information on the replacement memory didn't
    work). In any case limiting the amount of damage done to the guest
    can't be all that bad an idea.
    
    Reported-by: Jann Horn <jannh@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: 1cf4d2ec0d7c0cb53729ca810e416793030f6f07
    master date: 2017-04-05 16:39:16 +0200
---
 xen/common/memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 31c7351..301fb72 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -617,6 +617,9 @@ static long 
memory_exchange(XEN_GUEST_HANDLE_PARAM(xen_memory_exchange_t) arg)
             }
         }
         BUG_ON( !(d->is_dying) && (j != (1UL << out_chunk_order)) );
+
+        if ( rc )
+            goto fail;
     }
 
     exch.nr_exchanged = exch.in.nr_extents;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.7

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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