Skip to content

Commit

Permalink
Merge 4.14.69 into android-4.14-p
Browse files Browse the repository at this point in the history
Changes in 4.14.69
	net: 6lowpan: fix reserved space for single frames
	net: mac802154: tx: expand tailroom if necessary
	9p/net: Fix zero-copy path in the 9p virtio transport
	spi: davinci: fix a NULL pointer dereference
	spi: pxa2xx: Add support for Intel Ice Lake
	spi: spi-fsl-dspi: Fix imprecise abort on VF500 during probe
	spi: cadence: Change usleep_range() to udelay(), for atomic context
	mmc: renesas_sdhi_internal_dmac: fix #define RST_RESERVED_BITS
	readahead: stricter check for bdi io_pages
	block: blk_init_allocated_queue() set q->fq as NULL in the fail case
	block: really disable runtime-pm for blk-mq
	drm/i915/userptr: reject zero user_size
	libertas: fix suspend and resume for SDIO connected cards
	media: Revert "[media] tvp5150: fix pad format frame height"
	mailbox: xgene-slimpro: Fix potential NULL pointer dereference
	Replace magic for trusting the secondary keyring with #define
	Fix kexec forbidding kernels signed with keys in the secondary keyring to boot
	powerpc/fadump: handle crash memory ranges array index overflow
	powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
	PCI: Add wrappers for dev_printk()
	powerpc/powernv/pci: Work around races in PCI bridge enabling
	cxl: Fix wrong comparison in cxl_adapter_context_get()
	ib_srpt: Fix a use-after-free in srpt_close_ch()
	RDMA/rxe: Set wqe->status correctly if an unexpected response is received
	9p: fix multiple NULL-pointer-dereferences
	fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed
	9p/virtio: fix off-by-one error in sg list bounds check
	net/9p/client.c: version pointer uninitialized
	net/9p/trans_fd.c: fix race-condition by flushing workqueue before the kfree()
	dm integrity: change 'suspending' variable from bool to int
	dm thin: stop no_space_timeout worker when switching to write-mode
	dm cache metadata: save in-core policy_hint_size to on-disk superblock
	dm cache metadata: set dirty on all cache blocks after a crash
	dm crypt: don't decrease device limits
	uart: fix race between uart_put_char() and uart_shutdown()
	Drivers: hv: vmbus: Reset the channel callback in vmbus_onoffer_rescind()
	iio: sca3000: Fix missing return in switch
	iio: ad9523: Fix displayed phase
	iio: ad9523: Fix return value for ad952x_store()
	extcon: Release locking when sending the notification of connector state
	vmw_balloon: fix inflation of 64-bit GFNs
	vmw_balloon: do not use 2MB without batching
	vmw_balloon: VMCI_DOORBELL_SET does not check status
	vmw_balloon: fix VMCI use when balloon built into kernel
	rtc: omap: fix potential crash on power off
	tracing: Do not call start/stop() functions when tracing_on does not change
	tracing/blktrace: Fix to allow setting same value
	printk/tracing: Do not trace printk_nmi_enter()
	livepatch: Validate module/old func name length
	uprobes: Use synchronize_rcu() not synchronize_sched()
	mfd: hi655x: Fix regmap area declared size for hi655x
	ovl: fix wrong use of impure dir cache in ovl_iterate()
	drivers/block/zram/zram_drv.c: fix bug storing backing_dev
	cpufreq: governor: Avoid accessing invalid governor_data
	PM / sleep: wakeup: Fix build error caused by missing SRCU support
	KVM: VMX: fixes for vmentry_l1d_flush module parameter
	KVM: PPC: Book3S: Fix guest DMA when guest partially backed by THP pages
	xtensa: limit offsets in __loop_cache_{all,page}
	xtensa: increase ranges in ___invalidate_{i,d}cache_all
	block, bfq: return nbytes and not zero from struct cftype .write() method
	pnfs/blocklayout: off by one in bl_map_stripe()
	NFSv4 client live hangs after live data migration recovery
	NFSv4: Fix locking in pnfs_generic_recover_commit_reqs
	NFSv4: Fix a sleep in atomic context in nfs4_callback_sequence()
	ARM: tegra: Fix Tegra30 Cardhu PCA954x reset
	mm/tlb: Remove tlb_remove_table() non-concurrent condition
	iommu/vt-d: Add definitions for PFSID
	iommu/vt-d: Fix dev iotlb pfsid use
	sys: don't hold uts_sem while accessing userspace memory
	userns: move user access out of the mutex
	ubifs: Fix memory leak in lprobs self-check
	Revert "UBIFS: Fix potential integer overflow in allocation"
	ubifs: Check data node size before truncate
	ubifs: xattr: Don't operate on deleted inodes
	ubifs: Fix synced_i_size calculation for xattr inodes
	pwm: tiehrpwm: Don't use emulation mode bits to control PWM output
	pwm: tiehrpwm: Fix disabling of output of PWMs
	fb: fix lost console when the user unplugs a USB adapter
	udlfb: set optimal write delay
	getxattr: use correct xattr length
	libnvdimm: fix ars_status output length calculation
	bcache: release dc->writeback_lock properly in bch_writeback_thread()
	cap_inode_getsecurity: use d_find_any_alias() instead of d_find_alias()
	perf auxtrace: Fix queue resize
	crypto: vmx - Fix sleep-in-atomic bugs
	crypto: caam - fix DMA mapping direction for RSA forms 2 & 3
	crypto: caam/jr - fix descriptor DMA unmapping
	crypto: caam/qi - fix error path in xts setkey
	fs/quota: Fix spectre gadget in do_quotactl
	arm64: mm: always enable CONFIG_HOLES_IN_ZONE
	Linux 4.14.69

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
  • Loading branch information
