Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8a3aff1 authored by Blagovest Kolenichev's avatar Blagovest Kolenichev
Browse files

Merge android-4.9.86 (b324a701) into msm-4.9



* refs/heads/tmp-b324a701:
  Linux 4.9.86
  MIPS: Implement __multi3 for GCC7 MIPS64r6 builds
  KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2
  net: gianfar_ptp: move set_fipers() to spinlock protecting area
  sctp: make use of pre-calculated len
  xen/gntdev: Fix partial gntdev_mmap() cleanup
  xen/gntdev: Fix off-by-one error when unmapping with holes
  SolutionEngine771x: fix Ether platform data
  mdio-sun4i: Fix a memory leak
  xen-netfront: enable device after manual module load
  bnxt_en: Fix the 'Invalid VF' id check in bnxt_vf_ndo_prep routine.
  can: flex_can: Correct the checking for frame length in flexcan_start_xmit()
  mac80211: mesh: drop frames appearing to be from us
  nl80211: Check for the required netlink attribute presence
  i40e/i40evf: Account for frags split over multiple descriptors in check linearize
  uapi libc compat: add fallback for unsupported libcs
  drm/ttm: check the return value of kzalloc
  NET: usb: qmi_wwan: add support for YUGA CLM920-NC5 PID 0x9625
  e1000: fix disabling already-disabled warning
  macvlan: Fix one possible double free
  xfs: quota: check result of register_shrinker()
  xfs: quota: fix missed destroy of qi_tree_lock
  IB/ipoib: Fix race condition in neigh creation
  IB/mlx4: Fix mlx4_ib_alloc_mr error flow
  s390/dasd: fix wrongly assigned configuration data
  genirq: Guard handle_bad_irq log messages
  IB/mlx5: Fix mlx5_ib_alloc_mr error flow
  led: core: Fix brightness setting when setting delay_off=0
  bnx2x: Improve reliability in case of nested PCI errors
  tg3: Enable PHY reset in MTU change path for 5720
  tg3: Add workaround to restrict 5762 MRRS to 2048
  tipc: fix tipc_mon_delete() oops in tipc_enable_bearer() error path
  tipc: error path leak fixes in tipc_enable_bearer()
  lib/mpi: Fix umul_ppmm() for MIPS64r6
  ARM: dts: ls1021a: fix incorrect clock references
  scsi: storvsc: Fix scsi_cmd error assignments in storvsc_handle_error
  net: stmmac: Fix TX timestamp calculation
  ip6_tunnel: get the min mtu properly in ip6_tnl_xmit
  net: arc_emac: fix arc_emac_rx() error paths
  net: mediatek: setup proper state for disabled GMAC on the default
  ASoC: nau8825: fix issue that pop noise when start capture
  spi: atmel: fixed spin_lock usage inside atmel_spi_remove
  mac80211_hwsim: Fix a possible sleep-in-atomic bug in hwsim_get_radio_nl
  drm/nouveau/pci: do a msi rearm on init
  net: phy: xgene: disable clk on error paths
  sget(): handle failures of register_shrinker()
  x86/asm: Allow again using asm.h when building for the 'bpf' clang target
  ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch
  ipv6: icmp6: Allow icmp messages to be looped back
  mtd: nand: brcmnand: Zero bitflip is not an error
  mtd: nand: gpmi: Fix failure when a erased page has a bitflip at BBM
  net: usb: qmi_wwan: add Telit ME910 PID 0x1101 support
  nvme: check hw sectors before setting chunk sectors
  dmaengine: fsl-edma: disable clks on all error paths
  f2fs: fix a bug caused by NULL extent tree
  i2c: designware: must wait for enable
  hrtimer: Ensure POSIX compliance (relative CLOCK_REALTIME hrtimers)
  ANDROID: kbuild: change LTO into a choice
  ANDROID: arm64: crypto: fix AES CE when built as a module
  ANDROID: staging: lustre: fix filler function type
  ANDROID: fs: logfs: fix filler function type
  ANDROID: fs: gfs2: fix filler function type
  ANDROID: fs: exofs: fix filler function type
  ANDROID: fs: afs: fix filler function type
  ANDROID: keychord: Check for write data size
  media-device: fix ioctl function types
  drivers/perf: arm_pmu: fix function type mismatch
  dummycon: fix function types
  fs: nfs: fix filler function type
  mm: fix filler function type mismatch
  mm: fix drain_local_pages function type
  BACKPORT: vfs: pass type instead of fn to do_{loop,iter}_readv_writev()
  arch/arm64/crypto: fix CFI in AES CE
  arch/arm64/crypto: fix CFI in SHA CE
  arm64: disable CFI for cpu_replace_ttbr1
  v4l2-ioctl: fix function types for IOCTL_INFO_STD
  UPSTREAM: module: Do not paper over type mismatches in module_param_call()
  BACKPORT: treewide: Fix function prototypes for module_param_call()
  UPSTREAM: module: Prepare to convert all module_param_call() prototypes
  bpf: fix function type for __bpf_prog_run
  kallsyms: strip the .cfi postfix from symbols with CONFIG_CFI_CLANG
  add support for clang Control Flow Integrity (CFI)
  HACK: init: ensure initcall ordering with LTO
  xen/efi: don't use -fshort-wchar
  drivers/misc: disable LTO for lkdtm_rodata.o
  arm64: vdso: disable LTO
  FROMLIST: BACKPORT: arm64: select ARCH_SUPPORTS_LTO_CLANG
  FROMLIST: BACKPORT: arm64: disable RANDOMIZE_MODULE_REGION_FULL with LTO_CLANG
  FROMLIST: arch/arm64/crypto: disable LTO for aes-ce-cipher.c
  arm64: disable ARM64_ERRATUM_843419 for clang LTO
  arm64: pass code model to LLVMgold
  FROMLIST: BACKPORT: arm64: make mrs_s and msr_s macros work with LTO
  FROMLIST: arm64: kvm: use -fno-jump-tables with clang
  FROMLIST: efi/libstub: disable LTO
  FROMLIST: scripts/mod: disable LTO for empty.c
  FROMLIST: BACKPORT: kbuild: fix dynamic ftrace with clang LTO
  FROMLIST: BACKPORT: kbuild: add support for clang LTO
  FROMLIST: BACKPORT: arm64: add a workaround for GNU gold with ARM64_MODULE_PLTS
  FROMLIST: arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold
  FROMLIST: kbuild: add __ld-ifversion and linker-specific macros
  FROMLIST: kbuild: add ld-name macro
  FROMLIST: BACKPORT: arm64: keep .altinstructions and .altinstr_replacement
  arm64: fix LD_DEAD_CODE_DATA_ELIMINATION
  FROMLIST: kbuild: fix LD_DEAD_CODE_DATA_ELIMINATION
  FROMLIST: BACKPORT: kbuild: add __cc-ifversion and compiler-specific variants
  FROMLIST: kbuild: add clang-version.sh
  Revert "binder: add missing binder_unlock()"
  Linux 4.9.85
  x86/entry/64: Clear extra registers beyond syscall arguments, to reduce speculation attack surface
  mm: fail get_vaddr_frames() for filesystem-dax mappings
  mm: Fix devm_memremap_pages() collision handling
  libnvdimm, dax: fix 1GB-aligned namespaces vs physical misalignment
  IB/core: disable memory registration of filesystem-dax vmas
  v4l2: disable filesystem-dax mapping support
  mm: introduce get_user_pages_longterm
  device-dax: implement ->split() to catch invalid munmap attempts
  libnvdimm: fix integer overflow static analysis warning
  fs/dax.c: fix inefficiency in dax_writeback_mapping_range()
  mm: avoid spurious 'bad pmd' warning messages
  X.509: fix NULL dereference when restricting key with unsupported_sig
  binder: add missing binder_unlock()
  drm/amdgpu: add new device to use atpx quirk
  drm/amdgpu: Avoid leaking PM domain on driver unbind (v2)
  drm/amdgpu: add atpx quirk handling (v2)
  drm/amdgpu: Add dpm quirk for Jet PRO (v2)
  usb: renesas_usbhs: missed the "running" flag in usb_dmac with rx path
  usb: gadget: f_fs: Process all descriptors during bind
  Revert "usb: musb: host: don't start next rx urb if current one failed"
  usb: ldusb: add PIDs for new CASSY devices supported by this driver
  usb: dwc3: gadget: Set maxpacket size for ep0 IN
  drm/edid: Add 6 bpc quirk for CPT panel in Asus UX303LA
  Add delay-init quirk for Corsair K70 RGB keyboards
  arm64: Disable unhandled signal log messages by default
  usb: ohci: Proper handling of ed_rm_list to handle race condition between usb_kill_urb() and finish_unlinks()
  ohci-hcd: Fix race condition caused by ohci_urb_enqueue() and io_watchdog_func()
  PCI/cxgb4: Extend T3 PCI quirk to T4+ devices
  irqchip/gic-v3: Use wmb() instead of smb_wmb() in gic_raise_softirq()
  x86/oprofile: Fix bogus GCC-8 warning in nmi_setup()
  iio: adis_lib: Initialize trigger before requesting interrupt
  iio: buffer: check if a buffer has been set up when poll is called
  RDMA/uverbs: Protect from command mask overflow
  PKCS#7: fix certificate chain verification
  X.509: fix BUG_ON() when hash algorithm is unsupported
  cfg80211: fix cfg80211_beacon_dup
  scsi: ibmvfc: fix misdefined reserved field in ibmvfc_fcp_rsp_info
  xtensa: fix high memory/reserved memory collision
  netfilter: drop outermost socket lock in getsockopt()
  ANDROID: sdcardfs: Set num in extension_details during make_item

