Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH] use get_random_long for the per-task stack canary
@ 2017-05-04 13:32 Daniel Micay
  2017-05-04 13:33 ` Arjan van de Ven
  2017-05-04 14:04 ` [kernel-hardening] " Rik van Riel
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Micay @ 2017-05-04 13:32 UTC (permalink / raw)
  To: Kees Cook, Arjan van Ven, Ingo Molnar, kernel-hardening, LKML
  Cc: Daniel Micay, stable

The stack canary is an unsigned long and should be fully initialized to
random data rather than only 32 bits of random data.

Cc: stable@vger.kernel.org
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
---
 kernel/fork.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 56d85fd81411..ff84ff82f56a 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -537,7 +537,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
 	set_task_stack_end_magic(tsk);
 
 #ifdef CONFIG_CC_STACKPROTECTOR
-	tsk->stack_canary = get_random_int();
+	tsk->stack_canary = get_random_long();
 #endif
 
 	/*
-- 
2.12.2

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

* Re: [PATCH] use get_random_long for the per-task stack canary
  2017-05-04 13:32 [PATCH] use get_random_long for the per-task stack canary Daniel Micay
@ 2017-05-04 13:33 ` Arjan van de Ven
  2017-05-04 14:04 ` [kernel-hardening] " Rik van Riel
  1 sibling, 0 replies; 3+ messages in thread
From: Arjan van de Ven @ 2017-05-04 13:33 UTC (permalink / raw)
  To: Daniel Micay, Kees Cook, Ingo Molnar, kernel-hardening, LKML; +Cc: stable

On 5/4/2017 6:32 AM, Daniel Micay wrote:
> The stack canary is an unsigned long and should be fully initialized to
> random data rather than only 32 bits of random data.

that makes sense to me... ack

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

* Re: [kernel-hardening] [PATCH] use get_random_long for the per-task stack canary
  2017-05-04 13:32 [PATCH] use get_random_long for the per-task stack canary Daniel Micay
  2017-05-04 13:33 ` Arjan van de Ven
@ 2017-05-04 14:04 ` Rik van Riel
  1 sibling, 0 replies; 3+ messages in thread
From: Rik van Riel @ 2017-05-04 14:04 UTC (permalink / raw)
  To: Daniel Micay, Kees Cook, Arjan van Ven, Ingo Molnar,
	kernel-hardening, LKML
  Cc: stable

On Thu, 2017-05-04 at 09:32 -0400, Daniel Micay wrote:
> The stack canary is an unsigned long and should be fully initialized
> to
> random data rather than only 32 bits of random data.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Daniel Micay <danielmicay@gmail.com>
> 
Acked-by: Rik van Riel <riel@redhat.com>

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

end of thread, other threads:[~2017-05-04 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-04 13:32 [PATCH] use get_random_long for the per-task stack canary Daniel Micay
2017-05-04 13:33 ` Arjan van de Ven
2017-05-04 14:04 ` [kernel-hardening] " Rik van Riel

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