int noinline arch_livepatch_quiesce(void)
{
/*
- * Relax perms on .text to be RWX, so we can modify them.
+ * Relax perms on .text/.rodata, so we can modify them.
*
* This relaxes perms globally, but all other CPUs are waiting on us.
*/
void noinline arch_livepatch_revive(void)
{
/*
- * Reinstate perms on .text to be RX. This also cleans out the dirty
+ * Reinstate perms on .text/.rodata. This also cleans out the dirty
* bits, which matters when CET Shstk is active.
*
* The other CPUs waiting for us could in principle have re-walked while
rcu_read_lock(&rcu_virtual_region_lock);
list_for_each_entry_rcu( region, &virtual_region_list, list )
+ {
modify_xen_mappings_lite((unsigned long)region->text_start,
PAGE_ALIGN((unsigned long)region->text_end),
PAGE_HYPERVISOR_RWX);
+ if ( region->rodata_start )
+ modify_xen_mappings_lite((unsigned long)region->rodata_start,
+ PAGE_ALIGN((unsigned long)region->rodata_end),
+ PAGE_HYPERVISOR_RW);
+ }
rcu_read_unlock(&rcu_virtual_region_lock);
}
rcu_read_lock(&rcu_virtual_region_lock);
list_for_each_entry_rcu( region, &virtual_region_list, list )
+ {
modify_xen_mappings_lite((unsigned long)region->text_start,
PAGE_ALIGN((unsigned long)region->text_end),
PAGE_HYPERVISOR_RX);
+ if ( region->rodata_start )
+ modify_xen_mappings_lite((unsigned long)region->rodata_start,
+ PAGE_ALIGN((unsigned long)region->rodata_end),
+ PAGE_HYPERVISOR_RO);
+ }
rcu_read_unlock(&rcu_virtual_region_lock);
}
#endif /* CONFIG_X86 */