linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* stackprotector: ascii armor the stack canary
@ 2017-05-19 21:26 riel at redhat.com
  2017-05-19 21:26 ` [PATCH 1/5] random, stackprotect: introduce get_random_canary function riel at redhat.com
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: riel at redhat.com @ 2017-05-19 21:26 UTC (permalink / raw)
  To: linux-arm-kernel

Zero out the first byte of the stack canary value on 64 bit systems,
in order to prevent unterminated C string overflows from being able
to successfully overwrite the canary, even if an attacker somehow
guessed or obtained the canary value.

Inspired by execshield ascii-armor and PaX/grsecurity.

Thanks to Daniel Micay for extracting code of similar functionality
from PaX/grsecurity and making it easy to find in his linux-hardened
git tree on https://github.com/thestinger/linux-hardened/

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH v2 0/5] stackprotector: ascii armor the stack canary
@ 2017-05-24 15:57 riel at redhat.com
  2017-05-24 15:57 ` [PATCH 1/5] random, stackprotect: introduce get_random_canary function riel at redhat.com
  0 siblings, 1 reply; 12+ messages in thread
From: riel at redhat.com @ 2017-05-24 15:57 UTC (permalink / raw)
  To: linux-arm-kernel

Zero out the first byte of the stack canary value on 64 bit systems,
in order to mitigate unterminated C string overflows.

The null byte both prevents C string functions from reading the
canary, and from writing it if the canary value were guessed or
obtained through some other means.
    
Reducing the entropy by 8 bits is acceptable on 64-bit systems,
which will still have 56 bits of entropy left, but not on 32
bit systems, so the "ascii armor" canary is only implemented on
64-bit systems.

Inspired by the "ascii armor" code in execshield and Daniel Micay's
linux-hardened tree.

Also see https://github.com/thestinger/linux-hardened/

v2:
 - improve changelogs
 - address Ingo's coding style comments

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

end of thread, other threads:[~2017-05-24 16:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 21:26 stackprotector: ascii armor the stack canary riel at redhat.com
2017-05-19 21:26 ` [PATCH 1/5] random, stackprotect: introduce get_random_canary function riel at redhat.com
2017-05-24  8:30   ` [PATCH 1/5] random,stackprotect: " Ingo Molnar
2017-05-19 21:26 ` [PATCH 2/5] fork, random: use get_random_canary to set tsk->stack_canary riel at redhat.com
2017-05-19 21:26 ` [PATCH 3/5] x86: ascii armor the x86_64 boot init stack canary riel at redhat.com
2017-05-19 21:26 ` [PATCH 4/5] arm64: ascii armor the arm64 " riel at redhat.com
2017-05-19 21:26 ` [PATCH 5/5] sh64: ascii armor the sh64 " riel at redhat.com
2017-05-19 21:32 ` stackprotector: ascii armor the " Kees Cook
2017-05-24 11:57   ` Geert Uytterhoeven
2017-05-19 23:57 ` Daniel Micay
2017-05-24 15:57 [PATCH v2 0/5] " 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

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).