Linux kernel source tree
Go to file
Kees Cook 90169c0955 UPSTREAM: security: Implement Clang's stack initialization
CONFIG_INIT_STACK_ALL turns on stack initialization based on
-ftrivial-auto-var-init in Clang builds, which has greater coverage
than CONFIG_GCC_PLUGINS_STRUCTLEAK_BYREF_ALL.

-ftrivial-auto-var-init Clang option provides trivial initializers for
uninitialized local variables, variable fields and padding.

It has three possible values:
  pattern - uninitialized locals are filled with a fixed pattern
    (mostly 0xAA on 64-bit platforms, see https://reviews.llvm.org/D54604
    for more details, but 0x000000AA for 32-bit pointers) likely to cause
    crashes when uninitialized value is used;
  zero (it's still debated whether this flag makes it to the official
    Clang release) - uninitialized locals are filled with zeroes;
  uninitialized (default) - uninitialized locals are left intact.

This patch uses only the "pattern" mode when CONFIG_INIT_STACK_ALL is
enabled.

Developers have the possibility to opt-out of this feature on a
per-variable basis by using __attribute__((uninitialized)), but such
use should be well justified in comments.

Change-Id: I3ae7ade50c55fa6b88e8eed23942f09530ceb0e7
Co-developed-by: Alexander Potapenko <glider@google.com>
Signed-off-by: Alexander Potapenko <glider@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Tested-by: Alexander Potapenko <glider@google.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
(cherry picked from commit 709a972efb)
Bug: 133428616
Signed-off-by: Alexander Potapenko <glider@google.com>
2019-06-17 19:26:21 +00:00
arch This is the 4.19.51 stable release 2019-06-15 16:12:59 +02:00
block This is the 4.19.51 stable release 2019-06-15 16:12:59 +02:00
certs export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR() 2018-08-22 23:21:44 +09:00
crypto This is the 4.19.45 stable release 2019-05-22 08:00:39 +02:00
Documentation This is the 4.19.52 stable release 2019-06-17 20:02:56 +02:00
drivers This is the 4.19.51 stable release 2019-06-15 16:12:59 +02:00
firmware kbuild: remove all dummy assignments to obj- 2017-11-18 11:46:06 +09:00
fs This is the 4.19.51 stable release 2019-06-15 16:12:59 +02:00
include This is the 4.19.52 stable release 2019-06-17 20:02:56 +02:00
init This is the 4.19.51 stable release 2019-06-15 16:12:59 +02:00
ipc This is the 4.19.51 stable release 2019-06-15 16:12:59 +02:00
kernel This is the 4.19.51 stable release 2019-06-15 16:12:59 +02:00
lib This is the 4.19.50 stable release 2019-06-11 12:38:58 +02:00
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text 2018-10-18 11:28:50 +02:00
mm This is the 4.19.51 stable release 2019-06-15 16:12:59 +02:00
net This is the 4.19.52 stable release 2019-06-17 20:02:56 +02:00
samples samples: mei: use /dev/mei0 instead of /dev/mei 2019-02-15 08:10:11 +01:00
scripts BACKPORT: security: Create "kernel hardening" config area 2019-06-17 19:26:08 +00:00
security UPSTREAM: security: Implement Clang's stack initialization 2019-06-17 19:26:21 +00:00
sound ALSA: seq: Cover unsubscribe_port() in list_mutex 2019-06-15 11:54:11 +02:00
tools This is the 4.19.51 stable release 2019-06-15 16:12:59 +02:00
usr initramfs: move gen_initramfs_list.sh from scripts/ to usr/ 2018-08-22 23:21:44 +09:00
virt KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID 2019-06-09 09:17:18 +02:00
.clang-format clang-format: Set IndentWrappedFunctionNames false 2018-08-01 18:38:51 +02:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files 2016-10-07 18:46:30 -07:00
.gitignore Kbuild updates for v4.17 (2nd) 2018-04-15 17:21:30 -07:00
.mailmap libnvdimm-for-4.19_misc 2018-08-25 18:13:10 -07:00
build.config.cuttlefish.aarch64 ANDROID: Enable LTO and CFI 2019-05-22 17:25:23 +00:00
build.config.cuttlefish.x86_64 ANDROID: Enable LTO and CFI 2019-05-22 17:25:23 +00:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS 9p: remove Ron Minnich from MAINTAINERS 2018-08-17 16:20:26 -07:00
Kbuild Kbuild updates for v4.15 2017-11-17 17:45:29 -08:00
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt 2018-08-02 08:06:55 +09:00
MAINTAINERS platform/x86: Add Intel AtomISP2 dummy / power-management driver 2019-04-20 09:16:02 +02:00
Makefile UPSTREAM: security: Implement Clang's stack initialization 2019-06-17 19:26:21 +00:00
README Docs: Added a pointer to the formatted docs to README 2018-03-21 09:02:53 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.