* [PATCH] powerpc: ppc32 needs elf_read_implies_exec()
@ 2009-04-17 18:03 Kumar Gala
2009-04-17 18:16 ` Kumar Gala
0 siblings, 1 reply; 2+ messages in thread
From: Kumar Gala @ 2009-04-17 18:03 UTC (permalink / raw)
To: linuxppc-dev, Paul Mackerras, Benjamin Herrenschmidt
On ppc64 we implemented elf_read_implies_exec() for 32-bit binaries
because old toolchains had bugs with regards to marking PHDRs as
executable that needed to be. For some reason we didn't do this on
ppc32 builds. This hadn't been an issue until recent changes to I$/D$
handling that impacted the per-page exec handling on embedded PPC.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
arch/powerpc/include/asm/elf.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
index 1a856b1..b6ada56 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -259,6 +259,7 @@ do { \
(exec_stk != EXSTACK_DISABLE_X) : 0)
#else
# define SET_PERSONALITY(ex) set_personality(PER_LINUX)
+# define elf_read_implies_exec(ex, exec_stk) (exec_stk != EXSTACK_DISABLE_X)
#endif /* __powerpc64__ */
extern int dcache_bsize;
--
1.6.0.6
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] powerpc: ppc32 needs elf_read_implies_exec()
2009-04-17 18:03 [PATCH] powerpc: ppc32 needs elf_read_implies_exec() Kumar Gala
@ 2009-04-17 18:16 ` Kumar Gala
0 siblings, 0 replies; 2+ messages in thread
From: Kumar Gala @ 2009-04-17 18:16 UTC (permalink / raw)
To: Paul Mackerras, Benjamin Herrenschmidt, Alan Modra
Cc: Linuxppc-dev Development
On Apr 17, 2009, at 1:03 PM, Kumar Gala wrote:
> On ppc64 we implemented elf_read_implies_exec() for 32-bit binaries
> because old toolchains had bugs with regards to marking PHDRs as
> executable that needed to be. For some reason we didn't do this on
> ppc32 builds. This hadn't been an issue until recent changes to I$/D$
> handling that impacted the per-page exec handling on embedded PPC.
>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> arch/powerpc/include/asm/elf.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/
> asm/elf.h
> index 1a856b1..b6ada56 100644
> --- a/arch/powerpc/include/asm/elf.h
> +++ b/arch/powerpc/include/asm/elf.h
> @@ -259,6 +259,7 @@ do { \
> (exec_stk != EXSTACK_DISABLE_X) : 0)
> #else
> # define SET_PERSONALITY(ex) set_personality(PER_LINUX)
> +# define elf_read_implies_exec(ex, exec_stk) (exec_stk !=
> EXSTACK_DISABLE_X)
> #endif /* __powerpc64__ */
>
> extern int dcache_bsize;
> --
> 1.6.0.6
I just want to make sure I understand the implications of this
change. It seems to me that we will not be able to support stack exec
perms on any ppc32 part that has per-page exec support. Is that correct?
I'm wondering if we are too generous in the check, exec_stk can be:
EXSTACK_DEFAULT
EXSTACK_DISABLE_X
EXSTACK_ENABLE_X
It seems like EXSTACK_DISABLE_X/EXSTACK_ENABLE_X are only set if
p_type == PT_GNU_STACK. Do we think toolchains existed that set
p_type to PT_GNU_STACK that don't set PF_X properly?
My thinking is elf_read_implies_exec() should be changed to:
# define elf_read_implies_exec(ex, exec_stk) (exec_stk ==
EXSTACK_DEFAULT)
- k
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-04-17 18:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-17 18:03 [PATCH] powerpc: ppc32 needs elf_read_implies_exec() Kumar Gala
2009-04-17 18:16 ` Kumar Gala
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox