remarkable-linux/scripts
Linus Torvalds 26660a4046 Merge branch 'core-objtool-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull 'objtool' stack frame validation from Ingo Molnar:
 "This tree adds a new kernel build-time object file validation feature
  (ONFIG_STACK_VALIDATION=y): kernel stack frame correctness validation.
  It was written by and is maintained by Josh Poimboeuf.

  The motivation: there's a category of hard to find kernel bugs, most
  of them in assembly code (but also occasionally in C code), that
  degrades the quality of kernel stack dumps/backtraces.  These bugs are
  hard to detect at the source code level.  Such bugs result in
  incorrect/incomplete backtraces most of time - but can also in some
  rare cases result in crashes or other undefined behavior.

  The build time correctness checking is done via the new 'objtool'
  user-space utility that was written for this purpose and which is
  hosted in the kernel repository in tools/objtool/.  The tool's (very
  simple) UI and source code design is shaped after Git and perf and
  shares quite a bit of infrastructure with tools/perf (which tooling
  infrastructure sharing effort got merged via perf and is already
  upstream).  Objtool follows the well-known kernel coding style.

  Objtool does not try to check .c or .S files, it instead analyzes the
  resulting .o generated machine code from first principles: it decodes
  the instruction stream and interprets it.  (Right now objtool supports
  the x86-64 architecture.)

  From tools/objtool/Documentation/stack-validation.txt:

   "The kernel CONFIG_STACK_VALIDATION option enables a host tool named
    objtool which runs at compile time.  It has a "check" subcommand
    which analyzes every .o file and ensures the validity of its stack
    metadata.  It enforces a set of rules on asm code and C inline
    assembly code so that stack traces can be reliable.

    Currently it only checks frame pointer usage, but there are plans to
    add CFI validation for C files and CFI generation for asm files.

    For each function, it recursively follows all possible code paths
    and validates the correct frame pointer state at each instruction.

    It also follows code paths involving special sections, like
    .altinstructions, __jump_table, and __ex_table, which can add
    alternative execution paths to a given instruction (or set of
    instructions).  Similarly, it knows how to follow switch statements,
    for which gcc sometimes uses jump tables."

  When this new kernel option is enabled (it's disabled by default), the
  tool, if it finds any suspicious assembly code pattern, outputs
  warnings in compiler warning format:

    warning: objtool: rtlwifi_rate_mapping()+0x2e7: frame pointer state mismatch
    warning: objtool: cik_tiling_mode_table_init()+0x6ce: call without frame pointer save/setup
    warning: objtool:__schedule()+0x3c0: duplicate frame pointer save
    warning: objtool:__schedule()+0x3fd: sibling call from callable instruction with changed frame pointer

  ... so that scripts that pick up compiler warnings will notice them.
  All known warnings triggered by the tool are fixed by the tree, most
  of the commits in fact prepare the kernel to be warning-free.  Most of
  them are bugfixes or cleanups that stand on their own, but there are
  also some annotations of 'special' stack frames for justified cases
  such entries to JIT-ed code (BPF) or really special boot time code.

  There are two other long-term motivations behind this tool as well:

   - To improve the quality and reliability of kernel stack frames, so
     that they can be used for optimized live patching.

   - To create independent infrastructure to check the correctness of
     CFI stack frames at build time.  CFI debuginfo is notoriously
     unreliable and we cannot use it in the kernel as-is without extra
     checking done both on the kernel side and on the build side.

  The quality of kernel stack frames matters to debuggability as well,
  so IMO we can merge this without having to consider the live patching
  or CFI debuginfo angle"

* 'core-objtool-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (52 commits)
  objtool: Only print one warning per function
  objtool: Add several performance improvements
  tools: Copy hashtable.h into tools directory
  objtool: Fix false positive warnings for functions with multiple switch statements
  objtool: Rename some variables and functions
  objtool: Remove superflous INIT_LIST_HEAD
  objtool: Add helper macros for traversing instructions
  objtool: Fix false positive warnings related to sibling calls
  objtool: Compile with debugging symbols
  objtool: Detect infinite recursion
  objtool: Prevent infinite recursion in noreturn detection
  objtool: Detect and warn if libelf is missing and don't break the build
  tools: Support relative directory path for 'O='
  objtool: Support CROSS_COMPILE
  x86/asm/decoder: Use explicitly signed chars
  objtool: Enable stack metadata validation on 64-bit x86
  objtool: Add CONFIG_STACK_VALIDATION option
  objtool: Add tool to perform compile-time stack metadata validation
  x86/kprobes: Mark kretprobe_trampoline() stack frame as non-standard
  sched: Always inline context_switch()
  ...
2016-03-20 18:23:21 -07:00
..
basic fixdep: constify strrcmp arguments 2015-12-07 12:42:55 +01:00
coccinelle coccinelle: tests: unsigned value cannot be lesser than zero 2016-01-12 17:47:47 +01:00
dtc scripts/dtc: Update to upstream commit b06e55c88b9b 2016-02-11 19:45:09 -06:00
gdb scripts/gdb: remove useless global instruction 2015-06-30 19:44:58 -07:00
genksyms genksyms: Handle string literals with spaces in reference files 2015-12-09 15:19:23 +01:00
kconfig kconfig: fix qconf segfault by deleting heap objects 2016-01-11 09:45:08 +01:00
ksymoops
mod objtool: Mark non-standard object files and directories 2016-02-29 08:35:02 +01:00
package package Makefile: fix perf-tar targets when outdir is set 2015-11-24 17:49:42 +01:00
selinux selinux: explicitly declare the role "base_r" 2015-07-13 13:32:00 -04:00
tracing
.gitignore KEYS: Reserve an extra certificate symbol for inserting without recompiling 2016-02-26 15:30:20 +00:00
analyze_suspend.py
asn1_compiler.c ASN.1: Copy string names to tokens in ASN.1 compiler 2015-08-07 16:26:13 +01:00
bloat-o-meter scripts/bloat-o-meter: fix python3 syntax error 2016-01-14 16:00:49 -08:00
bootgraph.pl
check-lc_ctype.c DocBook: Use a fixed encoding for output 2015-09-28 01:31:48 -06:00
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py checkkconfigsymbols.py: find similar symbols 2015-12-14 10:54:23 -08:00
checkpatch.pl Merge branch 'akpm' (patches from Andrew) 2016-03-16 11:51:08 -07:00
checkstack.pl
checksyscalls.sh x86/asm/entry: Move the arch/x86/syscalls/ definitions to arch/x86/entry/syscalls/ 2015-06-04 07:37:37 +02:00
checkversion.pl
cleanfile
cleanpatch
coccicheck Coccinelle: fix incorrect -include option transformation 2015-10-26 21:32:09 +01:00
config
conmakehash.c
decode_stacktrace.sh scripts: decode_stacktrace: fix ARM architecture decoding 2015-09-04 16:54:41 -07:00
decodecode
depmod.sh
diffconfig
docproc.c
export_report.pl
extract-cert.c KEYS: Remove unnecessary header #inclusions from extract-cert.c 2015-09-25 16:31:45 +01:00
extract-ikconfig
extract-module-sig.pl KEYS: Provide a script to extract a module signature 2015-10-21 15:18:36 +01:00
extract-sys-certs.pl KEYS: Use the symbol value for list size, updated by scripts/insert-sys-cert 2016-02-26 15:32:05 +00:00
extract-vmlinux
gcc-goto.sh
gcc-ld
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_initramfs_list.sh
get_maintainer.pl scripts/get_maintainer.pl: handle file names beginning with ./ 2016-01-20 17:09:18 -08:00
gfp-translate
headerdep.pl
headers.sh
headers_check.pl
headers_install.sh
insert-sys-cert.c KEYS: Reserve an extra certificate symbol for inserting without recompiling 2016-02-26 15:30:20 +00:00
kallsyms.c kallsyms: add support for relative offsets in kallsyms address table 2016-03-15 16:55:16 -07:00
Kbuild.include Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2015-09-08 14:12:19 -07:00
kernel-doc A relatively boring cycle in the docs tree. There's a few kernel-doc 2016-01-17 11:55:07 -08:00
kernel-doc-xml-ref scripts/kernel-doc: Adding cross-reference links to html documentation. 2015-08-16 22:11:16 -06:00
ld-version.sh ld-version: Fix awk regex compile failure 2016-03-13 10:54:42 +01:00
Lindent scripts/Lindent: handle missing indent gracefully 2015-09-04 16:54:41 -07:00
link-vmlinux.sh kallsyms: add support for relative offsets in kallsyms address table 2016-03-15 16:55:16 -07:00
Makefile KEYS: Reserve an extra certificate symbol for inserting without recompiling 2016-02-26 15:30:20 +00:00
Makefile.asm-generic
Makefile.build objtool: Detect and warn if libelf is missing and don't break the build 2016-03-05 09:20:44 +01:00
Makefile.clean
Makefile.dtbinst
Makefile.extrawarn kbuild: Demote 'sign-compare' warning to W=2 2016-01-12 16:07:03 +01:00
Makefile.fwinst
Makefile.headersinst
Makefile.help
Makefile.host
Makefile.kasan arm64: add KASAN support 2015-10-12 17:46:36 +01:00
Makefile.lib kbuild: Allow using host dtc instead of kernel's copy 2016-02-23 10:23:55 -06:00
Makefile.modbuiltin
Makefile.modinst modsign: Abort modules_install when signing fails 2015-08-07 16:26:13 +01:00
Makefile.modpost modpost: Add flag -E for making section mismatches fatal 2015-10-06 10:46:21 +10:30
Makefile.modsign
Makefile.ubsan UBSAN: run-time undefined behavior sanity checker 2016-01-20 17:09:18 -08:00
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap mksysmap: Add h8300 local symbol pattern 2015-06-23 13:35:47 +09:00
mkuboot.sh
mkversion
module-common.lds
namespace.pl kallsyms: add support for relative offsets in kallsyms address table 2016-03-15 16:55:16 -07:00
objdiff
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel scripts: add "prune-kernel" script to clean up old kernel images 2016-02-09 10:09:52 -08:00
recordmcount.c ftrace/scripts: Fix incorrect use of sprintf in recordmcount 2016-01-04 11:13:16 -05:00
recordmcount.h recordmcount: Fix endianness handling bug for nop_mcount 2015-11-03 10:45:26 -05:00
recordmcount.pl scripts/recordmcount.pl: support data in text section on powerpc 2016-01-13 12:35:41 +11:00
setlocalversion
show_delta
sign-file.c sign-file: fix build with CMS support disabled 2016-03-03 10:50:46 +00:00
sortextable.c arm64 updates for 4.6: 2016-03-17 20:03:47 -07:00
sortextable.h
spelling.txt scripts/spelling.txt: add some typo-words 2015-09-04 16:54:41 -07:00
stackdelta scripts: add stackdelta script 2015-08-28 17:04:40 +02:00
stackusage scripts: add stackusage script 2015-08-28 17:04:40 +02:00
tags.sh Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-01-20 10:10:23 -08:00
unifdef.c
ver_linux scripts: fix typo in ver_linux 2016-02-07 23:01:45 -08:00
xen-hypercalls.sh
xz_wrap.sh