LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix writable sections being moved into the rodata region
@ 2022-11-16  4:39 Nicholas Piggin
  2022-11-16  7:35 ` Christophe Leroy
  2022-11-20  1:31 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Nicholas Piggin @ 2022-11-16  4:39 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nicholas Piggin

.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")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/kernel/vmlinux.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 7786e3ac7611..8c3862b4c259 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -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) {
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: Fix writable sections being moved into the rodata region
  2022-11-16  4:39 [PATCH] powerpc: Fix writable sections being moved into the rodata region Nicholas Piggin
@ 2022-11-16  7:35 ` Christophe Leroy
  2022-11-20  1:31 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Christophe Leroy @ 2022-11-16  7:35 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev@lists.ozlabs.org



Le 16/11/2022 à 05:39, Nicholas Piggin a écrit :
> .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")
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

> ---
>   arch/powerpc/kernel/vmlinux.lds.S | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
> index 7786e3ac7611..8c3862b4c259 100644
> --- a/arch/powerpc/kernel/vmlinux.lds.S
> +++ b/arch/powerpc/kernel/vmlinux.lds.S
> @@ -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) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: Fix writable sections being moved into the rodata region
  2022-11-16  4:39 [PATCH] powerpc: Fix writable sections being moved into the rodata region Nicholas Piggin
  2022-11-16  7:35 ` Christophe Leroy
@ 2022-11-20  1:31 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2022-11-20  1:31 UTC (permalink / raw)
  To: linuxppc-dev, Nicholas Piggin

On Wed, 16 Nov 2022 14:39:53 +1000, Nicholas Piggin wrote:
> .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...
> 
> 

Applied to powerpc/fixes.

[1/1] powerpc: Fix writable sections being moved into the rodata region
      https://git.kernel.org/powerpc/c/eb761a1760bf30cf64e98ee8d914866e62ec9e8a

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-20  1:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-16  4:39 [PATCH] powerpc: Fix writable sections being moved into the rodata region Nicholas Piggin
2022-11-16  7:35 ` Christophe Leroy
2022-11-20  1:31 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox