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

Commit 2e8800ec authored by Blagovest Kolenichev's avatar Blagovest Kolenichev
Browse files

Merge android-4.9.100 (39c85666) into msm-4.9



* refs/heads/tmp-39c85666:
  Linux 4.9.100
  perf/x86: Fix possible Spectre-v1 indexing for x86_pmu::event_map()
  perf/core: Fix possible Spectre-v1 indexing for ->aux_pages[]
  perf/x86/msr: Fix possible Spectre-v1 indexing in the MSR driver
  perf/x86/cstate: Fix possible Spectre-v1 indexing for pkg_msr
  perf/x86: Fix possible Spectre-v1 indexing for hw_perf_event cache_*
  tracing/uprobe_event: Fix strncpy corner case
  thermal: exynos: Propagate error value from tmu_read()
  thermal: exynos: Reading temperature makes sense only when TMU is turned on
  Revert "Bluetooth: btusb: Fix quirk for Atheros 1525/QCA6174"
  atm: zatm: Fix potential Spectre v1
  net: atm: Fix potential Spectre v1
  drm/i915: Fix drm:intel_enable_lvds ERROR message in kernel log
  drm/vc4: Fix scaling of uni-planar formats
  can: kvaser_usb: Increase correct stats counter in kvaser_usb_rx_can_msg()
  tracing: Fix regex_match_front() to not over compare the test string
  libata: Apply NOLPM quirk for SanDisk SD7UB3Q*G1001 SSDs
  rfkill: gpio: fix memory leak in probe error path
  gpio: fix error path in lineevent_create
  gpio: fix aspeed_gpio unmask irq
  gpioib: do not free unrequested descriptors
  arm64: Add work around for Arm Cortex-A55 Erratum 1024718
  f2fs: fix a dead loop in f2fs_fiemap()
  KVM: PPC: Book3S HV: Fix trap number return from __kvmppc_vcore_entry
  bdi: Fix oops in wb_workfn()
  tcp: fix TCP_REPAIR_QUEUE bound checking
  perf: Remove superfluous allocation error check
  soreuseport: initialise timewait reuseport field
  dccp: initialize ireq->ir_mark
  net: fix uninit-value in __hw_addr_add_ex()
  net: initialize skb->peeked when cloning
  net: fix rtnh_ok()
  netlink: fix uninit-value in netlink_sendmsg
  crypto: af_alg - fix possible uninit-value in alg_bind()
  kcm: Call strp_stop before strp_done in kcm_attach
  IB/device: Convert ib-comp-wq to be CPU-bound
  ipvs: fix rtnl_lock lockups caused by start_sync_thread
  BACKPORT: dma-buf/sync_file: Allow multiple sync_files to wrap a single dma-fence
  ANDROID: ftrace: fix function type mismatches
  UPSTREAM: ANDROID: binder: prevent transactions into own process.

Conflicts:
	arch/arm64/include/asm/cputype.h
	arch/arm64/mm/proc.S
	drivers/dma-buf/sync_file.c

Change-Id: Ic5b1496659327a34150a192033ce7e1efa8b5fea
Signed-off-by: default avatarBlagovest Kolenichev <bkolenichev@codeaurora.org>
parents b63590cd 39c85666
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
VERSION = 4
VERSION = 4
PATCHLEVEL = 9
PATCHLEVEL = 9
SUBLEVEL = 99
SUBLEVEL = 100
EXTRAVERSION =
EXTRAVERSION =
NAME = Roaring Lionus
NAME = Roaring Lionus


+5 −3
Original line number Original line Diff line number Diff line
@@ -299,7 +299,6 @@ kvm_novcpu_exit:
	stw	r12, STACK_SLOT_TRAP(r1)
	stw	r12, STACK_SLOT_TRAP(r1)
	bl	kvmhv_commence_exit
	bl	kvmhv_commence_exit
	nop
	nop
	lwz	r12, STACK_SLOT_TRAP(r1)
	b	kvmhv_switch_to_host
	b	kvmhv_switch_to_host


