diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 16:55:46 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 16:55:46 -0800 |
commit | f346b0becb1bc62e45495f9cdbae3eef35d0b635 (patch) | |
tree | ae79f3dfb8e031da51d38f0f095f89d7d23f3643 /scripts | |
parent | 00d59fde8532b2d42e80909d2e58678755e04da9 (diff) | |
parent | 0f4991e8fd48987ae476a92cdee6bfec4aff31b8 (diff) | |
download | linux-stable-f346b0becb1bc62e45495f9cdbae3eef35d0b635.tar.gz linux-stable-f346b0becb1bc62e45495f9cdbae3eef35d0b635.tar.bz2 linux-stable-f346b0becb1bc62e45495f9cdbae3eef35d0b635.zip |
Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton:
- large KASAN update to use arm's "software tag-based mode"
- a few misc things
- sh updates
- ocfs2 updates
- just about all of MM
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (167 commits)
kernel/fork.c: mark 'stack_vm_area' with __maybe_unused
memcg, oom: notify on oom killer invocation from the charge path
mm, swap: fix swapoff with KSM pages
include/linux/gfp.h: fix typo
mm/hmm: fix memremap.h, move dev_page_fault_t callback to hmm
hugetlbfs: Use i_mmap_rwsem to fix page fault/truncate race
hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization
memory_hotplug: add missing newlines to debugging output
mm: remove __hugepage_set_anon_rmap()
include/linux/vmstat.h: remove unused page state adjustment macro
mm/page_alloc.c: allow error injection
mm: migrate: drop unused argument of migrate_page_move_mapping()
blkdev: avoid migration stalls for blkdev pages
mm: migrate: provide buffer_migrate_page_norefs()
mm: migrate: move migrate_page_lock_buffers()
mm: migrate: lock buffers before migrate_page_move_mapping()
mm: migration: factor out code to compute expected number of page references
mm, page_alloc: enable pcpu_drain with zone capability
kmemleak: add config to select auto scan
mm/page_alloc.c: don't call kasan_free_pages() at deferred mem init
...
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.kasan | 53 | ||||
-rwxr-xr-x | scripts/bloat-o-meter | 1 | ||||
-rwxr-xr-x | scripts/checkstack.pl | 2 | ||||
-rwxr-xr-x | scripts/decode_stacktrace.sh | 2 | ||||
-rwxr-xr-x | scripts/decodecode | 7 | ||||
-rw-r--r-- | scripts/spdxcheck-test.sh | 12 | ||||
-rwxr-xr-x | scripts/tags.sh | 13 |
7 files changed, 65 insertions, 25 deletions
diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index 69552a39951d..25c259df8ffa 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -ifdef CONFIG_KASAN +ifdef CONFIG_KASAN_GENERIC + ifdef CONFIG_KASAN_INLINE call_threshold := 10000 else @@ -12,36 +13,44 @@ CFLAGS_KASAN_MINIMAL := -fsanitize=kernel-address cc-param = $(call cc-option, -mllvm -$(1), $(call cc-option, --param $(1))) -ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),) - ifneq ($(CONFIG_COMPILE_TEST),y) - $(warning Cannot use CONFIG_KASAN: \ - -fsanitize=kernel-address is not supported by compiler) - endif -else - # -fasan-shadow-offset fails without -fsanitize - CFLAGS_KASAN_SHADOW := $(call cc-option, -fsanitize=kernel-address \ +# -fasan-shadow-offset fails without -fsanitize +CFLAGS_KASAN_SHADOW := $(call cc-option, -fsanitize=kernel-address \ -fasan-shadow-offset=$(KASAN_SHADOW_OFFSET), \ $(call cc-option, -fsanitize=kernel-address \ -mllvm -asan-mapping-offset=$(KASAN_SHADOW_OFFSET))) - ifeq ($(strip $(CFLAGS_KASAN_SHADOW)),) - CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) - else - # Now add all the compiler specific options that are valid standalone - CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \ - $(call cc-param,asan-globals=1) \ - $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \ - $(call cc-param,asan-stack=1) \ - $(call cc-param,asan-use-after-scope=1) \ - $(call cc-param,asan-instrument-allocas=1) - endif - +ifeq ($(strip $(CFLAGS_KASAN_SHADOW)),) + CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) +else + # Now add all the compiler specific options that are valid standalone + CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \ + $(call cc-param,asan-globals=1) \ + $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \ + $(call cc-param,asan-stack=1) \ + $(call cc-param,asan-use-after-scope=1) \ + $(call cc-param,asan-instrument-allocas=1) endif ifdef CONFIG_KASAN_EXTRA CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope) endif -CFLAGS_KASAN_NOSANITIZE := -fno-builtin +endif # CONFIG_KASAN_GENERIC +ifdef CONFIG_KASAN_SW_TAGS + +ifdef CONFIG_KASAN_INLINE + instrumentation_flags := -mllvm -hwasan-mapping-offset=$(KASAN_SHADOW_OFFSET) +else + instrumentation_flags := -mllvm -hwasan-instrument-with-calls=1 +endif + +CFLAGS_KASAN := -fsanitize=kernel-hwaddress \ + -mllvm -hwasan-instrument-stack=0 \ + $(instrumentation_flags) + +endif # CONFIG_KASAN_SW_TAGS + +ifdef CONFIG_KASAN +CFLAGS_KASAN_NOSANITIZE := -fno-builtin endif diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter index a923f05edb36..8c965f6a9881 100755 --- a/scripts/bloat-o-meter +++ b/scripts/bloat-o-meter @@ -32,6 +32,7 @@ def getsizes(file, format): if name.startswith("__mod_"): continue if name.startswith("__se_sys"): continue if name.startswith("__se_compat_sys"): continue + if name.startswith("__addressable_"): continue if name == "linux_banner": continue # statics and some other optimizations adds random .NUMBER name = re_NUMBER.sub('', name) diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index 34414c6efad6..122aef5e4e14 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl @@ -48,7 +48,9 @@ my (@stack, $re, $dre, $x, $xs, $funcre); $funcre = qr/^$x* <(.*)>:$/; if ($arch eq 'aarch64') { #ffffffc0006325cc: a9bb7bfd stp x29, x30, [sp, #-80]! + #a110: d11643ff sub sp, sp, #0x590 $re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o; + $dre = qr/^.*sub.*sp, sp, #(0x$x{1,8})/o; } elsif ($arch eq 'arm') { #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64 $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o; diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index 64220e36ce3b..98a7d63a723e 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh @@ -78,7 +78,7 @@ parse_symbol() { fi # Strip out the base of the path - code=${code//$basepath/""} + code=${code//^$basepath/""} # In the case of inlines, move everything to same line code=${code//$'\n'/' '} diff --git a/scripts/decodecode b/scripts/decodecode index 9cef558528aa..ba8b8d5834e6 100755 --- a/scripts/decodecode +++ b/scripts/decodecode @@ -60,6 +60,13 @@ case $width in 4) type=4byte ;; esac +if [ -z "$ARCH" ]; then + case `uname -m` in + aarch64*) ARCH=arm64 ;; + arm*) ARCH=arm ;; + esac +fi + disas() { ${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s > /dev/null 2>&1 diff --git a/scripts/spdxcheck-test.sh b/scripts/spdxcheck-test.sh new file mode 100644 index 000000000000..cfea6a0d1cc0 --- /dev/null +++ b/scripts/spdxcheck-test.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +for PYTHON in python2 python3; do + # run check on a text and a binary file + for FILE in Makefile Documentation/logo.gif; do + $PYTHON scripts/spdxcheck.py $FILE + $PYTHON scripts/spdxcheck.py - < $FILE + done + + # run check on complete tree to catch any other issues + $PYTHON scripts/spdxcheck.py > /dev/null +done diff --git a/scripts/tags.sh b/scripts/tags.sh index 4fa070f9231a..f470d9919ed7 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -191,7 +191,7 @@ regex_c=( '/^DEF_PCI_AC_\(\|NO\)RET(\([[:alnum:]_]*\).*/\2/' '/^PCI_OP_READ(\(\w*\).*[1-4])/pci_bus_read_config_\1/' '/^PCI_OP_WRITE(\(\w*\).*[1-4])/pci_bus_write_config_\1/' - '/\<DEFINE_\(MUTEX\|SEMAPHORE\|SPINLOCK\)(\([[:alnum:]_]*\)/\2/v/' + '/\<DEFINE_\(RT_MUTEX\|MUTEX\|SEMAPHORE\|SPINLOCK\)(\([[:alnum:]_]*\)/\2/v/' '/\<DEFINE_\(RAW_SPINLOCK\|RWLOCK\|SEQLOCK\)(\([[:alnum:]_]*\)/\2/v/' '/\<DECLARE_\(RWSEM\|COMPLETION\)(\([[:alnum:]_]\+\)/\2/v/' '/\<DECLARE_BITMAP(\([[:alnum:]_]*\)/\1/v/' @@ -204,6 +204,15 @@ regex_c=( '/\(^\s\)OFFSET(\([[:alnum:]_]*\)/\2/v/' '/\(^\s\)DEFINE(\([[:alnum:]_]*\)/\2/v/' '/\<\(DEFINE\|DECLARE\)_HASHTABLE(\([[:alnum:]_]*\)/\2/v/' + '/\<DEFINE_ID\(R\|A\)(\([[:alnum:]_]\+\)/\2/' + '/\<DEFINE_WD_CLASS(\([[:alnum:]_]\+\)/\1/' + '/\<ATOMIC_NOTIFIER_HEAD(\([[:alnum:]_]\+\)/\1/' + '/\<RAW_NOTIFIER_HEAD(\([[:alnum:]_]\+\)/\1/' + '/\<DECLARE_FAULT_ATTR(\([[:alnum:]_]\+\)/\1/' + '/\<BLOCKING_NOTIFIER_HEAD(\([[:alnum:]_]\+\)/\1/' + '/\<DEVICE_ATTR_\(RW\|RO\|WO\)(\([[:alnum:]_]\+\)/dev_attr_\2/' + '/\<DRIVER_ATTR_\(RW\|RO\|WO\)(\([[:alnum:]_]\+\)/driver_attr_\2/' + '/\<\(DEFINE\|DECLARE\)_STATIC_KEY_\(TRUE\|FALSE\)\(\|_RO\)(\([[:alnum:]_]\+\)/\4/' ) regex_kconfig=( '/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/\2/' @@ -249,7 +258,7 @@ exuberant() -I __initdata,__exitdata,__initconst,__ro_after_init \ -I __initdata_memblock \ -I __refdata,__attribute,__maybe_unused,__always_unused \ - -I __acquires,__releases,__deprecated \ + -I __acquires,__releases,__deprecated,__always_inline \ -I __read_mostly,__aligned,____cacheline_aligned \ -I ____cacheline_aligned_in_smp \ -I __cacheline_aligned,__cacheline_aligned_in_smp \ |