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

Commit 864aacfa authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge 4.14.76 into android-4.14-p



Changes in 4.14.76
	perf/core: Add sanity check to deal with pinned event failure
	mm: migration: fix migration of huge PMD shared pages
	mm, thp: fix mlocking THP page with migration enabled
	mm/vmstat.c: skip NR_TLB_REMOTE_FLUSH* properly
	KVM: x86: fix L1TF's MMIO GFN calculation
	blk-mq: I/O and timer unplugs are inverted in blktrace
	clocksource/drivers/timer-atmel-pit: Properly handle error cases
	fbdev/omapfb: fix omapfb_memory_read infoleak
	xen-netback: fix input validation in xenvif_set_hash_mapping()
	drm/amdgpu: Fix vce work queue was not cancelled when suspend
	drm/syncobj: Don't leak fences when WAIT_FOR_SUBMIT is set
	x86/vdso: Fix asm constraints on vDSO syscall fallbacks
	selftests/x86: Add clock_gettime() tests to test_vdso
	x86/vdso: Only enable vDSO retpolines when enabled and supported
	x86/vdso: Fix vDSO syscall fallback asm constraint regression
	PCI: Reprogram bridge prefetch registers on resume
	mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode keys
	PM / core: Clear the direct_complete flag on errors
	dm cache metadata: ignore hints array being too small during resize
	dm cache: fix resize crash if user doesn't reload cache table
	xhci: Add missing CAS workaround for Intel Sunrise Point xHCI
	usb: xhci-mtk: resume USB3 roothub first
	USB: serial: simple: add Motorola Tetra MTP6550 id
	usb: cdc_acm: Do not leak URB buffers
	tty: Drop tty->count on tty_reopen() failure
	of: unittest: Disable interrupt node tests for old world MAC systems
	perf annotate: Use asprintf when formatting objdump command line
	perf tools: Fix python extension build for gcc 8
	ath10k: fix use-after-free in ath10k_wmi_cmd_send_nowait
	ath10k: fix kernel panic issue during pci probe
	nvme_fc: fix ctrl create failures racing with workq items
	powerpc/lib/code-patching: refactor patch_instruction()
	powerpc: Avoid code patching freed init sections
	powerpc/lib: fix book3s/32 boot failure due to code patching
	ARC: clone syscall to setp r25 as thread pointer
	crypto: chelsio - Fix memory corruption in DMA Mapped buffers.
	perf utils: Move is_directory() to path.h
	f2fs: fix invalid memory access
	ucma: fix a use-after-free in ucma_resolve_ip()
	ubifs: Check for name being NULL while mounting
	rds: rds_ib_recv_alloc_cache() should call alloc_percpu_gfp() instead
	virtio_balloon: fix deadlock on OOM
	virtio_balloon: fix increment of vb->num_pfns in fill_balloon()
	ath10k: fix scan crash due to incorrect length calculation
	Linux 4.14.76

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parents 94682864 0b46ce3e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 75
SUBLEVEL = 76
EXTRAVERSION =
NAME = Petit Gorille

+20 −0
Original line number Diff line number Diff line
@@ -241,6 +241,26 @@ int copy_thread(unsigned long clone_flags,
		task_thread_info(current)->thr_ptr;
	}


	/*
	 * setup usermode thread pointer #1:
	 * when child is picked by scheduler, __switch_to() uses @c_callee to
	 * populate usermode callee regs: this works (despite being in a kernel
	 * function) since special return path for child @ret_from_fork()
	 * ensures those regs are not clobbered all the way to RTIE to usermode
	 */
	c_callee->r25 = task_thread_info(p)->thr_ptr;

#ifdef CONFIG_ARC_CURR_IN_REG
	/*
	 * setup usermode thread pointer #2:
	 * however for this special use of r25 in kernel, __switch_to() sets
	 * r25 for kernel needs and only in the final return path is usermode
	 * r25 setup, from pt_regs->user_r25. So set that up as well
	 */
	c_regs->user_r25 = c_callee->r25;
#endif

	return 0;
}

+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ extern void ppc_printk_progress(char *s, unsigned short hex);

