]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
livepatch: resolve old address before function verification
authorBjoern Doebel <doebel@amazon.de>
Wed, 9 Mar 2022 15:22:03 +0000 (16:22 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 28 Mar 2022 11:50:23 +0000 (12:50 +0100)
When verifying that a livepatch can be applied, we may as well want to
inspect the target function to be patched. To do so, we need to resolve
this function's address before running the arch-specific
livepatch_verify hook.

Signed-off-by: Bjoern Doebel <doebel@amazon.de>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
(cherry picked from commit 5142dc5c25e317c208e3dc16d16b664b9f05dab5)

xen/common/livepatch.c

index 81ceafce9805d99e771d92ea626585801d55ebfd..cc2ee9a94a0403ee8ed0584d17a58be41f16eca1 100644 (file)
@@ -685,11 +685,11 @@ static int prepare_payload(struct payload *payload,
                 return -EINVAL;
             }
 
-            rc = arch_livepatch_verify_func(f);
+            rc = resolve_old_address(f, elf);
             if ( rc )
                 return rc;
 
-            rc = resolve_old_address(f, elf);
+            rc = arch_livepatch_verify_func(f);
             if ( rc )
                 return rc;