Conflicts:
	Makefile
	arch/arm64/include/asm/arch_gicv3.h
	arch/arm64/kernel/module.lds
	drivers/usb/gadget/function/f_fs.c
	scripts/link-vmlinux.sh

Change in module_param_call() definition requires alignment in:

	drivers/hwtracing/coresight/coresight-event.c
	drivers/media/radio/radio-iris-transport.c
	drivers/power/reset/msm-poweroff.c
	drivers/soc/qcom/wcnss/wcnss_wlan.c
	drivers/video/fbdev/msm/mdss_dsi_status.c

Change-Id: I2fa32c39bd4ba8a132f8f8abc8132a2ceb32907a
Signed-off-by: default avatarBlagovest Kolenichev <bkolenichev@codeaurora.org>
parents ddbece73 b324a701
Loading
Loading
Loading
Loading
+86 −2
Original line number Diff line number Diff line
VERSION = 4
PATCHLEVEL = 9
SUBLEVEL = 84
SUBLEVEL = 86
EXTRAVERSION =
NAME = Roaring Lionus

@@ -349,6 +349,7 @@ include scripts/Kbuild.include
AS		= $(CROSS_COMPILE)as
LD		= $(CROSS_COMPILE)ld
REAL_CC		= $(CROSS_COMPILE)gcc
LDGOLD		= $(CROSS_COMPILE)ld.gold
CPP		= $(CC) -E
AR		= $(CROSS_COMPILE)ar
NM		= $(CROSS_COMPILE)nm
@@ -627,6 +628,20 @@ CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disabl
CFLAGS_KCOV	:= $(call cc-option,-fsanitize-coverage=trace-pc,)
export CFLAGS_GCOV CFLAGS_KCOV