extern unsigned int rtas_data;
extern unsigned long long memory_limit;
extern bool init_mem_is_free;
extern unsigned long klimit;
extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);

+28 −17
Original line number Diff line number Diff line
@@ -22,20 +22,28 @@
#include <asm/page.h>
#include <asm/code-patching.h>
#include <asm/setup.h>
#include <asm/sections.h>

static int __patch_instruction(unsigned int *addr, unsigned int instr)
static int __patch_instruction(unsigned int *exec_addr, unsigned int instr,
			       unsigned int *patch_addr)
{
	int err;

	__put_user_size(instr, addr, 4, err);
	__put_user_size(instr, patch_addr, 4, err);
	if (err)
		return err;

	asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" :: "r" (addr));
	asm ("dcbst 0, %0; sync; icbi 0,%1; sync; isync" :: "r" (patch_addr),
							    "r" (exec_addr));

	return 0;
}

static int raw_patch_instruction(unsigned int *addr, unsigned int instr)
{
	return __patch_instruction(addr, instr, addr);
}

#ifdef CONFIG_STRICT_KERNEL_RWX
static DEFINE_PER_CPU(struct vm_struct *, text_poke_area);

@@ -135,10 +143,10 @@ static inline int unmap_patch_area(unsigned long addr)
	return 0;
}

int patch_instruction(unsigned int *addr, unsigned int instr)
static int do_patch_instruction(unsigned int *addr, unsigned int instr)
{
	int err;
	unsigned int *dest = NULL;
	unsigned int *patch_addr = NULL;
	unsigned long flags;
	unsigned long text_poke_addr;
	unsigned long kaddr = (unsigned long)addr;
@@ -149,7 +157,7 @@ int patch_instruction(unsigned int *addr, unsigned int instr)
	 * to allow patching. We just do the plain old patching
	 */
	if (!this_cpu_read(*PTRRELOC(&text_poke_area)))
		return __patch_instruction(addr, instr);
		return raw_patch_instruction(addr, instr);

	local_irq_save(flags);

@@ -159,17 +167,10 @@ int patch_instruction(unsigned int *addr, unsigned int instr)
		goto out;
	}

	dest = (unsigned int *)(text_poke_addr) +
	patch_addr = (unsigned int *)(text_poke_addr) +
			((kaddr & ~PAGE_MASK) / sizeof(unsigned int));

	/*
	 * We use __put_user_size so that we can handle faults while
	 * writing to dest and return err to handle faults gracefully
	 */
	__put_user_size(instr, dest, 4, err);
	if (!err)
		asm ("dcbst 0, %0; sync; icbi 0,%0; icbi 0,%1; sync; isync"
			::"r" (dest), "r"(addr));
	__patch_instruction(addr, instr, patch_addr);

	err = unmap_patch_area(text_poke_addr);
	if (err)
@@ -182,12 +183,22 @@ int patch_instruction(unsigned int *addr, unsigned int instr)
}
#else /* !CONFIG_STRICT_KERNEL_RWX */

int patch_instruction(unsigned int *addr, unsigned int instr)
static int do_patch_instruction(unsigned int *addr, unsigned int instr)
{
	return __patch_instruction(addr, instr);
	return raw_patch_instruction(addr, instr);
}

#endif /* CONFIG_STRICT_KERNEL_RWX */

int patch_instruction(unsigned int *addr, unsigned int instr)
{
	/* Make sure we aren't patching a freed init section */
	if (init_mem_is_free && init_section_contains(addr, 4)) {
		pr_debug("Skipping init section patching addr: 0x%px\n", addr);
		return 0;
	}
	return do_patch_instruction(addr, instr);
}
NOKPROBE_SYMBOL(patch_instruction);

int patch_branch(unsigned int *addr, unsigned long target, int flags)
+2 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@
#endif

unsigned long long memory_limit;
bool init_mem_is_free;

#ifdef CONFIG_HIGHMEM
pte_t *kmap_pte;
@@ -405,6 +406,7 @@ void free_initmem(void)
{
	ppc_md.progress = ppc_printk_progress;
	mark_initmem_nx();
	init_mem_is_free = true;
	free_initmem_default(POISON_FREE_INITMEM);
}

Loading