linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: keescook@google.com (Kees Cook)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] sh64: ascii armor the sh64 boot init stack canary
Date: Wed, 24 May 2017 09:35:38 -0700	[thread overview]
Message-ID: <CAGXu5jJafqLN7b7kPYYsY8pP1tig8O8TsFkWvWeHG5mT3Gz1rw@mail.gmail.com> (raw)
In-Reply-To: <20170524123446.78510066@annuminas.surriel.com>

On Wed, May 24, 2017 at 9:34 AM, Rik van Riel <riel@redhat.com> wrote:
> Use the ascii-armor canary to prevent unterminated C string overflows
> from being able to successfully overwrite the canary, even if they
> somehow obtain the canary value.
>
> Inspired by execshield ascii-armor and Daniel Micay's linux-hardened tree.
>
> Signed-off-by: Rik van Riel <riel@redhat.com>

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  arch/sh/include/asm/stackprotector.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/sh/include/asm/stackprotector.h b/arch/sh/include/asm/stackprotector.h
> index d9df3a76847c..141515a43b78 100644
> --- a/arch/sh/include/asm/stackprotector.h
> +++ b/arch/sh/include/asm/stackprotector.h
> @@ -19,6 +19,7 @@ static __always_inline void boot_init_stack_canary(void)
>         /* Try to get a semi random initial value. */
>         get_random_bytes(&canary, sizeof(canary));
>         canary ^= LINUX_VERSION_CODE;
> +       canary &= CANARY_MASK;
>
>         current->stack_canary = canary;
>         __stack_chk_guard = current->stack_canary;
>



-- 
Kees Cook
Pixel Security

  reply	other threads:[~2017-05-24 16:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-24 15:57 [PATCH v2 0/5] stackprotector: ascii armor the stack canary riel at redhat.com
2017-05-24 15:57 ` [PATCH 1/5] random, stackprotect: introduce get_random_canary function riel at redhat.com
2017-05-24 16:15   ` Kees Cook
2017-05-24 15:57 ` [PATCH 2/5] fork, random: use get_random_canary to set tsk->stack_canary riel at redhat.com
2017-05-24 16:16   ` Kees Cook
2017-05-24 15:57 ` [PATCH 3/5] x86: ascii armor the x86_64 boot init stack canary riel at redhat.com
2017-05-24 16:16   ` Kees Cook
2017-05-24 15:57 ` [PATCH 4/5] arm64: ascii armor the arm64 " riel at redhat.com
2017-05-24 16:16   ` Kees Cook
2017-05-24 15:57 ` [PATCH 5/5] sh64: ascii armor the sh64 " riel at redhat.com
2017-05-24 16:34 ` Rik van Riel
2017-05-24 16:35   ` Kees Cook [this message]
2017-09-19 17:16 ` [kernel-hardening] [PATCH v2 0/5] stackprotector: ascii armor the " Solar Designer
2017-09-19 20:22   ` Kees Cook
2017-09-19 21:10   ` Daniel Micay
2017-09-20 11:18   ` Yann Droneaud
2017-09-20 15:03     ` Solar Designer
  -- strict thread matches above, loose matches on Subject: below --
2017-05-19 21:26 riel at redhat.com
2017-05-19 21:26 ` [PATCH 5/5] sh64: ascii armor the sh64 boot init " riel at redhat.com

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=CAGXu5jJafqLN7b7kPYYsY8pP1tig8O8TsFkWvWeHG5mT3Gz1rw@mail.gmail.com \
    --to=keescook@google.com \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).