diff mbox

[3.18,01/33] Revert "stackprotector: Increase the per-task stack canarys random range from 32 bits to 64 bits on 64-bit platforms"

Message ID 20170605153021.008595891@linuxfoundation.org (mailing list archive)
State New, archived
Headers show

Commit Message

Greg Kroah-Hartman June 5, 2017, 4:16 p.m. UTC
3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

This reverts commit 609a3e81550b0b4ea87197b0f59455a7bcff975a which is
commit 5ea30e4e58040cfd6434c2f33dc3ea76e2c15b05 upstream.

It shouldn't have been backported to 3.18, as we do not have
get_random_long() in that kernel tree.

Reported-by: Philip Müller <philm@manjaro.org>
Cc: Daniel Micay <danielmicay@gmail.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Arjan van Ven <arjan@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kernel-hardening@lists.openwall.com
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/fork.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kees Cook June 5, 2017, 7:13 p.m. UTC | #1
On Mon, Jun 5, 2017 at 9:16 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> 3.18-stable review patch.  If anyone has any objections, please let me know.
>
> ------------------
>
> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> This reverts commit 609a3e81550b0b4ea87197b0f59455a7bcff975a which is
> commit 5ea30e4e58040cfd6434c2f33dc3ea76e2c15b05 upstream.
>
> It shouldn't have been backported to 3.18, as we do not have
> get_random_long() in that kernel tree.

It should be possible to trivially backport
ec9ee4acd97c0039a61c0ae4f12705767ae62153 to gain get_random_long().

-Kees

>
> Reported-by: Philip Müller <philm@manjaro.org>
> Cc: Daniel Micay <danielmicay@gmail.com>
> Cc: Arjan van de Ven <arjan@linux.intel.com>
> Cc: Rik van Riel <riel@redhat.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Arjan van Ven <arjan@linux.intel.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: kernel-hardening@lists.openwall.com
> Cc: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
>  kernel/fork.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -338,7 +338,7 @@ static struct task_struct *dup_task_stru
>         set_task_stack_end_magic(tsk);
>
>  #ifdef CONFIG_CC_STACKPROTECTOR
> -       tsk->stack_canary = get_random_long();
> +       tsk->stack_canary = get_random_int();
>  #endif
>
>         /*
>
>
Eric Biggers June 5, 2017, 8:06 p.m. UTC | #2
On Mon, Jun 05, 2017 at 12:13:11PM -0700, Kees Cook wrote:
> On Mon, Jun 5, 2017 at 9:16 AM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > 3.18-stable review patch.  If anyone has any objections, please let me know.
> >
> > ------------------
> >
> > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >
> > This reverts commit 609a3e81550b0b4ea87197b0f59455a7bcff975a which is
> > commit 5ea30e4e58040cfd6434c2f33dc3ea76e2c15b05 upstream.
> >
> > It shouldn't have been backported to 3.18, as we do not have
> > get_random_long() in that kernel tree.
> 
> It should be possible to trivially backport
> ec9ee4acd97c0039a61c0ae4f12705767ae62153 to gain get_random_long().
> 
> -Kees

If that's done it may be a good idea to take
b1132deac01c2332d234fa821a70022796b79182 as well, which fixed an alignment bug
in get_random_long().

Eric
Greg Kroah-Hartman June 6, 2017, 7:21 a.m. UTC | #3
On Mon, Jun 05, 2017 at 01:06:52PM -0700, Eric Biggers wrote:
> On Mon, Jun 05, 2017 at 12:13:11PM -0700, Kees Cook wrote:
> > On Mon, Jun 5, 2017 at 9:16 AM, Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > > 3.18-stable review patch.  If anyone has any objections, please let me know.
> > >
> > > ------------------
> > >
> > > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > >
> > > This reverts commit 609a3e81550b0b4ea87197b0f59455a7bcff975a which is
> > > commit 5ea30e4e58040cfd6434c2f33dc3ea76e2c15b05 upstream.
> > >
> > > It shouldn't have been backported to 3.18, as we do not have
> > > get_random_long() in that kernel tree.
> > 
> > It should be possible to trivially backport
> > ec9ee4acd97c0039a61c0ae4f12705767ae62153 to gain get_random_long().
> > 
> > -Kees
> 
> If that's done it may be a good idea to take
> b1132deac01c2332d234fa821a70022796b79182 as well, which fixed an alignment bug
> in get_random_long().

Good idea for both of these, I'll do that in the next round of releases.

thanks,

greg k-h
diff mbox

Patch

--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -338,7 +338,7 @@  static struct task_struct *dup_task_stru
 	set_task_stack_end_magic(tsk);
 
 #ifdef CONFIG_CC_STACKPROTECTOR
-	tsk->stack_canary = get_random_long();
+	tsk->stack_canary = get_random_int();
 #endif
 
 	/*