# Make toolchain changes before including arch/$(SRCARCH)/Makefile to ensure
# ar/cc/ld-* macros return correct values.
ifdef CONFIG_LTO_CLANG
# use GNU gold with LLVMgold for LTO linking, and LD for vmlinux_link
LDFINAL_vmlinux := $(LD)
LD		:= $(LDGOLD)
LDFLAGS		+= -plugin LLVMgold.so
# use llvm-ar for building symbol tables from IR files, and llvm-dis instead
# of objdump for processing symbol versions and exports
LLVM_AR		:= llvm-ar
LLVM_DIS	:= llvm-dis
export LLVM_AR LLVM_DIS
endif

# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
# values of the respective KBUILD_* variables
ARCH_CPPFLAGS :=
@@ -645,6 +660,53 @@ KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,)
KBUILD_CFLAGS	+= $(call cc-option,-fdata-sections,)
endif

ifdef CONFIG_LTO_CLANG
lto-clang-flags	:= -flto -fvisibility=hidden

# allow disabling only clang LTO where needed
DISABLE_LTO_CLANG := -fno-lto -fvisibility=default
export DISABLE_LTO_CLANG
endif

ifdef CONFIG_LTO
lto-flags	:= $(lto-clang-flags)
KBUILD_CFLAGS	+= $(lto-flags)

