From 1e595d9c2b8608bcef48d6a69cc2f6135780bcc0 Mon Sep 17 00:00:00 2001 From: Bjoern Doebel Date: Wed, 9 Mar 2022 16:22:03 +0100 Subject: [PATCH] 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 Acked-by: Konrad Rzeszutek Wilk Reviewed-by: Ross Lagerwall (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 81ceafce98..cc2ee9a94a 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;