gregkh committed Sep 10, 2018
2 parents 289a3f3 + 7fe7a0f commit c535ee7
Show file tree
Hide file tree
Showing 95 changed files with 842 additions and 420 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 68
SUBLEVEL = 69
EXTRAVERSION =
NAME = Petit Gorille

Expand Down
51 changes: 24 additions & 27 deletions arch/alpha/kernel/osf_sys.c
Expand Up @@ -530,24 +530,19 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, const char __user *, path,
SYSCALL_DEFINE1(osf_utsname, char __user *, name)
{
int error;
char tmp[5 * 32];

down_read(&uts_sem);
error = -EFAULT;
if (copy_to_user(name + 0, utsname()->sysname, 32))
goto out;
if (copy_to_user(name + 32, utsname()->nodename, 32))
goto out;
if (copy_to_user(name + 64, utsname()->release, 32))
goto out;
if (copy_to_user(name + 96, utsname()->version, 32))
goto out;
if (copy_to_user(name + 128, utsname()->machine, 32))
goto out;
memcpy(tmp + 0 * 32, utsname()->sysname, 32);
memcpy(tmp + 1 * 32, utsname()->nodename, 32);
memcpy(tmp + 2 * 32, utsname()->release, 32);
memcpy(tmp + 3 * 32, utsname()->version, 32);
memcpy(tmp + 4 * 32, utsname()->machine, 32);
up_read(&uts_sem);

error = 0;
out:
up_read(&uts_sem);
return error;
if (copy_to_user(name, tmp, sizeof(tmp)))
return -EFAULT;
return 0;
}

SYSCALL_DEFINE0(getpagesize)
Expand All @@ -567,18 +562,21 @@ SYSCALL_DEFINE2(osf_getdomainname, char __user *, name, int, namelen)
{
int len, err = 0;
char *kname;
char tmp[32];

if (namelen > 32)
if (namelen < 0 || namelen > 32)
namelen = 32;

down_read(&uts_sem);
kname = utsname()->domainname;
len = strnlen(kname, namelen);
if (copy_to_user(name, kname, min(len + 1, namelen)))
err = -EFAULT;
len = min(len + 1, namelen);
memcpy(tmp, kname, len);
up_read(&uts_sem);

return err;
if (copy_to_user(name, tmp, len))
return -EFAULT;
return 0;
}

/*
Expand Down Expand Up @@ -739,27 +737,26 @@ SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count)
};
unsigned long offset;
const char *res;
long len, err = -EINVAL;
long len;
char tmp[__NEW_UTS_LEN + 1];

offset = command-1;
if (offset >= ARRAY_SIZE(sysinfo_table)) {
/* Digital UNIX has a few unpublished interfaces here */
printk("sysinfo(%d)", command);
goto out;
return -EINVAL;
}

down_read(&uts_sem);
res = sysinfo_table[offset];
len = strlen(res)+1;
if ((unsigned long)len > (unsigned long)count)
len = count;
if (copy_to_user(buf, res, len))
err = -EFAULT;
else
err = 0;
memcpy(tmp, res, len);
up_read(&uts_sem);
out:
return err;
if (copy_to_user(buf, tmp, len))
return -EFAULT;
return 0;
}

SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer,
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/tegra30-cardhu.dtsi
Expand Up @@ -206,6 +206,7 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <0x70>;
reset-gpio = <&gpio TEGRA_GPIO(BB, 0) GPIO_ACTIVE_LOW>;
};
};

Expand Down
1 change: 0 additions & 1 deletion arch/arm64/Kconfig
Expand Up @@ -694,7 +694,6 @@ config NEED_PER_CPU_EMBED_FIRST_CHUNK

