Skip to contentSkip to conversation

powerpc: Fix writable sections being moved into the rodata region

PATCH Applied Nicholas Piggin 3 participants 3 messages Nov 16, 2022 – Nov 20, 2022 PowerPC

lore
Share & tools
lore

Nicholas Piggin

author reviewer
#0 lore raw

PATCH 1/1 powerpc: Fix writable sections being moved into the rodata region

.data.rel.ro* catches .data.rel.root_cpuacct, and the kernel crashes on a store in css_clear_dir. At least we know read-only data protection is working...

Fixes b6adc6d6d3272 ("powerpc/build: move .data.rel.ro, .sdata2 to read-only")
---
 arch/powerpc/kernel/vmlinux.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/vmlinux.lds.S +1 -1
index 7786e3ac7611..8c3862b4c259 100644
@@ -142,7 +142,7 @@ SECTIONS
 #endif
 
 	.data.rel.ro : AT(ADDR(.data.rel.ro) - LOAD_OFFSET) {
-		*(.data.rel.ro*)
+		*(.data.rel.ro .data.rel.ro.*)
 	}
 
 	.branch_lt : AT(ADDR(.branch_lt) - LOAD_OFFSET) {
Signature · 1 line
2.37.2
Reviewed-by on v1 1/1
#1 lore raw

Le 16/11/2022 à 05:39, Nicholas Piggin a écrit :

Quoted 6 lines

.data.rel.ro* catches .data.rel.root_cpuacct, and the kernel crashes on a store in css_clear_dir. At least we know read-only data protection is working...

Fixes b6adc6d6d3272 ("powerpc/build: move .data.rel.ro, .sdata2 to read-only")
Quoted 17 lines
---
  arch/powerpc/kernel/vmlinux.lds.S | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/vmlinux.lds.S +1 -1
index 7786e3ac7611..8c3862b4c259 100644
@@ -142,7 +142,7 @@ SECTIONS
  #endif
 
  	.data.rel.ro : AT(ADDR(.data.rel.ro) - LOAD_OFFSET) {
-		*(.data.rel.ro*)
+		*(.data.rel.ro .data.rel.ro.*)
  	}
 
  	.branch_lt : AT(ADDR(.branch_lt) - LOAD_OFFSET) {