All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: Preventing READ_IMPLIES_EXEC propagation
       [not found] <1493102296-229934-1-git-send-email-zhangshaokun@hisilicon.com>
@ 2017-04-25  6:11   ` dongbo (E)
  0 siblings, 0 replies; 4+ messages in thread
From: dongbo (E) @ 2017-04-25  6:11 UTC (permalink / raw)
  To: catalin.marinas, Will Deacon; +Cc: arm-mail-list, linux-kernel, Linuxarm

From: Dong Bo <dongbo4@huawei.com>

Once the READ_IMPLIES_EXEC flag is set on arm64, the flag is
propagated to its child processes, even the ELF files are
marked as not requiring executable stack.

Signed-off-by: Dong Bo <dongbo4@huawei.com>
---
 arch/arm64/include/asm/elf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index 5d17004..5941e7f 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -142,6 +142,7 @@
 ({									\
 	clear_bit(TIF_32BIT, &current->mm->context.flags);		\
 	clear_thread_flag(TIF_32BIT);					\
+	current->personality &= ~READ_IMPLIES_EXEC;			\
 })
  /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
-- 
1.9.1

.

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

* [PATCH] arm64: Preventing READ_IMPLIES_EXEC propagation
@ 2017-04-25  6:11   ` dongbo (E)
  0 siblings, 0 replies; 4+ messages in thread
From: dongbo (E) @ 2017-04-25  6:11 UTC (permalink / raw)
  To: linux-arm-kernel

From: Dong Bo <dongbo4@huawei.com>

Once the READ_IMPLIES_EXEC flag is set on arm64, the flag is
propagated to its child processes, even the ELF files are
marked as not requiring executable stack.

Signed-off-by: Dong Bo <dongbo4@huawei.com>
---
 arch/arm64/include/asm/elf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index 5d17004..5941e7f 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -142,6 +142,7 @@
 ({									\
 	clear_bit(TIF_32BIT, &current->mm->context.flags);		\
 	clear_thread_flag(TIF_32BIT);					\
+	current->personality &= ~READ_IMPLIES_EXEC;			\
 })
  /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
-- 
1.9.1

.

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

* Re: [PATCH] arm64: Preventing READ_IMPLIES_EXEC propagation
  2017-04-25  6:11   ` dongbo (E)
@ 2017-04-25 16:53     ` Will Deacon
  -1 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2017-04-25 16:53 UTC (permalink / raw)
  To: dongbo (E); +Cc: catalin.marinas, arm-mail-list, linux-kernel, Linuxarm

On Tue, Apr 25, 2017 at 02:11:29PM +0800, dongbo (E) wrote:
> From: Dong Bo <dongbo4@huawei.com>
> 
> Once the READ_IMPLIES_EXEC flag is set on arm64, the flag is
> propagated to its child processes, even the ELF files are
> marked as not requiring executable stack.
> 
> Signed-off-by: Dong Bo <dongbo4@huawei.com>
> ---
>  arch/arm64/include/asm/elf.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
> index 5d17004..5941e7f 100644
> --- a/arch/arm64/include/asm/elf.h
> +++ b/arch/arm64/include/asm/elf.h
> @@ -142,6 +142,7 @@
>  ({									\
>  	clear_bit(TIF_32BIT, &current->mm->context.flags);		\
>  	clear_thread_flag(TIF_32BIT);					\
> +	current->personality &= ~READ_IMPLIES_EXEC;			\
>  })
>   /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */

This looks good to me:

Acked-by: Will Deacon <will.deacon@arm.com>

We might also want a comment in the compat code to say that we inherit
the flag to follow the arch/arm/ behaviour.

Anyway, I'd like to see this sit in -next for a bit, so would rather hold
this off until 4.12.

Will

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

* [PATCH] arm64: Preventing READ_IMPLIES_EXEC propagation
@ 2017-04-25 16:53     ` Will Deacon
  0 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2017-04-25 16:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 25, 2017 at 02:11:29PM +0800, dongbo (E) wrote:
> From: Dong Bo <dongbo4@huawei.com>
> 
> Once the READ_IMPLIES_EXEC flag is set on arm64, the flag is
> propagated to its child processes, even the ELF files are
> marked as not requiring executable stack.
> 
> Signed-off-by: Dong Bo <dongbo4@huawei.com>
> ---
>  arch/arm64/include/asm/elf.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
> index 5d17004..5941e7f 100644
> --- a/arch/arm64/include/asm/elf.h
> +++ b/arch/arm64/include/asm/elf.h
> @@ -142,6 +142,7 @@
>  ({									\
>  	clear_bit(TIF_32BIT, &current->mm->context.flags);		\
>  	clear_thread_flag(TIF_32BIT);					\
> +	current->personality &= ~READ_IMPLIES_EXEC;			\
>  })
>   /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */

This looks good to me:

Acked-by: Will Deacon <will.deacon@arm.com>

We might also want a comment in the compat code to say that we inherit
the flag to follow the arch/arm/ behaviour.

Anyway, I'd like to see this sit in -next for a bit, so would rather hold
this off until 4.12.

Will

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

end of thread, other threads:[~2017-04-25 16:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1493102296-229934-1-git-send-email-zhangshaokun@hisilicon.com>
2017-04-25  6:11 ` [PATCH] arm64: Preventing READ_IMPLIES_EXEC propagation dongbo (E)
2017-04-25  6:11   ` dongbo (E)
2017-04-25 16:53   ` Will Deacon
2017-04-25 16:53     ` Will Deacon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.