[xen master] livepatch: Expand check for safe_for_reapply if livepatch has only .rodata.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] livepatch: Expand check for safe_for_reapply if livepatch has only .rodata.

patchbot
commit 66d3f83db68a529fee807151d9b2906851f58cac
Author:     Konrad Rzeszutek Wilk <[hidden email]>
AuthorDate: Wed Aug 2 00:29:01 2017 +0000
Commit:     Konrad Rzeszutek Wilk <[hidden email]>
CommitDate: Thu Oct 5 10:29:12 2017 -0400

    livepatch: Expand check for safe_for_reapply if livepatch has only .rodata.
   
    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 <[hidden email]>
    Signed-off-by: Konrad Rzeszutek Wilk <[hidden email]>
---
 xen/common/livepatch.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
index 0393829..b9376c9 100644
--- a/xen/common/livepatch.c
+++ b/xen/common/livepatch.c
@@ -417,9 +417,12 @@ static int move_payload(struct payload *payload, struct livepatch_elf *elf)
         }
     }
 
-    /* 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);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog