mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-23 02:17:22 +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>
38 lines
493 B
ArmAsm
38 lines
493 B
ArmAsm
OUTPUT_ARCH(i386:x86-64)
|
|
TARGET(elf64-x86-64)
|
|
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*)
|
|
}
|
|
}
|