mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-08-04 15:53:44 +00:00
Some kernels have W^X mitigation, which means they won't execute memory blocks if that memory block is also writable or ever was writable. This patch enables CRIU to run on such kernels. 1. Align .data section to a page. 2. mmap a memory block for parasite as RX. 3. mprotect everything after .text as RW. Signed-off-by: Michał Cłapiński <mclapinski@google.com>
36 lines
472 B
ArmAsm
36 lines
472 B
ArmAsm
OUTPUT_ARCH(s390:64-bit)
|
|
EXTERN(__export_parasite_head_start)
|
|
|
|
SECTIONS
|
|
{
|
|
.text : {
|
|
*(.head.text)
|
|
ASSERT(DEFINED(__export_parasite_head_start),
|
|
"Symbol __export_parasite_head_start is missing");
|
|
*(.text*)
|
|
*(.compel.exit)
|
|
*(.compel.init)
|
|
}
|
|
|
|
.data : ALIGN(0x1000) {
|
|
*(.data*)
|
|
*(.bss*)
|
|
}
|
|
|
|
.rodata : {
|
|
*(.rodata*)
|
|
*(.got*)
|
|
}
|
|
|
|
.toc : ALIGN(8) {
|
|
*(.toc*)
|
|
}
|
|
|
|
/DISCARD/ : {
|
|
*(.debug*)
|
|
*(.comment*)
|
|
*(.note*)
|
|
*(.group*)
|
|
*(.eh_frame*)
|
|
}
|
|
}
|