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:
Konrad Rzeszutek Wilk committed 2016-09-07 21:10:40 -04:00
1 parent 6e0815a8d7
commit 63e23a29e0
1 file changed
+7 -6
+7 -6
View File
@@ -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 )
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.