Files
agnos-kernel-sdm845/include/linux
Rik van Riel 5d8ff1e598 random,stackprotect: introduce get_random_canary function
Patch series "stackprotector: ascii armor the stack canary", v2.

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/

This patch (of 5):

Introduce get_random_canary(), which provides a random unsigned long
canary value with the first byte zeroed out on 64 bit architectures, in
order to mitigate non-terminated 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 the old execshield patches, and
Daniel Micay's linux-hardened tree.

Change-Id: Ie16a7ac0e46aa4b97866bfbdfbaa3ae96ca401f2
Link: http://lkml.kernel.org/r/20170524155751.424-2-riel@redhat.com
Signed-off-by: Rik van Riel <riel@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Daniel Micay <danielmicay@gmail.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-commit: 022c204040f3fd22d6445bc35517786195b7ae80
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
2017-08-04 16:32:00 -07:00
..
2016-11-11 23:23:02 +01:00
2017-02-09 11:08:17 -08:00
2017-03-22 12:43:35 +01:00
2016-10-07 18:46:30 -07:00
2017-05-14 14:00:22 +02:00
2017-07-12 15:01:02 +02:00
2017-06-14 16:42:56 +02:00
2017-07-20 11:14:56 +05:30
2017-07-20 11:14:56 +05:30
2017-05-11 13:26:42 -07:00
2016-10-20 15:51:28 +11:00
2016-11-03 12:43:03 -07:00
2017-02-09 11:08:19 -08:00
2017-07-04 18:25:31 +05:30
2017-01-31 13:55:27 -08:00
2017-01-18 11:01:17 -07:00
2017-04-17 17:46:09 -07:00
2016-10-19 11:36:22 -06:00
2017-07-20 11:14:57 +05:30
2017-02-15 17:40:08 -08:00
2016-10-14 11:36:59 -07:00
2017-07-20 11:14:45 +05:30
2016-11-11 17:31:37 -08:00
2017-01-17 18:25:21 -08:00
2017-07-31 14:14:29 -07:00
2017-01-13 14:38:18 -08:00
2017-07-20 11:14:45 +05:30
2017-07-20 11:14:45 +05:30
2017-04-21 09:31:21 +02:00
2017-02-28 13:57:52 -08:00
2017-07-20 11:14:56 +05:30
2017-07-27 11:18:17 +05:30