Merge tag 'trace-v4.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Aug 2016 16:50:06 +0000 (12:50 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Aug 2016 16:50:06 +0000 (12:50 -0400)
Pull tracing fixes from Steven Rostedt:
 "A few updates and fixes:

   - move the suppressing of the __builtin_return_address >0 warning to
     the tracing directory only.

   - metag recordmcount fix for newer glibc's

   - two tracing histogram fixes that were reported by KASAN"

* tag 'trace-v4.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Fix use-after-free in hist_register_trigger()
  tracing: Fix use-after-free in hist_unreg_all/hist_enable_unreg_all
  Makefile: Mute warning for __builtin_return_address(>0) for tracing only
  ftrace/recordmcount: Work around for addition of metag magic but not relocations

1  2 
Makefile

diff --combined Makefile
index d6d401bf9d95349834d8b73ae1e7f26d9137dbda,d384848478b947bb04004500e9d93ca4e10c3519..182a84d0b8ea0fc1073a48bf08ea72c10b2c5301
+++ b/Makefile
@@@ -371,27 -371,26 +371,27 @@@ CFLAGS_KERNEL   
  AFLAGS_KERNEL =
  LDFLAGS_vmlinux =
  CFLAGS_GCOV   = -fprofile-arcs -ftest-coverage -fno-tree-loop-im
 -CFLAGS_KCOV   = -fsanitize-coverage=trace-pc
 +CFLAGS_KCOV   := $(call cc-option,-fsanitize-coverage=trace-pc,)
  
  
  # Use USERINCLUDE when you must reference the UAPI directories only.
  USERINCLUDE    := \
                -I$(srctree)/arch/$(hdr-arch)/include/uapi \
 -              -Iarch/$(hdr-arch)/include/generated/uapi \
 +              -I$(objtree)/arch/$(hdr-arch)/include/generated/uapi \
                -I$(srctree)/include/uapi \
 -              -Iinclude/generated/uapi \
 +              -I$(objtree)/include/generated/uapi \
                  -include $(srctree)/include/linux/kconfig.h
  
  # Use LINUXINCLUDE when you must reference the include/ directory.
  # Needed to be compatible with the O= option
  LINUXINCLUDE    := \
                -I$(srctree)/arch/$(hdr-arch)/include \
 -              -Iarch/$(hdr-arch)/include/generated/uapi \
 -              -Iarch/$(hdr-arch)/include/generated \
 +              -I$(objtree)/arch/$(hdr-arch)/include/generated/uapi \
 +              -I$(objtree)/arch/$(hdr-arch)/include/generated \
                $(if $(KBUILD_SRC), -I$(srctree)/include) \
 -              -Iinclude \
 -              $(USERINCLUDE)
 +              -I$(objtree)/include
 +
 +LINUXINCLUDE  += $(filter-out $(LINUXINCLUDE),$(USERINCLUDE))
  
  KBUILD_CPPFLAGS := -D__KERNEL__
  
@@@ -555,7 -554,7 +555,7 @@@ ifeq ($(KBUILD_EXTMOD),
  # in parallel
  PHONY += scripts
  scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
 -       asm-generic
 +       asm-generic gcc-plugins
        $(Q)$(MAKE) $(build)=$(@)
  
  # Objects we will link into vmlinux / subdirs we need to visit
@@@ -621,7 -620,6 +621,6 @@@ include arch/$(SRCARCH)/Makefil
  
  KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
  KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
- KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
  
  ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
  KBUILD_CFLAGS += -Os
@@@ -636,15 -634,6 +635,15 @@@ endi
  # Tell gcc to never replace conditional load with a non-conditional one
  KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
  
 +PHONY += gcc-plugins
 +gcc-plugins: scripts_basic
 +ifdef CONFIG_GCC_PLUGINS
 +      $(Q)$(MAKE) $(build)=scripts/gcc-plugins
 +endif
 +      @:
 +
 +include scripts/Makefile.gcc-plugins
 +
  ifdef CONFIG_READABLE_ASM
  # Disable optimizations that make assembler listings hard to read.
  # reorder blocks reorders the control in the function
@@@ -676,11 -665,21 +675,11 @@@ endi
  endif
  # Find arch-specific stack protector compiler sanity-checking script.
  ifdef CONFIG_CC_STACKPROTECTOR
 -  stackp-path := $(srctree)/scripts/gcc-$(ARCH)_$(BITS)-has-stack-protector.sh
 -  ifneq ($(wildcard $(stackp-path)),)
 -    stackp-check := $(stackp-path)
 -  endif
 +  stackp-path := $(srctree)/scripts/gcc-$(SRCARCH)_$(BITS)-has-stack-protector.sh
 +  stackp-check := $(wildcard $(stackp-path))
  endif
  KBUILD_CFLAGS += $(stackp-flag)
  
 -ifdef CONFIG_KCOV
 -  ifeq ($(call cc-option, $(CFLAGS_KCOV)),)
 -    $(warning Cannot use CONFIG_KCOV: \
 -             -fsanitize-coverage=trace-pc is not supported by compiler)
 -    CFLAGS_KCOV =
 -  endif
 -endif
 -
  ifeq ($(cc-name),clang)
  KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
  KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
@@@ -1019,7 -1018,7 +1018,7 @@@ prepare1: prepare2 $(version_h) include
  
  archprepare: archheaders archscripts prepare1 scripts_basic
  
 -prepare0: archprepare
 +prepare0: archprepare gcc-plugins
        $(Q)$(MAKE) $(build)=.
  
  # All the preparing..
@@@ -1531,7 -1530,6 +1530,7 @@@ clean: $(clean-dirs
                -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
                -o -name '*.symtypes' -o -name 'modules.order' \
                -o -name modules.builtin -o -name '.tmp_*.o.*' \
 +              -o -name '*.c.[012]*.*' \
                -o -name '*.gcno' \) -type f -print | xargs rm -f
  
  # Generate tags for editors
@@@ -1642,7 -1640,7 +1641,7 @@@ endi
        $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
        $(build)=$(build-dir)
  # Make sure the latest headers are built for Documentation
 -Documentation/: headers_install
 +Documentation/ samples/: headers_install
  %/: prepare scripts FORCE
        $(cmd_crmodverdir)
        $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \