mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
livepatch: Deal with payloads without any .text
It is possible. Especially if the only thing they do is NOP functions - in which case there is only .livepatch.funcs sections. Reviewed-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
1 parent
6e0815a8d7
commit
63e23a29e0
1 file changed
+7
-6
@@ -386,16 +386,17 @@ static int move_payload(struct payload *payload, struct livepatch_elf *elf)
|
||||
|
||||
static int secure_payload(struct payload *payload, struct livepatch_elf *elf)
|
||||
{
|
||||
int rc;
|
||||
int rc = 0;
|
||||
unsigned int text_pages, rw_pages, ro_pages;
|
||||
|
||||
text_pages = PFN_UP(payload->text_size);
|
||||
ASSERT(text_pages);
|
||||
|
||||
rc = arch_livepatch_secure(payload->text_addr, text_pages, LIVEPATCH_VA_RX);
|
||||
if ( rc )
|
||||
return rc;
|
||||
|
||||
if ( text_pages )
|
||||
{
|
||||
rc = arch_livepatch_secure(payload->text_addr, text_pages, LIVEPATCH_VA_RX);
|
||||
if ( rc )
|
||||
return rc;
|
||||
}
|
||||
rw_pages = PFN_UP(payload->rw_size);
|
||||
if ( rw_pages )
|
||||
{
|
||||
|
||||