/*
/*
@@ -1023,6 +1022,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)


secondary_too_late:
secondary_too_late:
	li	r12, 0
	li	r12, 0
	stw	r12, STACK_SLOT_TRAP(r1)
	cmpdi	r4, 0
	cmpdi	r4, 0
	beq	11f
	beq	11f
	stw	r12, VCPU_TRAP(r4)
	stw	r12, VCPU_TRAP(r4)
@@ -1266,12 +1266,12 @@ mc_cont:
	bl	kvmhv_accumulate_time
	bl	kvmhv_accumulate_time
#endif
#endif


	stw	r12, STACK_SLOT_TRAP(r1)
	mr 	r3, r12
	mr 	r3, r12
	/* Increment exit count, poke other threads to exit */
	/* Increment exit count, poke other threads to exit */
	bl	kvmhv_commence_exit
	bl	kvmhv_commence_exit
	nop
	nop
	ld	r9, HSTATE_KVM_VCPU(r13)
	ld	r9, HSTATE_KVM_VCPU(r13)
	lwz	r12, VCPU_TRAP(r9)


	/* Stop others sending VCPU interrupts to this physical CPU */
	/* Stop others sending VCPU interrupts to this physical CPU */
	li	r0, -1
	li	r0, -1
@@ -1549,6 +1549,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
	 * POWER7/POWER8 guest -> host partition switch code.
	 * POWER7/POWER8 guest -> host partition switch code.
	 * We don't have to lock against tlbies but we do
	 * We don't have to lock against tlbies but we do
	 * have to coordinate the hardware threads.
	 * have to coordinate the hardware threads.
	 * Here STACK_SLOT_TRAP(r1) contains the trap number.
	 */
	 */
kvmhv_switch_to_host:
kvmhv_switch_to_host:
	/* Secondary threads wait for primary to do partition switch */
	/* Secondary threads wait for primary to do partition switch */
@@ -1599,11 +1600,11 @@ BEGIN_FTR_SECTION
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)


	/* If HMI, call kvmppc_realmode_hmi_handler() */
	/* If HMI, call kvmppc_realmode_hmi_handler() */
	lwz	r12, STACK_SLOT_TRAP(r1)
	cmpwi	r12, BOOK3S_INTERRUPT_HMI
	cmpwi	r12, BOOK3S_INTERRUPT_HMI
	bne	27f
	bne	27f
	bl	kvmppc_realmode_hmi_handler
	bl	kvmppc_realmode_hmi_handler
	nop
	nop
	li	r12, BOOK3S_INTERRUPT_HMI
	/*
	/*
	 * At this point kvmppc_realmode_hmi_handler would have resync-ed
	 * At this point kvmppc_realmode_hmi_handler would have resync-ed
	 * the TB. Hence it is not required to subtract guest timebase
	 * the TB. Hence it is not required to subtract guest timebase
@@ -1678,6 +1679,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
	li	r0, KVM_GUEST_MODE_NONE
	li	r0, KVM_GUEST_MODE_NONE
	stb	r0, HSTATE_IN_GUEST(r13)
	stb	r0, HSTATE_IN_GUEST(r13)


	lwz	r12, STACK_SLOT_TRAP(r1)	/* return trap # in r12 */
	ld	r0, SFS+PPC_LR_STKOFF(r1)
	ld	r0, SFS+PPC_LR_STKOFF(r1)
	addi	r1, r1, SFS
	addi	r1, r1, SFS
	mtlr	r0
	mtlr	r0
+7 −1
Original line number Original line Diff line number Diff line
@@ -26,6 +26,7 @@
#include <linux/cpu.h>
#include <linux/cpu.h>
#include <linux/bitops.h>
#include <linux/bitops.h>
#include <linux/device.h>
#include <linux/device.h>
#include <linux/nospec.h>


