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

[Xen-devel] [PATCH v1 2/3] livepatch: Include sizes when an mismatch occurs



If the .bug.frames.X or .livepatch.funcs sizes are different
than what the hypervisor expects - we fail the payload. To help
in diagnosing this include the expected and the payload
sizes.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
 xen/common/livepatch.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
index 5d53096..c0eb609 100644
--- a/xen/common/livepatch.c
+++ b/xen/common/livepatch.c
@@ -520,8 +520,8 @@ static int prepare_payload(struct payload *payload,
     ASSERT(sec);
     if ( sec->sec->sh_size % sizeof(*payload->funcs) )
     {
-        dprintk(XENLOG_ERR, LIVEPATCH "%s: Wrong size of 
"ELF_LIVEPATCH_FUNC"!\n",
-                elf->name);
+        dprintk(XENLOG_ERR, LIVEPATCH "%s: Wrong size of "ELF_LIVEPATCH_FUNC"! 
(exp: %zu vs %"PRIuElfWord")\n",
+                elf->name, sizeof(*payload->funcs), sec->sec->sh_size);
         return -EINVAL;
     }
 
@@ -648,8 +648,9 @@ static int prepare_payload(struct payload *payload,
 
         if ( sec->sec->sh_size % sizeof(*region->frame[i].bugs) )
         {
-            dprintk(XENLOG_ERR, LIVEPATCH "%s: Wrong size of 
.bug_frames.%u!\n",
-                    elf->name, i);
+            dprintk(XENLOG_ERR, LIVEPATCH "%s: Wrong size of .bug_frames.%u! 
(exp: %zu vs %"PRIuElfWord")\n",
+                    elf->name, i, sizeof(*region->frame[i].bugs),
+                    sec->sec->sh_size);
             return -EINVAL;
         }
 
-- 
2.9.3


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

 


Rackspace

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