config HOLES_IN_ZONE
def_bool y
depends on NUMA

source kernel/Kconfig.preempt
source kernel/Kconfig.hz
Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/include/asm/fadump.h
Expand Up @@ -195,9 +195,6 @@ struct fadump_crash_info_header {
struct cpumask online_mask;
};

/* Crash memory ranges */
#define INIT_CRASHMEM_RANGES (INIT_MEMBLOCK_REGIONS + 2)

struct fad_crash_memory_ranges {
unsigned long long base;
unsigned long long size;
Expand Down
91 changes: 77 additions & 14 deletions arch/powerpc/kernel/fadump.c
Expand Up @@ -47,8 +47,10 @@ static struct fadump_mem_struct fdm;
static const struct fadump_mem_struct *fdm_active;

static DEFINE_MUTEX(fadump_mutex);
struct fad_crash_memory_ranges crash_memory_ranges[INIT_CRASHMEM_RANGES];
struct fad_crash_memory_ranges *crash_memory_ranges;
int crash_memory_ranges_size;
int crash_mem_ranges;
int max_crash_mem_ranges;

/* Scan the Firmware Assisted dump configuration details. */
int __init early_init_dt_scan_fw_dump(unsigned long node,
Expand Down Expand Up @@ -843,38 +845,88 @@ static int __init process_fadump(const struct fadump_mem_struct *fdm_active)
return 0;
}

static inline void fadump_add_crash_memory(unsigned long long base,
unsigned long long end)
static void free_crash_memory_ranges(void)
{
kfree(crash_memory_ranges);
crash_memory_ranges = NULL;
crash_memory_ranges_size = 0;
max_crash_mem_ranges = 0;
}

/*
* Allocate or reallocate crash memory ranges array in incremental units
* of PAGE_SIZE.
*/
static int allocate_crash_memory_ranges(void)
{
struct fad_crash_memory_ranges *new_array;
u64 new_size;

new_size = crash_memory_ranges_size + PAGE_SIZE;
pr_debug("Allocating %llu bytes of memory for crash memory ranges\n",
new_size);

new_array = krealloc(crash_memory_ranges, new_size, GFP_KERNEL);
if (new_array == NULL) {
pr_err("Insufficient memory for setting up crash memory ranges\n");
free_crash_memory_ranges();
return -ENOMEM;
}

crash_memory_ranges = new_array;
crash_memory_ranges_size = new_size;
max_crash_mem_ranges = (new_size /
sizeof(struct fad_crash_memory_ranges));
return 0;
}

static inline int fadump_add_crash_memory(unsigned long long base,
unsigned long long end)
{
if (base == end)
return;
return 0;

if (crash_mem_ranges == max_crash_mem_ranges) {
int ret;

ret = allocate_crash_memory_ranges();
if (ret)
return ret;
}

pr_debug("crash_memory_range[%d] [%#016llx-%#016llx], %#llx bytes\n",
crash_mem_ranges, base, end - 1, (end - base));
crash_memory_ranges[crash_mem_ranges].base = base;
crash_memory_ranges[crash_mem_ranges].size = end - base;
crash_mem_ranges++;
return 0;
}

static void fadump_exclude_reserved_area(unsigned long long start,
static int fadump_exclude_reserved_area(unsigned long long start,
unsigned long long end)
{
unsigned long long ra_start, ra_end;
int ret = 0;

ra_start = fw_dump.reserve_dump_area_start;
ra_end = ra_start + fw_dump.reserve_dump_area_size;

if ((ra_start < end) && (ra_end > start)) {
if ((start < ra_start) && (end > ra_end)) {
fadump_add_crash_memory(start, ra_start);
fadump_add_crash_memory(ra_end, end);
ret = fadump_add_crash_memory(start, ra_start);
if (ret)
return ret;

ret = fadump_add_crash_memory(ra_end, end);
} else if (start < ra_start) {
fadump_add_crash_memory(start, ra_start);
ret = fadump_add_crash_memory(start, ra_start);
} else if (ra_end < end) {
fadump_add_crash_memory(ra_end, end);
ret = fadump_add_crash_memory(ra_end, end);
}
} else
fadump_add_crash_memory(start, end);
ret = fadump_add_crash_memory(start, end);

return ret;
}

static int fadump_init_elfcore_header(char *bufp)
Expand Down Expand Up @@ -914,10 +966,11 @@ static int fadump_init_elfcore_header(char *bufp)
* Traverse through memblock structure and setup crash memory ranges. These
* ranges will be used create PT_LOAD program headers in elfcore header.
*/
static void fadump_setup_crash_memory_ranges(void)
static int fadump_setup_crash_memory_ranges(void)
{
struct memblock_region *reg;
unsigned long long start, end;
int ret;

pr_debug("Setup crash memory ranges.\n");
crash_mem_ranges = 0;
Expand All @@ -928,7 +981,9 @@ static void fadump_setup_crash_memory_ranges(void)
* specified during fadump registration. We need to create a separate
* program header for this chunk with the correct offset.
*/
fadump_add_crash_memory(RMA_START, fw_dump.boot_memory_size);
ret = fadump_add_crash_memory(RMA_START, fw_dump.boot_memory_size);
if (ret)
return ret;

for_each_memblock(memory, reg) {
start = (unsigned long long)reg->base;
Expand All @@ -948,8 +1003,12 @@ static void fadump_setup_crash_memory_ranges(void)
}

/* add this range excluding the reserved dump area. */
fadump_exclude_reserved_area(start, end);
ret = fadump_exclude_reserved_area(start, end);
if (ret)
return ret;
}

return 0;
}

/*
Expand Down Expand Up @@ -1072,6 +1131,7 @@ static int register_fadump(void)
{
unsigned long addr;
void *vaddr;
int ret;

/*
* If no memory is reserved then we can not register for firmware-
Expand All @@ -1080,7 +1140,9 @@ static int register_fadump(void)
if (!fw_dump.reserve_dump_area_size)
return -ENODEV;

fadump_setup_crash_memory_ranges();
ret = fadump_setup_crash_memory_ranges();
if (ret)
return ret;

addr = be64_to_cpu(fdm.rmr_region.destination_address) + be64_to_cpu(fdm.rmr_region.source_len);
/* Initialize fadump crash info header. */
Expand Down Expand Up @@ -1158,6 +1220,7 @@ void fadump_cleanup(void)
} else if (fw_dump.dump_registered) {
/* Un-register Firmware-assisted dump if it was registered. */
fadump_unregister_dump(&fdm);
free_crash_memory_ranges();
}
}

