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

[xen stable-4.15] livepatch: resolve old address before function verification



commit bb43e0e1ca20dff14536b7c90ff870f3f50bff8f
Author:     Bjoern Doebel <doebel@xxxxxxxxx>
AuthorDate: Wed Mar 9 16:22:03 2022 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Mon Mar 28 12:50:13 2022 +0100

    livepatch: resolve old address before function verification
    
    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@xxxxxxxxx>
    Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
    Reviewed-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
    (cherry picked from commit 5142dc5c25e317c208e3dc16d16b664b9f05dab5)
---
 xen/common/livepatch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
index 7118551b27..329b01c1e8 100644
--- a/xen/common/livepatch.c
+++ b/xen/common/livepatch.c
@@ -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;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.15



 


Rackspace

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