#include <asm/apic.h>
#include <asm/apic.h>
#include <asm/stacktrace.h>
#include <asm/stacktrace.h>
@@ -306,14 +307,17 @@ set_ext_hw_attr(struct hw_perf_event *hwc, struct perf_event *event)
	cache_type = (config >> 0) & 0xff;
	cache_type = (config >> 0) & 0xff;
	if (cache_type >= PERF_COUNT_HW_CACHE_MAX)
	if (cache_type >= PERF_COUNT_HW_CACHE_MAX)
		return -EINVAL;
		return -EINVAL;
	cache_type = array_index_nospec(cache_type, PERF_COUNT_HW_CACHE_MAX);


	cache_op = (config >>  8) & 0xff;
	cache_op = (config >>  8) & 0xff;
	if (cache_op >= PERF_COUNT_HW_CACHE_OP_MAX)
	if (cache_op >= PERF_COUNT_HW_CACHE_OP_MAX)
		return -EINVAL;
		return -EINVAL;
	cache_op = array_index_nospec(cache_op, PERF_COUNT_HW_CACHE_OP_MAX);


	cache_result = (config >> 16) & 0xff;
	cache_result = (config >> 16) & 0xff;
	if (cache_result >= PERF_COUNT_HW_CACHE_RESULT_MAX)
	if (cache_result >= PERF_COUNT_HW_CACHE_RESULT_MAX)
		return -EINVAL;
		return -EINVAL;
	cache_result = array_index_nospec(cache_result, PERF_COUNT_HW_CACHE_RESULT_MAX);


	val = hw_cache_event_ids[cache_type][cache_op][cache_result];
	val = hw_cache_event_ids[cache_type][cache_op][cache_result];


@@ -420,6 +424,8 @@ int x86_setup_perfctr(struct perf_event *event)
	if (attr->config >= x86_pmu.max_events)
	if (attr->config >= x86_pmu.max_events)
		return -EINVAL;
		return -EINVAL;


	attr->config = array_index_nospec((unsigned long)attr->config, x86_pmu.max_events);

	/*
	/*
	 * The generic map:
	 * The generic map:
	 */
	 */
+2 −0
Original line number Original line Diff line number Diff line
@@ -90,6 +90,7 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/perf_event.h>
#include <linux/perf_event.h>
#include <linux/nospec.h>
#include <asm/cpu_device_id.h>
#include <asm/cpu_device_id.h>
#include <asm/intel-family.h>
#include <asm/intel-family.h>
#include "../perf_event.h"
#include "../perf_event.h"
@@ -300,6 +301,7 @@ static int cstate_pmu_event_init(struct perf_event *event)
	} else if (event->pmu == &cstate_pkg_pmu) {
	} else if (event->pmu == &cstate_pkg_pmu) {
		if (cfg >= PERF_CSTATE_PKG_EVENT_MAX)
		if (cfg >= PERF_CSTATE_PKG_EVENT_MAX)
			return -EINVAL;
			return -EINVAL;
		cfg = array_index_nospec((unsigned long)cfg, PERF_CSTATE_PKG_EVENT_MAX);
		if (!pkg_msr[cfg].attr)
		if (!pkg_msr[cfg].attr)
			return -EINVAL;
			return -EINVAL;
		event->hw.event_base = pkg_msr[cfg].msr;
		event->hw.event_base = pkg_msr[cfg].msr;
+6 −3
Original line number Original line Diff line number Diff line
#include <linux/perf_event.h>
#include <linux/perf_event.h>
#include <linux/nospec.h>
#include <asm/intel-family.h>
#include <asm/intel-family.h>


enum perf_msr_id {
enum perf_msr_id {
@@ -136,9 +137,6 @@ static int msr_event_init(struct perf_event *event)
	if (event->attr.type != event->pmu->type)
	if (event->attr.type != event->pmu->type)
		return -ENOENT;
		return -ENOENT;


	if (cfg >= PERF_MSR_EVENT_MAX)
		return -EINVAL;

	/* unsupported modes and filters */
	/* unsupported modes and filters */
	if (event->attr.exclude_user   ||
	if (event->attr.exclude_user   ||
	    event->attr.exclude_kernel ||
	    event->attr.exclude_kernel ||
@@ -149,6 +147,11 @@ static int msr_event_init(struct perf_event *event)
	    event->attr.sample_period) /* no sampling */
	    event->attr.sample_period) /* no sampling */
		return -EINVAL;
		return -EINVAL;


	if (cfg >= PERF_MSR_EVENT_MAX)
		return -EINVAL;

	cfg = array_index_nospec((unsigned long)cfg, PERF_MSR_EVENT_MAX);

	if (!msr[cfg].attr)
	if (!msr[cfg].attr)
		return -EINVAL;
		return -EINVAL;


Loading