All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Micay <danielmicay@gmail.com>
To: Kees Cook <keescook@chromium.org>,
	Arjan van Ven <arjan@linux.intel.com>,
	Ingo Molnar <mingo@elte.hu>,
	kernel-hardening@lists.openwall.com,
	LKML <linux-kernel@vger.kernel.org>
Cc: Daniel Micay <danielmicay@gmail.com>, stable@vger.kernel.org
Subject: [kernel-hardening] [PATCH] use get_random_long for the per-task stack canary
Date: Thu,  4 May 2017 09:32:09 -0400	[thread overview]
Message-ID: <20170504133209.3053-1-danielmicay@gmail.com> (raw)

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

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Micay <danielmicay@gmail.com>
To: Kees Cook <keescook@chromium.org>,
	Arjan van Ven <arjan@linux.intel.com>,
	Ingo Molnar <mingo@elte.hu>,
	kernel-hardening@lists.openwall.com,
	LKML <linux-kernel@vger.kernel.org>
Cc: Daniel Micay <danielmicay@gmail.com>, stable@vger.kernel.org
Subject: [PATCH] use get_random_long for the per-task stack canary
Date: Thu,  4 May 2017 09:32:09 -0400	[thread overview]
Message-ID: <20170504133209.3053-1-danielmicay@gmail.com> (raw)

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

             reply	other threads:[~2017-05-04 13:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 13:32 Daniel Micay [this message]
2017-05-04 13:32 ` [PATCH] use get_random_long for the per-task stack canary Daniel Micay
2017-05-04 13:33 ` [kernel-hardening] " Arjan van de Ven
2017-05-04 13:33   ` Arjan van de Ven
2017-05-04 14:04 ` [kernel-hardening] " Rik van Riel
2017-05-04 14:29   ` Kees Cook
2017-05-05  8:10 ` [tip:core/urgent] stackprotector: Increase the per-task stack canary's random range from 32 bits to 64 bits on 64-bit platforms tip-bot for Daniel Micay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170504133209.3053-1-danielmicay@gmail.com \
    --to=danielmicay@gmail.com \
    --cc=arjan@linux.intel.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.