Expand Down
17 changes: 10 additions & 7 deletions arch/powerpc/mm/mmu_context_iommu.c
Expand Up @@ -130,6 +130,7 @@ long mm_iommu_get(struct mm_struct *mm, unsigned long ua, unsigned long entries,
long i, j, ret = 0, locked_entries = 0;
unsigned int pageshift;
unsigned long flags;
unsigned long cur_ua;
struct page *page = NULL;

mutex_lock(&mem_list_mutex);
Expand Down Expand Up @@ -178,7 +179,8 @@ long mm_iommu_get(struct mm_struct *mm, unsigned long ua, unsigned long entries,
}

for (i = 0; i < entries; ++i) {
if (1 != get_user_pages_fast(ua + (i << PAGE_SHIFT),
cur_ua = ua + (i << PAGE_SHIFT);
if (1 != get_user_pages_fast(cur_ua,
1/* pages */, 1/* iswrite */, &page)) {
ret = -EFAULT;
for (j = 0; j < i; ++j)
Expand All @@ -197,7 +199,7 @@ long mm_iommu_get(struct mm_struct *mm, unsigned long ua, unsigned long entries,
if (is_migrate_cma_page(page)) {
if (mm_iommu_move_page_from_cma(page))
goto populate;
if (1 != get_user_pages_fast(ua + (i << PAGE_SHIFT),
if (1 != get_user_pages_fast(cur_ua,
1/* pages */, 1/* iswrite */,
&page)) {
ret = -EFAULT;
Expand All @@ -211,20 +213,21 @@ long mm_iommu_get(struct mm_struct *mm, unsigned long ua, unsigned long entries,
}
populate:
pageshift = PAGE_SHIFT;
if (PageCompound(page)) {
if (mem->pageshift > PAGE_SHIFT && PageCompound(page)) {
pte_t *pte;
struct page *head = compound_head(page);
unsigned int compshift = compound_order(head);
unsigned int pteshift;

local_irq_save(flags); /* disables as well */
pte = find_linux_pte(mm->pgd, ua, NULL, &pageshift);
local_irq_restore(flags);
pte = find_linux_pte(mm->pgd, cur_ua, NULL, &pteshift);

/* Double check it is still the same pinned page */
if (pte && pte_page(*pte) == head &&
pageshift == compshift)
pageshift = max_t(unsigned int, pageshift,
pteshift == compshift + PAGE_SHIFT)
pageshift = max_t(unsigned int, pteshift,
PAGE_SHIFT);
local_irq_restore(flags);
}
mem->pageshift = min(mem->pageshift, pageshift);
mem->hpas[i] = page_to_pfn(page) << PAGE_SHIFT;
Expand Down

0 comments on commit c535ee7

Please sign in to comment.