All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/physmap: Propagate error rc from xenmem_add_to_physmap_one
@ 2016-12-07  1:00 Jiandi An
  2016-12-07  1:07 ` Andrew Cooper
  0 siblings, 1 reply; 6+ messages in thread
From: Jiandi An @ 2016-12-07  1:00 UTC (permalink / raw)
  To: xen-devel
  Cc: sstabellini, wei.liu2, George.Dunlap, andrew.cooper3, ian.jackson,
	tim, jbeulich, shankerd

Error return code from xenmem_add_to_physmap_one() is not properly
handled in xenmem_add_to_physmap_batch().  This causes do_memory_op()
to return success to guest even though the underlying memory map fails.

Signed-off-by: Jiandi An <anjiandi@codeaurora.org>
---
 xen/common/memory.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 21797ca..4e46258 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -762,6 +762,8 @@ static int xenmem_add_to_physmap_batch(struct domain *d,
         rc = xenmem_add_to_physmap_one(d, xatpb->space,
                                        xatpb->u,
                                        idx, _gfn(gpfn));
+        if ( rc < 0 )
+            goto out;
 
         if ( unlikely(__copy_to_guest_offset(xatpb->errs, 0, &rc, 1)) )
         {
-- 
Jiandi An
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-12-08  9:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-07  1:00 [PATCH] xen/physmap: Propagate error rc from xenmem_add_to_physmap_one Jiandi An
2016-12-07  1:07 ` Andrew Cooper
2016-12-07 11:43   ` Jan Beulich
2016-12-07 17:09     ` Andrew Cooper
2016-12-08  9:21       ` Jan Beulich
2016-12-07 18:54     ` Jiandi An

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.