livepatch: resolve old address before function verification
authorBjoern Doebel <doebel@amazon.de>
Wed, 9 Mar 2022 15:22:03 +0000 (16:22 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 9 Mar 2022 15:22:03 +0000 (16:22 +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>
xen/common/livepatch.c

index ec301a9f120cfdaca9d621238873950d13822e5c..be2cf75c2d579476d903739d342838e6c5e3787f 100644 (file)
@@ -684,11 +684,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;