From 24f6f48731f6403be7991e8662f92392b7a6a7f6 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Wed, 24 Feb 2021 04:32:30 -0500 Subject: [PATCH] asm-generic: add .data.rel.ro sections to __ro_after_init maillist inclusion commit 857ddf520d76d6516d5cdca396461141b7ca921b category: feature feature: ARM kaslr support bugzilla: 47952 CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?h=arm-kaslr-latest&id=857ddf520d76d6516d5cdca396461141b7ca921b ------------------------------------------------- When running in PIC mode, the compiler will emit const structures containing runtime relocatable quantities into .data.rel.ro.* sections, so that the linker can be smart about placing them together in a segment that is read-write initially, and is remapped read-only afterwards. This is exactly what __ro_after_init aims to provide, so move these sections together. Acked-by: Arnd Bergmann Acked-by: Nicolas Pitre Acked-by: Kees Cook Signed-off-by: Ard Biesheuvel Signed-off-by: Cui GaoSheng Reviewed-by: Xiu Jianfeng Signed-off-by: Zheng Zengkai --- include/asm-generic/vmlinux.lds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index b97c628ad91f..a7bfc998493f 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -403,7 +403,7 @@ #define RO_AFTER_INIT_DATA \ . = ALIGN(8); \ __start_ro_after_init = .; \ - *(.data..ro_after_init) \ + *(.data..ro_after_init .data.rel.ro.*) \ JUMP_TABLE_DATA \ STATIC_CALL_DATA \ __end_ro_after_init = .; -- GitLab