If the livepatch has only .rodata sections then it is OK to also
apply/revert/apply the livepatch without having to worry about the
unforseen consequences.
See commit
98b728a7b235c67e210f67f789db5d9eb38ca00c
"livepatch: Disallow applying after an revert" for details.
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
}
}
- /* Only one RW section with non-zero size: .livepatch.funcs */
- if ( rw_buf_cnt == 1 &&
- !strcmp(elf->sec[rw_buf_sec].name, ELF_LIVEPATCH_FUNC) )
+ /*
+ * Only one RW section with non-zero size: .livepatch.funcs,
+ * or only RO sections.
+ */
+ if ( !rw_buf_cnt || (rw_buf_cnt == 1 &&
+ !strcmp(elf->sec[rw_buf_sec].name, ELF_LIVEPATCH_FUNC)) )
payload->safe_to_reapply = true;
out:
xfree(offset);