DISABLE_LTO	:= $(DISABLE_LTO_CLANG)
export DISABLE_LTO

# LDFINAL_vmlinux and LDFLAGS_FINAL_vmlinux can be set to override
# the linker and flags for vmlinux_link.
export LDFINAL_vmlinux LDFLAGS_FINAL_vmlinux
endif

ifdef CONFIG_CFI_CLANG
cfi-clang-flags	+= -fsanitize=cfi
DISABLE_CFI_CLANG := -fno-sanitize=cfi
ifdef CONFIG_MODULES
cfi-clang-flags	+= -fsanitize-cfi-cross-dso
DISABLE_CFI_CLANG += -fno-sanitize-cfi-cross-dso
endif
ifdef CONFIG_CFI_PERMISSIVE
cfi-clang-flags	+= -fsanitize-recover=cfi -fno-sanitize-trap=cfi
endif

# also disable CFI when LTO is disabled
DISABLE_LTO_CLANG += $(DISABLE_CFI_CLANG)
# allow disabling only clang CFI where needed
export DISABLE_CFI_CLANG
endif

ifdef CONFIG_CFI
# cfi-flags are re-tested in prepare-compiler-check
cfi-flags	:= $(cfi-clang-flags)
KBUILD_CFLAGS	+= $(cfi-flags)

DISABLE_CFI	:= $(DISABLE_CFI_CLANG)
DISABLE_LTO	+= $(DISABLE_CFI)
export DISABLE_CFI
endif

ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS	+= $(call cc-option,-Oz,-Os)
KBUILD_CFLAGS	+= $(call cc-disable-warning,maybe-uninitialized,)
@@ -1087,6 +1149,22 @@ prepare-objtool: $(objtool_target)
# CC_STACKPROTECTOR_STRONG! Why did it build with _REGULAR?!")
PHONY += prepare-compiler-check
prepare-compiler-check: FORCE
# Make sure we're using a supported toolchain with LTO_CLANG
ifdef CONFIG_LTO_CLANG
  ifneq ($(call clang-ifversion, -ge, 0500, y), y)
	@echo Cannot use CONFIG_LTO_CLANG: requires clang 5.0 or later >&2 && exit 1
  endif
  ifneq ($(call gold-ifversion, -ge, 112000000, y), y)
	@echo Cannot use CONFIG_LTO_CLANG: requires GNU gold 1.12 or later >&2 && exit 1
  endif
endif
# Make sure compiler supports LTO flags
ifdef lto-flags
  ifeq ($(call cc-option, $(lto-flags)),)
	@echo Cannot use CONFIG_LTO: $(lto-flags) not supported by compiler \
		>&2 && exit 1
  endif
endif
# Make sure compiler supports requested stack protector flag.
ifdef stackp-name
  ifeq ($(call cc-option, $(stackp-flag)),)
@@ -1100,6 +1178,11 @@ ifdef stackp-check
	@echo Cannot use CONFIG_CC_STACKPROTECTOR_$(stackp-name): \
                  $(stackp-flag) available but compiler is broken >&2 && exit 1
  endif
endif
ifdef cfi-flags
  ifeq ($(call cc-option, $(cfi-flags)),)
	@echo Cannot use CONFIG_CFI: $(cfi-flags) not supported by compiler >&2 && exit 1
  endif
endif
	@:

