All of lore.kernel.org
 help / color / mirror / Atom feed
* stackprotector: ascii armor the stack canary
@ 2017-05-19 21:26 ` riel at redhat.com
  0 siblings, 0 replies; 36+ messages in thread
From: riel @ 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] 36+ messages in thread
* [kernel-hardening] [PATCH v2 0/5] stackprotector: ascii armor the stack canary
@ 2017-05-24 15:57 riel
  2017-05-24 15:57   ` [PATCH 1/5] random, stackprotect: " riel at redhat.com
  0 siblings, 1 reply; 36+ messages in thread
From: riel @ 2017-05-24 15:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: danielmicay, tytso, keescook, hpa, luto, mingo, x86,
	linux-arm-kernel, catalin.marinas, linux-sh, ysato,
	kernel-hardening

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] 36+ messages in thread

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

Thread overview: 36+ 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
2017-05-19 21:26 ` riel
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
2017-05-19 21:26   ` riel
2017-05-19 21:26   ` [PATCH 1/5] random, stackprotect: " riel at redhat.com
2017-05-24  8:30   ` [PATCH 1/5] random,stackprotect: " Ingo Molnar
2017-05-24  8:30     ` Ingo Molnar
2017-05-24  8:30     ` Ingo Molnar
2017-05-19 21:26 ` [PATCH 2/5] fork,random: use get_random_canary to set tsk->stack_canary riel
2017-05-19 21:26   ` riel
2017-05-19 21:26   ` [PATCH 2/5] fork, random: " riel at redhat.com
2017-05-19 21:26 ` [PATCH 3/5] x86: ascii armor the x86_64 boot init stack canary riel
2017-05-19 21:26   ` riel
2017-05-19 21:26   ` riel at redhat.com
2017-05-19 21:26 ` [PATCH 4/5] arm64: ascii armor the arm64 " riel
2017-05-19 21:26   ` riel
2017-05-19 21:26   ` riel at redhat.com
2017-05-19 21:26 ` [PATCH 5/5] sh64: ascii armor the sh64 " riel
2017-05-19 21:26   ` riel
2017-05-19 21:26   ` riel at redhat.com
2017-05-19 21:32 ` stackprotector: ascii armor the " Kees Cook
2017-05-19 21:32   ` Kees Cook
2017-05-19 21:32   ` Kees Cook
2017-05-24 11:57   ` Geert Uytterhoeven
2017-05-24 11:57     ` Geert Uytterhoeven
2017-05-24 11:57     ` Geert Uytterhoeven
2017-05-19 23:57 ` Daniel Micay
2017-05-19 23:57   ` Daniel Micay
2017-05-19 23:57   ` Daniel Micay
  -- strict thread matches above, loose matches on Subject: below --
2017-05-24 15:57 [kernel-hardening] [PATCH v2 0/5] " riel
2017-05-24 15:57 ` [PATCH 1/5] random,stackprotect: introduce get_random_canary function riel
2017-05-24 15:57   ` riel
2017-05-24 15:57   ` [PATCH 1/5] random, stackprotect: " riel at redhat.com
2017-05-24 16:15   ` [PATCH 1/5] random,stackprotect: " Kees Cook
2017-05-24 16:15     ` Kees Cook
2017-05-24 16:15     ` [PATCH 1/5] random, stackprotect: " Kees Cook

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.