android_kernel_sony_sdm845/include
Repository files (latest commit first)
Filename Latest commit message Latest commit date
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
..
acpi
asm-generic
clocksource
crypto Merge remote-tracking branch '4.9/tmp-a2659b2' into 4.9 2017-04-21 18:12:33 -07:00
drm Merge "drm/msm: add support for parsing YUV 420 deep color" 2017-07-09 06:50:25 -07:00
dt-bindings Merge "clk: qcom: gcc-sdm845: Reflect updates to the GCC clock frequency plan" 2017-07-27 20:10:37 -07:00
keys
kvm
linux random,stackprotect: introduce get_random_canary function 2017-08-04 16:32:00 -07:00
math-emu
media msm: vidc: Fix buffer requirement negotiations 2017-06-26 14:45:12 -07:00
memory
misc
net Merge "cfg80211: Add macros to indicate backport support for FILS" 2017-08-02 17:37:38 -07:00
pcmcia
ras
rdma
rxrpc
scsi Merge remote-tracking branch '4.9/tmp-9ae2c67' into 4.9 2017-07-28 16:52:35 -07:00
soc Merge "soc: qcom: secure_buffer: Remove deprecated functions" 2017-08-03 00:38:05 -07:00
sound Revert "ASoC: dapm: mark dapm_kcontrol_get_wlist as global function" 2017-07-23 21:50:17 -07:00
target iscsi-target: Add login_keys_workaround attribute for non RFC initiators 2017-07-27 15:07:59 -07:00
trace sched: remove "hmp" references in the code 2017-07-29 06:49:36 +05:30
uapi Merge "UPSTREAM: Merge remote-tracking branch 'quic/dev/msm-4.9-camx' into msm-4.9" 2017-08-03 00:38:14 -07:00
video
xen xen: Revert commits da72ff5bfcb0 and 72a9b18629 2017-05-14 14:00:22 +02:00
Kbuild