Linux-csky Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] riscv: Enable ELF-ASLR for riscv
@ 2020-07-09  4:38 guoren
  2020-07-09  5:32 ` Alex Ghiti
  0 siblings, 1 reply; 3+ messages in thread
From: guoren @ 2020-07-09  4:38 UTC (permalink / raw)
  To: palmerdabbelt, paul.walmsley, anup, greentime.hu, zong.li, me,
	bjorn.topel, atish.patra
  Cc: linux-riscv, linux-kernel, linux-csky, guoren, Guo Ren, Greentime Hu

From: Guo Ren <guoren@linux.alibaba.com>

Let riscv enable randomizes the stack, heap and binary images of
ELF binaries. Seems it's ok at all after qemu & chip test and
there is no founded side effect.

So just simply select ARCH_HAS_ELF_RANDOMIZE :)

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Palmer Dabbelt <palmerdabbelt@google.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Zong Li <zong.li@sifive.com>
Cc: Greentime Hu <green.hu@gmail.com>
---
 arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 91bfc6c..eed6647 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -20,6 +20,7 @@ config RISCV
 	select ARCH_HAS_GIGANTIC_PAGE
 	select ARCH_HAS_MMIOWB
 	select ARCH_HAS_PTE_SPECIAL
+	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_SET_DIRECT_MAP
 	select ARCH_HAS_SET_MEMORY
 	select ARCH_HAS_STRICT_KERNEL_RWX if MMU
-- 
2.7.4


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

* Re: [PATCH] riscv: Enable ELF-ASLR for riscv
  2020-07-09  4:38 [PATCH] riscv: Enable ELF-ASLR for riscv guoren
@ 2020-07-09  5:32 ` Alex Ghiti
  2020-07-09  7:59   ` Guo Ren
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Ghiti @ 2020-07-09  5:32 UTC (permalink / raw)
  To: guoren, palmerdabbelt, paul.walmsley, anup, greentime.hu,
	zong.li, me, bjorn.topel, atish.patra
  Cc: Guo Ren, linux-kernel, linux-csky, Greentime Hu, linux-riscv

Hi Guo,

Le 7/9/20 à 12:38 AM, guoren@kernel.org a écrit :
> From: Guo Ren <guoren@linux.alibaba.com>
> 
> Let riscv enable randomizes the stack, heap and binary images of
> ELF binaries. Seems it's ok at all after qemu & chip test and
> there is no founded side effect.
> 
> So just simply select ARCH_HAS_ELF_RANDOMIZE :)
> 
> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> Cc: Palmer Dabbelt <palmerdabbelt@google.com>
> Cc: Paul Walmsley <paul.walmsley@sifive.com>
> Cc: Zong Li <zong.li@sifive.com>
> Cc: Greentime Hu <green.hu@gmail.com>
> ---
>   arch/riscv/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 91bfc6c..eed6647 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -20,6 +20,7 @@ config RISCV
>   	select ARCH_HAS_GIGANTIC_PAGE
>   	select ARCH_HAS_MMIOWB
>   	select ARCH_HAS_PTE_SPECIAL
> +	select ARCH_HAS_ELF_RANDOMIZE
>   	select ARCH_HAS_SET_DIRECT_MAP
>   	select ARCH_HAS_SET_MEMORY
>   	select ARCH_HAS_STRICT_KERNEL_RWX if MMU
> 

Actually it is already the case: ARCH_HAS_ELF_RANDOMIZE is already 
selected by ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT.

Thanks,

Alex

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

* Re: [PATCH] riscv: Enable ELF-ASLR for riscv
  2020-07-09  5:32 ` Alex Ghiti
@ 2020-07-09  7:59   ` Guo Ren
  0 siblings, 0 replies; 3+ messages in thread
From: Guo Ren @ 2020-07-09  7:59 UTC (permalink / raw)
  To: Alex Ghiti
  Cc: Palmer Dabbelt, Paul Walmsley, Anup Patel, Greentime Hu, Zong Li,
	Patrick Stählin, Björn Töpel, Atish Patra,
	Guo Ren, Linux Kernel Mailing List, linux-csky, Greentime Hu,
	linux-riscv

On Thu, Jul 9, 2020 at 1:32 PM Alex Ghiti <alex@ghiti.fr> wrote:
>
> Hi Guo,
>
> Le 7/9/20 à 12:38 AM, guoren@kernel.org a écrit :
> > From: Guo Ren <guoren@linux.alibaba.com>
> >
> > Let riscv enable randomizes the stack, heap and binary images of
> > ELF binaries. Seems it's ok at all after qemu & chip test and
> > there is no founded side effect.
> >
> > So just simply select ARCH_HAS_ELF_RANDOMIZE :)
> >
> > Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> > Cc: Palmer Dabbelt <palmerdabbelt@google.com>
> > Cc: Paul Walmsley <paul.walmsley@sifive.com>
> > Cc: Zong Li <zong.li@sifive.com>
> > Cc: Greentime Hu <green.hu@gmail.com>
> > ---
> >   arch/riscv/Kconfig | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > index 91bfc6c..eed6647 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -20,6 +20,7 @@ config RISCV
> >       select ARCH_HAS_GIGANTIC_PAGE
> >       select ARCH_HAS_MMIOWB
> >       select ARCH_HAS_PTE_SPECIAL
> > +     select ARCH_HAS_ELF_RANDOMIZE
> >       select ARCH_HAS_SET_DIRECT_MAP
> >       select ARCH_HAS_SET_MEMORY
> >       select ARCH_HAS_STRICT_KERNEL_RWX if MMU
> >
>
> Actually it is already the case: ARCH_HAS_ELF_RANDOMIZE is already
> selected by ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT.
Oops :P, Thx for correcting, abandon the patch.

-- 
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09  4:38 [PATCH] riscv: Enable ELF-ASLR for riscv guoren
2020-07-09  5:32 ` Alex Ghiti
2020-07-09  7:59   ` Guo Ren

Linux-csky Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-csky/0 linux-csky/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-csky linux-csky/ https://lore.kernel.org/linux-csky \
		linux-csky@vger.kernel.org
	public-inbox-index linux-csky

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-csky


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git