@@ -1575,7 +1658,8 @@ clean: $(clean-dirs)
		-o -name modules.builtin -o -name '.tmp_*.o.*' \
		-o -name '*.c.[012]*.*' \
		-o -name '*.ll' \
		-o -name '*.gcno' \) -type f -print | xargs rm -f
		-o -name '*.gcno' \
		-o -name '*.*.symversions' \) -type f -print | xargs rm -f

# Generate tags for editors
# ---------------------------------------------------------------------------
+68 −0
Original line number Diff line number Diff line
@@ -503,6 +503,74 @@ config LD_DEAD_CODE_DATA_ELIMINATION
	  sections (e.g., '.text.init'). Typically '.' in section names
	  is used to distinguish them from label names / C identifiers.

config LTO
	def_bool n

config ARCH_SUPPORTS_LTO_CLANG
	bool
	help
	  An architecture should select this option it supports:
	  - compiling with clang,
	  - compiling inline assembly with clang's integrated assembler,
	  - and linking with either lld or GNU gold w/ LLVMgold.

choice
	prompt "Link-Time Optimization (LTO) (EXPERIMENTAL)"
	default LTO_NONE
	help
	  This option turns on Link-Time Optimization (LTO).

config LTO_NONE
	bool "None"

config LTO_CLANG
	bool "Use clang Link Time Optimization (LTO) (EXPERIMENTAL)"
	depends on ARCH_SUPPORTS_LTO_CLANG
	depends on !FTRACE_MCOUNT_RECORD || HAVE_C_RECORDMCOUNT
	select LTO
	select THIN_ARCHIVES
	select LD_DEAD_CODE_DATA_ELIMINATION
	help
          This option enables clang's Link Time Optimization (LTO), which allows
          the compiler to optimize the kernel globally at link time. If you
          enable this option, the compiler generates LLVM IR instead of object
          files, and the actual compilation from IR occurs at the LTO link step,
          which may take several minutes.

          If you select this option, you must compile the kernel with clang >=
          5.0 (make CC=clang) and GNU gold from binutils >= 2.27, and have the
          LLVMgold plug-in in LD_LIBRARY_PATH.

endchoice

config CFI
	bool

config CFI_PERMISSIVE
	bool "Use CFI in permissive mode"
	depends on CFI
	help
	  When selected, Control Flow Integrity (CFI) violations result in a
	  warning instead of a kernel panic. This option is useful for finding
	  CFI violations in drivers during development.

config CFI_CLANG
	bool "Use clang Control Flow Integrity (CFI) (EXPERIMENTAL)"
	depends on LTO_CLANG
	depends on KALLSYMS
	select CFI
	help
	  This option enables clang Control Flow Integrity (CFI), which adds
	  runtime checking for indirect function calls.

config CFI_CLANG_SHADOW
	bool "Use CFI shadow to speed up cross-module checks"
	default y
	depends on CFI_CLANG
	help
	  If you select this option, the kernel builds a fast look-up table of
	  CFI check functions in loaded modules to reduce overhead.

config HAVE_ARCH_WITHIN_STACK_FRAMES
	bool
	help
+1 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@
				reg = <0x2a>;
				VDDA-supply = <&reg_3p3v>;
				VDDIO-supply = <&reg_3p3v>;
				clocks = <&sys_mclk 1>;
				clocks = <&sys_mclk>;
			};
		};
	};
+1 −1
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@
		reg = <0x0a>;
		VDDA-supply = <&reg_3p3v>;
		VDDIO-supply = <&reg_3p3v>;
		clocks = <&sys_mclk 1>;
		clocks = <&sys_mclk>;
	};
};

+1 −1
Original line number Diff line number Diff line
@@ -1284,7 +1284,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
		return -EFAULT;
	}

	if (vma_kernel_pagesize(vma) && !logging_active) {
	if (vma_kernel_pagesize(vma) == PMD_SIZE && !logging_active) {
		hugetlb = true;
		gfn = (fault_ipa & PMD_MASK) >> PAGE_SHIFT;
	} else {
Loading