diff -druNp --no-dereference linux-libre-3.18.137-gnu/arch/arm/Kconfig linux-libre-3.18.138-gnu/arch/arm/Kconfig
--- linux-libre-3.18.137-gnu/arch/arm/Kconfig	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/arch/arm/Kconfig	2019-04-03 00:22:15.000000000 -0400
@@ -1432,8 +1432,7 @@ config BIG_LITTLE
 
 config BL_SWITCHER
 	bool "big.LITTLE switcher support"
-	depends on BIG_LITTLE && MCPM && HOTPLUG_CPU
-	select ARM_CPU_SUSPEND
+	depends on BIG_LITTLE && MCPM && HOTPLUG_CPU && ARM_GIC
 	select CPU_PM
 	help
 	  The big.LITTLE "switcher" provides the core functionality to
@@ -2153,7 +2152,8 @@ config ARCH_SUSPEND_POSSIBLE
 	def_bool y
 
 config ARM_CPU_SUSPEND
-	def_bool PM_SLEEP
+	def_bool PM_SLEEP || BL_SWITCHER
+	depends on ARCH_SUSPEND_POSSIBLE
 
 config ARCH_HIBERNATION_POSSIBLE
 	bool
diff -druNp --no-dereference linux-libre-3.18.137-gnu/arch/arm/mach-imx/cpuidle-imx6q.c linux-libre-3.18.138-gnu/arch/arm/mach-imx/cpuidle-imx6q.c
--- linux-libre-3.18.137-gnu/arch/arm/mach-imx/cpuidle-imx6q.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/arch/arm/mach-imx/cpuidle-imx6q.c	2019-04-03 00:22:15.000000000 -0400
@@ -15,30 +15,23 @@
 #include "cpuidle.h"
 #include "hardware.h"
 
-static atomic_t master = ATOMIC_INIT(0);
-static DEFINE_SPINLOCK(master_lock);
+static int num_idle_cpus = 0;
+static DEFINE_SPINLOCK(cpuidle_lock);
 
 static int imx6q_enter_wait(struct cpuidle_device *dev,
 			    struct cpuidle_driver *drv, int index)
 {
-	if (atomic_inc_return(&master) == num_online_cpus()) {
-		/*
-		 * With this lock, we prevent other cpu to exit and enter
-		 * this function again and become the master.
-		 */
-		if (!spin_trylock(&master_lock))
-			goto idle;
+	spin_lock(&cpuidle_lock);
+	if (++num_idle_cpus == num_online_cpus())
 		imx6q_set_lpm(WAIT_UNCLOCKED);
-		cpu_do_idle();
-		imx6q_set_lpm(WAIT_CLOCKED);
-		spin_unlock(&master_lock);
-		goto done;
-	}
+	spin_unlock(&cpuidle_lock);
 
-idle:
 	cpu_do_idle();
-done:
-	atomic_dec(&master);
+
+	spin_lock(&cpuidle_lock);
+	if (num_idle_cpus-- == num_online_cpus())
+		imx6q_set_lpm(WAIT_CLOCKED);
+	spin_unlock(&cpuidle_lock);
 
 	return index;
 }
diff -druNp --no-dereference linux-libre-3.18.137-gnu/arch/arm64/include/asm/page.h linux-libre-3.18.138-gnu/arch/arm64/include/asm/page.h
--- linux-libre-3.18.137-gnu/arch/arm64/include/asm/page.h	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/arch/arm64/include/asm/page.h	2019-04-03 00:22:15.000000000 -0400
@@ -19,6 +19,8 @@
 #ifndef __ASM_PAGE_H
 #define __ASM_PAGE_H
 
+#include <linux/const.h>
+
 /* PAGE_SHIFT determines the page size */
 #ifdef CONFIG_ARM64_64K_PAGES
 #define PAGE_SHIFT		16
diff -druNp --no-dereference linux-libre-3.18.137-gnu/arch/arm64/include/asm/shmparam.h linux-libre-3.18.138-gnu/arch/arm64/include/asm/shmparam.h
--- linux-libre-3.18.137-gnu/arch/arm64/include/asm/shmparam.h	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/arch/arm64/include/asm/shmparam.h	2019-04-03 00:22:15.000000000 -0400
@@ -21,7 +21,7 @@
  * alignment value. Since we don't have aliasing D-caches, the rest of
  * the time we can safely use PAGE_SIZE.
  */
-#define COMPAT_SHMLBA	0x4000
+#define COMPAT_SHMLBA	(4 * PAGE_SIZE)
 
 #include <asm-generic/shmparam.h>
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/arch/arm64/Kconfig linux-libre-3.18.138-gnu/arch/arm64/Kconfig
--- linux-libre-3.18.137-gnu/arch/arm64/Kconfig	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/arch/arm64/Kconfig	2019-04-03 00:22:15.000000000 -0400
@@ -69,7 +69,6 @@ config ARM64
 	select PERF_USE_VMALLOC
 	select POWER_RESET
 	select POWER_SUPPLY
-	select RTC_LIB
 	select SPARSE_IRQ
 	select SYSCTL_EXCEPTION_TRACE
 	select HAVE_CONTEXT_TRACKING
@@ -559,6 +558,10 @@ config SYSVIPC_COMPAT
 	def_bool y
 	depends on COMPAT && SYSVIPC
 
+config KEYS_COMPAT
+	def_bool y
+	depends on COMPAT && KEYS
+
 endmenu
 
 menu "Power management options"
diff -druNp --no-dereference linux-libre-3.18.137-gnu/arch/arm64/kernel/entry.S linux-libre-3.18.138-gnu/arch/arm64/kernel/entry.S
--- linux-libre-3.18.137-gnu/arch/arm64/kernel/entry.S	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/arch/arm64/kernel/entry.S	2019-04-03 00:22:15.000000000 -0400
@@ -234,7 +234,7 @@ END(vectors)
  * Invalid mode handlers
  */
 	.macro	inv_entry, el, reason, regsize = 64
-	kernel_entry el, \regsize
+	kernel_entry \el, \regsize
 	mov	x0, sp
 	mov	x1, #\reason
 	mrs	x2, esr_el1
diff -druNp --no-dereference linux-libre-3.18.137-gnu/Documentation/virtual/kvm/api.txt linux-libre-3.18.138-gnu/Documentation/virtual/kvm/api.txt
--- linux-libre-3.18.137-gnu/Documentation/virtual/kvm/api.txt	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/Documentation/virtual/kvm/api.txt	2019-04-03 00:22:15.000000000 -0400
@@ -13,7 +13,7 @@ of a virtual machine.  The ioctls belong
 
  - VM ioctls: These query and set attributes that affect an entire virtual
    machine, for example memory layout.  In addition a VM ioctl is used to
-   create virtual cpus (vcpus).
+   create virtual cpus (vcpus) and devices.
 
    Only run VM ioctls from the same process (address space) that was used
    to create the VM.
@@ -24,6 +24,11 @@ of a virtual machine.  The ioctls belong
    Only run vcpu ioctls from the same thread that was used to create the
    vcpu.
 
+ - device ioctls: These query and set attributes that control the operation
+   of a single device.
+
+   device ioctls must be issued from the same process (address space) that
+   was used to create the VM.
 
 2. File descriptors
 -------------------
@@ -32,10 +37,11 @@ The kvm API is centered around file desc
 open("/dev/kvm") obtains a handle to the kvm subsystem; this handle
 can be used to issue system ioctls.  A KVM_CREATE_VM ioctl on this
 handle will create a VM file descriptor which can be used to issue VM
-ioctls.  A KVM_CREATE_VCPU ioctl on a VM fd will create a virtual cpu
-and return a file descriptor pointing to it.  Finally, ioctls on a vcpu
-fd can be used to control the vcpu, including the important task of
-actually running guest code.
+ioctls.  A KVM_CREATE_VCPU or KVM_CREATE_DEVICE ioctl on a VM fd will
+create a virtual cpu or device and return a file descriptor pointing to
+the new resource.  Finally, ioctls on a vcpu or device fd can be used
+to control the vcpu or device.  For vcpus, this includes the important
+task of actually running guest code.
 
 In general file descriptors can be migrated among processes by means
 of fork() and the SCM_RIGHTS facility of unix domain socket.  These
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/gpio/gpio-adnp.c linux-libre-3.18.138-gnu/drivers/gpio/gpio-adnp.c
--- linux-libre-3.18.137-gnu/drivers/gpio/gpio-adnp.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/gpio/gpio-adnp.c	2019-04-03 00:22:15.000000000 -0400
@@ -137,8 +137,10 @@ static int adnp_gpio_direction_input(str
 	if (err < 0)
 		goto out;
 
-	if (err & BIT(pos))
-		err = -EACCES;
+	if (value & BIT(pos)) {
+		err = -EPERM;
+		goto out;
+	}
 
 	err = 0;
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/isdn/hardware/mISDN/hfcmulti.c linux-libre-3.18.138-gnu/drivers/isdn/hardware/mISDN/hfcmulti.c
--- linux-libre-3.18.137-gnu/drivers/isdn/hardware/mISDN/hfcmulti.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/isdn/hardware/mISDN/hfcmulti.c	2019-04-03 00:22:15.000000000 -0400
@@ -4370,7 +4370,8 @@ setup_pci(struct hfc_multi *hc, struct p
 	if (m->clock2)
 		test_and_set_bit(HFC_CHIP_CLOCK2, &hc->chip);
 
-	if (ent->device == 0xB410) {
+	if (ent->vendor == PCI_VENDOR_ID_DIGIUM &&
+	    ent->device == PCI_DEVICE_ID_DIGIUM_HFC4S) {
 		test_and_set_bit(HFC_CHIP_B410P, &hc->chip);
 		test_and_set_bit(HFC_CHIP_PCM_MASTER, &hc->chip);
 		test_and_clear_bit(HFC_CHIP_PCM_SLAVE, &hc->chip);
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/media/usb/uvc/uvc_ctrl.c linux-libre-3.18.138-gnu/drivers/media/usb/uvc/uvc_ctrl.c
--- linux-libre-3.18.137-gnu/drivers/media/usb/uvc/uvc_ctrl.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/media/usb/uvc/uvc_ctrl.c	2019-04-03 00:22:15.000000000 -0400
@@ -1202,7 +1202,7 @@ static void uvc_ctrl_fill_event(struct u
 
 	__uvc_query_v4l2_ctrl(chain, ctrl, mapping, &v4l2_ctrl);
 
-	memset(ev->reserved, 0, sizeof(ev->reserved));
+	memset(ev, 0, sizeof(*ev));
 	ev->type = V4L2_EVENT_CTRL;
 	ev->id = v4l2_ctrl.id;
 	ev->u.ctrl.value = value;
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/media/v4l2-core/v4l2-ctrls.c linux-libre-3.18.138-gnu/drivers/media/v4l2-core/v4l2-ctrls.c
--- linux-libre-3.18.137-gnu/drivers/media/v4l2-core/v4l2-ctrls.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/media/v4l2-core/v4l2-ctrls.c	2019-04-03 00:22:15.000000000 -0400
@@ -1208,7 +1208,7 @@ static u32 user_flags(const struct v4l2_
 
 static void fill_event(struct v4l2_event *ev, struct v4l2_ctrl *ctrl, u32 changes)
 {
-	memset(ev->reserved, 0, sizeof(ev->reserved));
+	memset(ev, 0, sizeof(*ev));
 	ev->type = V4L2_EVENT_CTRL;
 	ev->id = ctrl->id;
 	ev->u.ctrl.changes = changes;
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/mmc/card/block.c linux-libre-3.18.138-gnu/drivers/mmc/card/block.c
--- linux-libre-3.18.137-gnu/drivers/mmc/card/block.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/mmc/card/block.c	2019-04-03 00:22:15.000000000 -0400
@@ -166,11 +166,7 @@ static struct mmc_blk_data *mmc_blk_get(
 
 static inline int mmc_get_devidx(struct gendisk *disk)
 {
-	int devmaj = MAJOR(disk_devt(disk));
-	int devidx = MINOR(disk_devt(disk)) / perdev_minors;
-
-	if (!devmaj)
-		devidx = disk->first_minor / perdev_minors;
+	int devidx = disk->first_minor / perdev_minors;
 	return devidx;
 }
 
@@ -2152,6 +2148,7 @@ static struct mmc_blk_data *mmc_blk_allo
 	md->disk->queue = md->queue.queue;
 	md->disk->driverfs_dev = parent;
 	set_disk_ro(md->disk, md->read_only || default_ro);
+	md->disk->flags = GENHD_FL_EXT_DEVT;
 	if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT))
 		md->disk->flags |= GENHD_FL_NO_PART_SCAN;
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/mmc/core/mmc_ops.c linux-libre-3.18.138-gnu/drivers/mmc/core/mmc_ops.c
--- linux-libre-3.18.137-gnu/drivers/mmc/core/mmc_ops.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/mmc/core/mmc_ops.c	2019-04-03 00:22:15.000000000 -0400
@@ -490,7 +490,7 @@ int __mmc_switch(struct mmc_card *card,
 		timeout_ms = MMC_OPS_TIMEOUT_MS;
 
 	/* Must check status to be sure of no errors. */
-	timeout = jiffies + msecs_to_jiffies(timeout_ms);
+	timeout = jiffies + msecs_to_jiffies(timeout_ms) + 1;
 	do {
 		if (send_status) {
 			err = __mmc_send_status(card, &status, ignore_crc);
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/mmc/host/tmio_mmc_pio.c linux-libre-3.18.138-gnu/drivers/mmc/host/tmio_mmc_pio.c
--- linux-libre-3.18.137-gnu/drivers/mmc/host/tmio_mmc_pio.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/mmc/host/tmio_mmc_pio.c	2019-04-03 00:22:15.000000000 -0400
@@ -714,7 +714,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, v
 	unsigned int sdio_status;
 
 	if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
-		return IRQ_HANDLED;
+		return IRQ_NONE;
 
 	status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
 	ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask;
@@ -728,7 +728,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, v
 	if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
 		mmc_signal_sdio_irq(mmc);
 
-	return IRQ_HANDLED;
+	return IRQ_RETVAL(ireg);
 }
 EXPORT_SYMBOL(tmio_mmc_sdio_irq);
 
@@ -745,9 +745,7 @@ irqreturn_t tmio_mmc_irq(int irq, void *
 	if (__tmio_mmc_sdcard_irq(host, ireg, status))
 		return IRQ_HANDLED;
 
-	tmio_mmc_sdio_irq(irq, devid);
-
-	return IRQ_HANDLED;
+	return tmio_mmc_sdio_irq(irq, devid);
 }
 EXPORT_SYMBOL(tmio_mmc_irq);
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/net/ethernet/8390/mac8390.c linux-libre-3.18.138-gnu/drivers/net/ethernet/8390/mac8390.c
--- linux-libre-3.18.137-gnu/drivers/net/ethernet/8390/mac8390.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/net/ethernet/8390/mac8390.c	2019-04-03 00:22:15.000000000 -0400
@@ -156,8 +156,6 @@ static void dayna_block_output(struct ne
 #define memcpy_fromio(a, b, c)	memcpy((a), (void *)(b), (c))
 #define memcpy_toio(a, b, c)	memcpy((void *)(a), (b), (c))
 
-#define memcmp_withio(a, b, c)	memcmp((a), (void *)(b), (c))
-
 /* Slow Sane (16-bit chunk memory read/write) Cabletron uses this */
 static void slow_sane_get_8390_hdr(struct net_device *dev,
 				   struct e8390_pkt_hdr *hdr, int ring_page);
@@ -237,19 +235,26 @@ static enum mac8390_type __init mac8390_
 
 static enum mac8390_access __init mac8390_testio(volatile unsigned long membase)
 {
-	unsigned long outdata = 0xA5A0B5B0;
-	unsigned long indata =  0x00000000;
+	u32 outdata = 0xA5A0B5B0;
+	u32 indata = 0;
+
 	/* Try writing 32 bits */
-	memcpy_toio(membase, &outdata, 4);
-	/* Now compare them */
-	if (memcmp_withio(&outdata, membase, 4) == 0)
+	nubus_writel(outdata, membase);
+	/* Now read it back */
+	indata = nubus_readl(membase);
+	if (outdata == indata)
 		return ACCESS_32;
+
+	outdata = 0xC5C0D5D0;
+	indata = 0;
+
 	/* Write 16 bit output */
 	word_memcpy_tocard(membase, &outdata, 4);
 	/* Now read it back */
 	word_memcpy_fromcard(&indata, membase, 4);
 	if (outdata == indata)
 		return ACCESS_16;
+
 	return ACCESS_UNKNOWN;
 }
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/s390/scsi/zfcp_erp.c linux-libre-3.18.138-gnu/drivers/s390/scsi/zfcp_erp.c
--- linux-libre-3.18.137-gnu/drivers/s390/scsi/zfcp_erp.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/s390/scsi/zfcp_erp.c	2019-04-03 00:22:15.000000000 -0400
@@ -583,6 +583,20 @@ static void zfcp_erp_strategy_memwait(st
 	add_timer(&erp_action->timer);
 }
 
+void zfcp_erp_port_forced_reopen_all(struct zfcp_adapter *adapter,
+				     int clear, char *dbftag)
+{
+	unsigned long flags;
+	struct zfcp_port *port;
+
+	write_lock_irqsave(&adapter->erp_lock, flags);
+	read_lock(&adapter->port_list_lock);
+	list_for_each_entry(port, &adapter->port_list, list)
+		_zfcp_erp_port_forced_reopen(port, clear, dbftag);
+	read_unlock(&adapter->port_list_lock);
+	write_unlock_irqrestore(&adapter->erp_lock, flags);
+}
+
 static void _zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter,
 				      int clear, char *id)
 {
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/s390/scsi/zfcp_ext.h linux-libre-3.18.138-gnu/drivers/s390/scsi/zfcp_ext.h
--- linux-libre-3.18.137-gnu/drivers/s390/scsi/zfcp_ext.h	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/s390/scsi/zfcp_ext.h	2019-04-03 00:22:15.000000000 -0400
@@ -56,6 +56,8 @@ extern void zfcp_erp_clear_port_status(s
 extern int  zfcp_erp_port_reopen(struct zfcp_port *, int, char *);
 extern void zfcp_erp_port_shutdown(struct zfcp_port *, int, char *);
 extern void zfcp_erp_port_forced_reopen(struct zfcp_port *, int, char *);
+extern void zfcp_erp_port_forced_reopen_all(struct zfcp_adapter *adapter,
+					    int clear, char *dbftag);
 extern void zfcp_erp_set_lun_status(struct scsi_device *, u32);
 extern void zfcp_erp_clear_lun_status(struct scsi_device *, u32);
 extern void zfcp_erp_lun_reopen(struct scsi_device *, int, char *);
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/s390/scsi/zfcp_scsi.c linux-libre-3.18.138-gnu/drivers/s390/scsi/zfcp_scsi.c
--- linux-libre-3.18.137-gnu/drivers/s390/scsi/zfcp_scsi.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/s390/scsi/zfcp_scsi.c	2019-04-03 00:22:15.000000000 -0400
@@ -294,6 +294,10 @@ static int zfcp_scsi_eh_host_reset_handl
 	struct zfcp_adapter *adapter = zfcp_sdev->port->adapter;
 	int ret;
 
+	if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE)) {
+		zfcp_erp_port_forced_reopen_all(adapter, 0, "schrh_p");
+		zfcp_erp_wait(adapter);
+	}
 	zfcp_erp_adapter_reopen(adapter, 0, "schrh_1");
 	zfcp_erp_wait(adapter);
 	ret = fc_block_scsi_eh(scpnt);
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/staging/android/ashmem.c linux-libre-3.18.138-gnu/drivers/staging/android/ashmem.c
--- linux-libre-3.18.137-gnu/drivers/staging/android/ashmem.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/staging/android/ashmem.c	2019-04-03 00:22:15.000000000 -0400
@@ -447,7 +447,9 @@ ashmem_shrink_scan(struct shrinker *shri
 	if (!(sc->gfp_mask & __GFP_FS))
 		return SHRINK_STOP;
 
-	mutex_lock(&ashmem_mutex);
+	if (!mutex_trylock(&ashmem_mutex))
+		return -1;
+
 	list_for_each_entry_safe(range, next, &ashmem_lru_list, lru) {
 		loff_t start = range->pgstart * PAGE_SIZE;
 		loff_t end = (range->pgend + 1) * PAGE_SIZE;
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/staging/android/ion/ion_carveout_heap.c linux-libre-3.18.138-gnu/drivers/staging/android/ion/ion_carveout_heap.c
--- linux-libre-3.18.137-gnu/drivers/staging/android/ion/ion_carveout_heap.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/staging/android/ion/ion_carveout_heap.c	2019-04-03 00:22:15.000000000 -0400
@@ -167,7 +167,7 @@ struct ion_heap *ion_carveout_heap_creat
 	if (!carveout_heap)
 		return ERR_PTR(-ENOMEM);
 
-	carveout_heap->pool = gen_pool_create(12, -1);
+	carveout_heap->pool = gen_pool_create(PAGE_SHIFT, -1);
 	if (!carveout_heap->pool) {
 		kfree(carveout_heap);
 		return ERR_PTR(-ENOMEM);
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/staging/android/sync.c linux-libre-3.18.138-gnu/drivers/staging/android/sync.c
--- linux-libre-3.18.137-gnu/drivers/staging/android/sync.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/staging/android/sync.c	2019-04-03 00:22:15.000000000 -0400
@@ -519,12 +519,10 @@ static const struct fence_ops android_fe
 static void sync_fence_free(struct kref *kref)
 {
 	struct sync_fence *fence = container_of(kref, struct sync_fence, kref);
-	int i, status = atomic_read(&fence->status);
+	int i;
 
 	for (i = 0; i < fence->num_fences; ++i) {
-		if (status)
-			fence_remove_callback(fence->cbs[i].sync_pt,
-					      &fence->cbs[i].cb);
+		fence_remove_callback(fence->cbs[i].sync_pt, &fence->cbs[i].cb);
 		fence_put(fence->cbs[i].sync_pt);
 	}
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/staging/android/uapi/ashmem.h linux-libre-3.18.138-gnu/drivers/staging/android/uapi/ashmem.h
--- linux-libre-3.18.137-gnu/drivers/staging/android/uapi/ashmem.h	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/staging/android/uapi/ashmem.h	2019-04-03 00:22:15.000000000 -0400
@@ -13,6 +13,7 @@
 #define _UAPI_LINUX_ASHMEM_H
 
 #include <linux/ioctl.h>
+#include <linux/types.h>
 
 #define ASHMEM_NAME_LEN		256
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/staging/goldfish/goldfish_audio.c linux-libre-3.18.138-gnu/drivers/staging/goldfish/goldfish_audio.c
--- linux-libre-3.18.137-gnu/drivers/staging/goldfish/goldfish_audio.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/staging/goldfish/goldfish_audio.c	2019-04-03 00:22:15.000000000 -0400
@@ -26,6 +26,7 @@
 #include <linux/sched.h>
 #include <linux/dma-mapping.h>
 #include <linux/uaccess.h>
+#include <linux/slab.h>
 #include <linux/goldfish.h>
 
 MODULE_AUTHOR("Google, Inc.");
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/tty/serial/kgdboc.c linux-libre-3.18.138-gnu/drivers/tty/serial/kgdboc.c
--- linux-libre-3.18.137-gnu/drivers/tty/serial/kgdboc.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/tty/serial/kgdboc.c	2019-04-03 00:22:15.000000000 -0400
@@ -148,8 +148,10 @@ static int configure_kgdboc(void)
 	char *cptr = config;
 	struct console *cons;
 
-	if (!strlen(config) || isspace(config[0]))
+	if (!strlen(config) || isspace(config[0])) {
+		err = 0;
 		goto noconfig;
+	}
 
 	kgdboc_io_ops.is_console = 0;
 	kgdb_tty_driver = NULL;
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/tty/serial/max310x.c linux-libre-3.18.138-gnu/drivers/tty/serial/max310x.c
--- linux-libre-3.18.137-gnu/drivers/tty/serial/max310x.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/tty/serial/max310x.c	2019-04-03 00:22:15.000000000 -0400
@@ -1321,6 +1321,8 @@ static int max310x_spi_probe(struct spi_
 	if (spi->dev.of_node) {
 		const struct of_device_id *of_id =
 			of_match_device(max310x_dt_ids, &spi->dev);
+		if (!of_id)
+			return -ENODEV;
 
 		devtype = (struct max310x_devtype *)of_id->data;
 	} else {
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/usb/gadget/configfs.c linux-libre-3.18.138-gnu/drivers/usb/gadget/configfs.c
--- linux-libre-3.18.137-gnu/drivers/usb/gadget/configfs.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/usb/gadget/configfs.c	2019-04-03 00:22:15.000000000 -0400
@@ -1551,7 +1551,9 @@ void unregister_gadget_item(struct confi
 {
 	struct gadget_info *gi = to_gadget_info(item);
 
+	mutex_lock(&gi->lock);
 	unregister_gadget(gi);
+	mutex_unlock(&gi->lock);
 }
 EXPORT_SYMBOL_GPL(unregister_gadget_item);
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/usb/host/xhci.h linux-libre-3.18.138-gnu/drivers/usb/host/xhci.h
--- linux-libre-3.18.137-gnu/drivers/usb/host/xhci.h	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/usb/host/xhci.h	2019-04-03 00:22:15.000000000 -0400
@@ -283,6 +283,7 @@ struct xhci_op_regs {
  */
 #define PORT_PLS_MASK	(0xf << 5)
 #define XDEV_U0		(0x0 << 5)
+#define XDEV_U1		(0x1 << 5)
 #define XDEV_U2		(0x2 << 5)
 #define XDEV_U3		(0x3 << 5)
 #define XDEV_RESUME	(0xf << 5)
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/usb/host/xhci-ring.c linux-libre-3.18.138-gnu/drivers/usb/host/xhci-ring.c
--- linux-libre-3.18.137-gnu/drivers/usb/host/xhci-ring.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/usb/host/xhci-ring.c	2019-04-03 00:22:15.000000000 -0400
@@ -1599,10 +1599,13 @@ static void handle_port_status(struct xh
 		}
 	}
 
-	if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_U0 &&
-			DEV_SUPERSPEED(temp)) {
+	if ((temp & PORT_PLC) &&
+	    DEV_SUPERSPEED(temp) &&
+	    ((temp & PORT_PLS_MASK) == XDEV_U0 ||
+	     (temp & PORT_PLS_MASK) == XDEV_U1 ||
+	     (temp & PORT_PLS_MASK) == XDEV_U2)) {
 		xhci_dbg(xhci, "resume SS port %d finished\n", port_id);
-		/* We've just brought the device into U0 through either the
+		/* We've just brought the device into U0/1/2 through either the
 		 * Resume state after a device remote wakeup, or through the
 		 * U3Exit state after a host-initiated resume.  If it's a device
 		 * initiated remote wake, don't pass up the link state change,
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/usb/serial/cp210x.c linux-libre-3.18.138-gnu/drivers/usb/serial/cp210x.c
--- linux-libre-3.18.137-gnu/drivers/usb/serial/cp210x.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/usb/serial/cp210x.c	2019-04-03 00:22:15.000000000 -0400
@@ -76,6 +76,7 @@ static const struct usb_device_id id_tab
 	{ USB_DEVICE(0x10C4, 0x804E) }, /* Software Bisque Paramount ME build-in converter */
 	{ USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */
 	{ USB_DEVICE(0x10C4, 0x8054) }, /* Enfora GSM2228 */
+	{ USB_DEVICE(0x10C4, 0x8056) }, /* Lorenz Messtechnik devices */
 	{ USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */
 	{ USB_DEVICE(0x10C4, 0x806F) }, /* IMS USB to RS422 Converter Cable */
 	{ USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/usb/serial/ftdi_sio.c linux-libre-3.18.138-gnu/drivers/usb/serial/ftdi_sio.c
--- linux-libre-3.18.137-gnu/drivers/usb/serial/ftdi_sio.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/usb/serial/ftdi_sio.c	2019-04-03 00:22:15.000000000 -0400
@@ -604,6 +604,8 @@ static const struct usb_device_id id_tab
 		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
 	{ USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID),
 		.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
+	{ USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLX_PLUS_PID) },
+	{ USB_DEVICE(FTDI_VID, FTDI_NT_ORION_IO_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_SYNAPSE_SS200_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2_PID) },
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/usb/serial/ftdi_sio_ids.h linux-libre-3.18.138-gnu/drivers/usb/serial/ftdi_sio_ids.h
--- linux-libre-3.18.137-gnu/drivers/usb/serial/ftdi_sio_ids.h	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/usb/serial/ftdi_sio_ids.h	2019-04-03 00:22:15.000000000 -0400
@@ -566,7 +566,9 @@
 /*
  * NovaTech product ids (FTDI_VID)
  */
-#define FTDI_NT_ORIONLXM_PID	0x7c90	/* OrionLXm Substation Automation Platform */
+#define FTDI_NT_ORIONLXM_PID		0x7c90	/* OrionLXm Substation Automation Platform */
+#define FTDI_NT_ORIONLX_PLUS_PID	0x7c91	/* OrionLX+ Substation Automation Platform */
+#define FTDI_NT_ORION_IO_PID		0x7c92	/* Orion I/O */
 
 /*
  * Synapse Wireless product ids (FTDI_VID)
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/usb/serial/mos7720.c linux-libre-3.18.138-gnu/drivers/usb/serial/mos7720.c
--- linux-libre-3.18.137-gnu/drivers/usb/serial/mos7720.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/usb/serial/mos7720.c	2019-04-03 00:22:15.000000000 -0400
@@ -369,8 +369,6 @@ static int write_parport_reg_nonblock(st
 	if (!urbtrack)
 		return -ENOMEM;
 
-	kref_get(&mos_parport->ref_count);
-	urbtrack->mos_parport = mos_parport;
 	urbtrack->urb = usb_alloc_urb(0, GFP_ATOMIC);
 	if (!urbtrack->urb) {
 		kfree(urbtrack);
@@ -391,6 +389,8 @@ static int write_parport_reg_nonblock(st
 			     usb_sndctrlpipe(usbdev, 0),
 			     (unsigned char *)urbtrack->setup,
 			     NULL, 0, async_complete, urbtrack);
+	kref_get(&mos_parport->ref_count);
+	urbtrack->mos_parport = mos_parport;
 	kref_init(&urbtrack->ref_count);
 	INIT_LIST_HEAD(&urbtrack->urblist_entry);
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/drivers/video/fbdev/goldfishfb.c linux-libre-3.18.138-gnu/drivers/video/fbdev/goldfishfb.c
--- linux-libre-3.18.137-gnu/drivers/video/fbdev/goldfishfb.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/drivers/video/fbdev/goldfishfb.c	2019-04-03 00:22:15.000000000 -0400
@@ -234,7 +234,7 @@ static int goldfish_fb_probe(struct plat
 	fb->fb.var.activate	= FB_ACTIVATE_NOW;
 	fb->fb.var.height	= readl(fb->reg_base + FB_GET_PHYS_HEIGHT);
 	fb->fb.var.width	= readl(fb->reg_base + FB_GET_PHYS_WIDTH);
-	fb->fb.var.pixclock	= 10000;
+	fb->fb.var.pixclock	= 0;
 
 	fb->fb.var.red.offset = 11;
 	fb->fb.var.red.length = 5;
diff -druNp --no-dereference linux-libre-3.18.137-gnu/fs/ext4/ext4_jbd2.h linux-libre-3.18.138-gnu/fs/ext4/ext4_jbd2.h
--- linux-libre-3.18.137-gnu/fs/ext4/ext4_jbd2.h	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/fs/ext4/ext4_jbd2.h	2019-04-03 00:22:15.000000000 -0400
@@ -374,7 +374,7 @@ static inline void ext4_update_inode_fsy
 {
 	struct ext4_inode_info *ei = EXT4_I(inode);
 
-	if (ext4_handle_valid(handle)) {
+	if (ext4_handle_valid(handle) && !is_handle_aborted(handle)) {
 		ei->i_sync_tid = handle->h_transaction->t_tid;
 		if (datasync)
 			ei->i_datasync_tid = handle->h_transaction->t_tid;
diff -druNp --no-dereference linux-libre-3.18.137-gnu/fs/ext4/file.c linux-libre-3.18.138-gnu/fs/ext4/file.c
--- linux-libre-3.18.137-gnu/fs/ext4/file.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/fs/ext4/file.c	2019-04-03 00:22:15.000000000 -0400
@@ -79,7 +79,7 @@ ext4_unaligned_aio(struct inode *inode,
 	struct super_block *sb = inode->i_sb;
 	int blockmask = sb->s_blocksize - 1;
 
-	if (pos >= i_size_read(inode))
+	if (pos >= ALIGN(i_size_read(inode), sb->s_blocksize))
 		return 0;
 
 	if ((pos | iov_iter_alignment(from)) & blockmask)
diff -druNp --no-dereference linux-libre-3.18.137-gnu/fs/ext4/indirect.c linux-libre-3.18.138-gnu/fs/ext4/indirect.c
--- linux-libre-3.18.137-gnu/fs/ext4/indirect.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/fs/ext4/indirect.c	2019-04-03 00:22:15.000000000 -0400
@@ -1480,10 +1480,14 @@ end_range:
 					   partial->p + 1,
 					   partial2->p,
 					   (chain+n-1) - partial);
-			BUFFER_TRACE(partial->bh, "call brelse");
-			brelse(partial->bh);
-			BUFFER_TRACE(partial2->bh, "call brelse");
-			brelse(partial2->bh);
+			while (partial > chain) {
+				BUFFER_TRACE(partial->bh, "call brelse");
+				brelse(partial->bh);
+			}
+			while (partial2 > chain2) {
+				BUFFER_TRACE(partial2->bh, "call brelse");
+				brelse(partial2->bh);
+			}
 			return 0;
 		}
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/fs/proc/proc_sysctl.c linux-libre-3.18.138-gnu/fs/proc/proc_sysctl.c
--- linux-libre-3.18.137-gnu/fs/proc/proc_sysctl.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/fs/proc/proc_sysctl.c	2019-04-03 00:22:15.000000000 -0400
@@ -1512,7 +1512,8 @@ static void drop_sysctl_table(struct ctl
 	if (--header->nreg)
 		return;
 
-	put_links(header);
+	if (parent)
+		put_links(header);
 	start_unregistering(header);
 	if (!--header->count)
 		kfree_rcu(header, rcu);
diff -druNp --no-dereference linux-libre-3.18.137-gnu/fs/udf/truncate.c linux-libre-3.18.138-gnu/fs/udf/truncate.c
--- linux-libre-3.18.137-gnu/fs/udf/truncate.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/fs/udf/truncate.c	2019-04-03 00:22:15.000000000 -0400
@@ -261,6 +261,9 @@ void udf_truncate_extents(struct inode *
 			epos.block = eloc;
 			epos.bh = udf_tread(sb,
 					udf_get_lb_pblock(sb, &eloc, 0));
+			/* Error reading indirect block? */
+			if (!epos.bh)
+				return;
 			if (elen)
 				indirect_ext_len =
 					(elen + sb->s_blocksize - 1) >>
diff -druNp --no-dereference linux-libre-3.18.137-gnu/include/asm-generic/fixmap.h linux-libre-3.18.138-gnu/include/asm-generic/fixmap.h
--- linux-libre-3.18.137-gnu/include/asm-generic/fixmap.h	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/include/asm-generic/fixmap.h	2019-04-03 00:22:15.000000000 -0400
@@ -67,12 +67,12 @@ static inline unsigned long virt_to_fix(
 #endif
 
 /* Return a pointer with offset calculated */
-#define __set_fixmap_offset(idx, phys, flags)		      \
-({							      \
-	unsigned long addr;				      \
-	__set_fixmap(idx, phys, flags);			      \
-	addr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \
-	addr;						      \
+#define __set_fixmap_offset(idx, phys, flags)				\
+({									\
+	unsigned long ________addr;					\
+	__set_fixmap(idx, phys, flags);					\
+	________addr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1));	\
+	________addr;							\
 })
 
 #define set_fixmap_offset(idx, phys) \
diff -druNp --no-dereference linux-libre-3.18.137-gnu/include/linux/rculist.h linux-libre-3.18.138-gnu/include/linux/rculist.h
--- linux-libre-3.18.137-gnu/include/linux/rculist.h	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/include/linux/rculist.h	2019-04-03 00:22:15.000000000 -0400
@@ -405,6 +405,42 @@ static inline void hlist_add_head_rcu(st
 }
 
 /**
+ * hlist_add_tail_rcu
+ * @n: the element to add to the hash list.
+ * @h: the list to add to.
+ *
+ * Description:
+ * Adds the specified element to the specified hlist,
+ * while permitting racing traversals.
+ *
+ * The caller must take whatever precautions are necessary
+ * (such as holding appropriate locks) to avoid racing
+ * with another list-mutation primitive, such as hlist_add_head_rcu()
+ * or hlist_del_rcu(), running on this same list.
+ * However, it is perfectly legal to run concurrently with
+ * the _rcu list-traversal primitives, such as
+ * hlist_for_each_entry_rcu(), used to prevent memory-consistency
+ * problems on Alpha CPUs.  Regardless of the type of CPU, the
+ * list-traversal primitive must be guarded by rcu_read_lock().
+ */
+static inline void hlist_add_tail_rcu(struct hlist_node *n,
+				      struct hlist_head *h)
+{
+	struct hlist_node *i, *last = NULL;
+
+	for (i = hlist_first_rcu(h); i; i = hlist_next_rcu(i))
+		last = i;
+
+	if (last) {
+		n->next = last->next;
+		n->pprev = &last->next;
+		rcu_assign_pointer(hlist_next_rcu(last), n);
+	} else {
+		hlist_add_head_rcu(n, h);
+	}
+}
+
+/**
  * hlist_add_before_rcu
  * @n: the new element to add to the hash list.
  * @next: the existing element to add the new element before.
diff -druNp --no-dereference linux-libre-3.18.137-gnu/include/net/sctp/checksum.h linux-libre-3.18.138-gnu/include/net/sctp/checksum.h
--- linux-libre-3.18.137-gnu/include/net/sctp/checksum.h	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/include/net/sctp/checksum.h	2019-04-03 00:22:15.000000000 -0400
@@ -60,7 +60,7 @@ static inline __wsum sctp_csum_combine(_
 static inline __le32 sctp_compute_cksum(const struct sk_buff *skb,
 					unsigned int offset)
 {
-	struct sctphdr *sh = sctp_hdr(skb);
+	struct sctphdr *sh = (struct sctphdr *)(skb->data + offset);
         __le32 ret, old = sh->checksum;
 	const struct skb_checksum_ops ops = {
 		.update  = sctp_csum_update,
diff -druNp --no-dereference linux-libre-3.18.137-gnu/include/net/sock.h linux-libre-3.18.138-gnu/include/net/sock.h
--- linux-libre-3.18.137-gnu/include/net/sock.h	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/include/net/sock.h	2019-04-03 00:22:15.000000000 -0400
@@ -626,6 +626,12 @@ static inline void sk_add_node_rcu(struc
 	hlist_add_head_rcu(&sk->sk_node, list);
 }
 
+static inline void sk_add_node_tail_rcu(struct sock *sk, struct hlist_head *list)
+{
+	sock_hold(sk);
+	hlist_add_tail_rcu(&sk->sk_node, list);
+}
+
 static inline void __sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list)
 {
 	hlist_nulls_add_head_rcu(&sk->sk_nulls_node, list);
diff -druNp --no-dereference linux-libre-3.18.137-gnu/kernel/futex.c linux-libre-3.18.138-gnu/kernel/futex.c
--- linux-libre-3.18.137-gnu/kernel/futex.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/kernel/futex.c	2019-04-03 00:22:15.000000000 -0400
@@ -2897,6 +2897,10 @@ int handle_futex_death(u32 __user *uaddr
 {
 	u32 uval, uninitialized_var(nval), mval;
 
+	/* Futex address must be 32bit aligned */
+	if ((((unsigned long)uaddr) % sizeof(*uaddr)) != 0)
+		return -1;
+
 retry:
 	if (get_user(uval, uaddr))
 		return -1;
diff -druNp --no-dereference linux-libre-3.18.137-gnu/Makefile linux-libre-3.18.138-gnu/Makefile
--- linux-libre-3.18.137-gnu/Makefile	2019-03-23 09:01:55.000000000 -0400
+++ linux-libre-3.18.138-gnu/Makefile	2019-04-03 20:51:11.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 18
-SUBLEVEL = 137
+SUBLEVEL = 138
 EXTRAVERSION =-gnu
 NAME = Diseased Newt
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/net/bluetooth/l2cap_core.c linux-libre-3.18.138-gnu/net/bluetooth/l2cap_core.c
--- linux-libre-3.18.137-gnu/net/bluetooth/l2cap_core.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/net/bluetooth/l2cap_core.c	2019-04-03 00:22:15.000000000 -0400
@@ -3290,16 +3290,22 @@ static int l2cap_parse_conf_req(struct l
 
 	while (len >= L2CAP_CONF_OPT_SIZE) {
 		len -= l2cap_get_conf_opt(&req, &type, &olen, &val);
+		if (len < 0)
+			break;
 
 		hint  = type & L2CAP_CONF_HINT;
 		type &= L2CAP_CONF_MASK;
 
 		switch (type) {
 		case L2CAP_CONF_MTU:
+			if (olen != 2)
+				break;
 			mtu = val;
 			break;
 
 		case L2CAP_CONF_FLUSH_TO:
+			if (olen != 2)
+				break;
 			chan->flush_to = val;
 			break;
 
@@ -3307,26 +3313,30 @@ static int l2cap_parse_conf_req(struct l
 			break;
 
 		case L2CAP_CONF_RFC:
-			if (olen == sizeof(rfc))
-				memcpy(&rfc, (void *) val, olen);
+			if (olen != sizeof(rfc))
+				break;
+			memcpy(&rfc, (void *) val, olen);
 			break;
 
 		case L2CAP_CONF_FCS:
+			if (olen != 1)
+				break;
 			if (val == L2CAP_FCS_NONE)
 				set_bit(CONF_RECV_NO_FCS, &chan->conf_state);
 			break;
 
 		case L2CAP_CONF_EFS:
-			if (olen == sizeof(efs)) {
-				remote_efs = 1;
-				memcpy(&efs, (void *) val, olen);
-			}
+			if (olen != sizeof(efs))
+				break;
+			remote_efs = 1;
+			memcpy(&efs, (void *) val, olen);
 			break;
 
 		case L2CAP_CONF_EWS:
+			if (olen != 2)
+				break;
 			if (!chan->conn->hs_enabled)
 				return -ECONNREFUSED;
-
 			set_bit(FLAG_EXT_CTRL, &chan->flags);
 			set_bit(CONF_EWS_RECV, &chan->conf_state);
 			chan->tx_win_max = L2CAP_DEFAULT_EXT_WINDOW;
@@ -3336,7 +3346,6 @@ static int l2cap_parse_conf_req(struct l
 		default:
 			if (hint)
 				break;
-
 			result = L2CAP_CONF_UNKNOWN;
 			*((u8 *) ptr++) = type;
 			break;
@@ -3501,58 +3510,65 @@ static int l2cap_parse_conf_rsp(struct l
 
 	while (len >= L2CAP_CONF_OPT_SIZE) {
 		len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val);
+		if (len < 0)
+			break;
 
 		switch (type) {
 		case L2CAP_CONF_MTU:
+			if (olen != 2)
+				break;
 			if (val < L2CAP_DEFAULT_MIN_MTU) {
 				*result = L2CAP_CONF_UNACCEPT;
 				chan->imtu = L2CAP_DEFAULT_MIN_MTU;
 			} else
 				chan->imtu = val;
-			l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, chan->imtu, endptr - ptr);
+			l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, chan->imtu,
+					   endptr - ptr);
 			break;
 
 		case L2CAP_CONF_FLUSH_TO:
+			if (olen != 2)
+				break;
 			chan->flush_to = val;
-			l2cap_add_conf_opt(&ptr, L2CAP_CONF_FLUSH_TO,
-					   2, chan->flush_to, endptr - ptr);
+			l2cap_add_conf_opt(&ptr, L2CAP_CONF_FLUSH_TO, 2,
+					   chan->flush_to, endptr - ptr);
 			break;
 
 		case L2CAP_CONF_RFC:
-			if (olen == sizeof(rfc))
-				memcpy(&rfc, (void *)val, olen);
-
+			if (olen != sizeof(rfc))
+				break;
+			memcpy(&rfc, (void *)val, olen);
 			if (test_bit(CONF_STATE2_DEVICE, &chan->conf_state) &&
 			    rfc.mode != chan->mode)
 				return -ECONNREFUSED;
-
 			chan->fcs = 0;
-
-			l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
-					   sizeof(rfc), (unsigned long) &rfc, endptr - ptr);
+			l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, sizeof(rfc),
+					   (unsigned long) &rfc, endptr - ptr);
 			break;
 
 		case L2CAP_CONF_EWS:
+			if (olen != 2)
+				break;
 			chan->ack_win = min_t(u16, val, chan->ack_win);
 			l2cap_add_conf_opt(&ptr, L2CAP_CONF_EWS, 2,
 					   chan->tx_win, endptr - ptr);
 			break;
 
 		case L2CAP_CONF_EFS:
-			if (olen == sizeof(efs)) {
-				memcpy(&efs, (void *)val, olen);
-
-				if (chan->local_stype != L2CAP_SERV_NOTRAFIC &&
-				    efs.stype != L2CAP_SERV_NOTRAFIC &&
-				    efs.stype != chan->local_stype)
-					return -ECONNREFUSED;
-
-				l2cap_add_conf_opt(&ptr, L2CAP_CONF_EFS, sizeof(efs),
-						   (unsigned long) &efs, endptr - ptr);
-			}
+			if (olen != sizeof(efs))
+				break;
+			memcpy(&efs, (void *)val, olen);
+			if (chan->local_stype != L2CAP_SERV_NOTRAFIC &&
+			    efs.stype != L2CAP_SERV_NOTRAFIC &&
+			    efs.stype != chan->local_stype)
+				return -ECONNREFUSED;
+			l2cap_add_conf_opt(&ptr, L2CAP_CONF_EFS, sizeof(efs),
+					   (unsigned long) &efs, endptr - ptr);
 			break;
 
 		case L2CAP_CONF_FCS:
+			if (olen != 1)
+				break;
 			if (*result == L2CAP_CONF_PENDING)
 				if (val == L2CAP_FCS_NONE)
 					set_bit(CONF_RECV_NO_FCS,
@@ -3681,13 +3697,18 @@ static void l2cap_conf_rfc_get(struct l2
 
 	while (len >= L2CAP_CONF_OPT_SIZE) {
 		len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val);
+		if (len < 0)
+			break;
 
 		switch (type) {
 		case L2CAP_CONF_RFC:
-			if (olen == sizeof(rfc))
-				memcpy(&rfc, (void *)val, olen);
+			if (olen != sizeof(rfc))
+				break;
+			memcpy(&rfc, (void *)val, olen);
 			break;
 		case L2CAP_CONF_EWS:
+			if (olen != 2)
+				break;
 			txwin_ext = val;
 			break;
 		}
diff -druNp --no-dereference linux-libre-3.18.137-gnu/net/dccp/ipv6.c linux-libre-3.18.138-gnu/net/dccp/ipv6.c
--- linux-libre-3.18.137-gnu/net/dccp/ipv6.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/net/dccp/ipv6.c	2019-04-03 00:22:15.000000000 -0400
@@ -490,8 +490,8 @@ static struct sock *dccp_v6_request_recv
 		newnp->ipv6_mc_list = NULL;
 		newnp->ipv6_ac_list = NULL;
 		newnp->ipv6_fl_list = NULL;
-		newnp->mcast_oif   = inet6_iif(skb);
-		newnp->mcast_hops  = ipv6_hdr(skb)->hop_limit;
+		newnp->mcast_oif   = inet_iif(skb);
+		newnp->mcast_hops  = ip_hdr(skb)->ttl;
 
 		/*
 		 * No need to charge this sock to the relevant IPv6 refcnt debug socks count
diff -druNp --no-dereference linux-libre-3.18.137-gnu/net/ipv6/icmp.c linux-libre-3.18.138-gnu/net/ipv6/icmp.c
--- linux-libre-3.18.137-gnu/net/ipv6/icmp.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/net/ipv6/icmp.c	2019-04-03 00:22:15.000000000 -0400
@@ -97,7 +97,7 @@ static void icmpv6_err(struct sk_buff *s
 
 	if (!(type & ICMPV6_INFOMSG_MASK))
 		if (icmp6->icmp6_type == ICMPV6_ECHO_REQUEST)
-			ping_err(skb, offset, info);
+			ping_err(skb, offset, ntohl(info));
 }
 
 static int icmpv6_rcv(struct sk_buff *skb);
diff -druNp --no-dereference linux-libre-3.18.137-gnu/net/ipv6/tcp_ipv6.c linux-libre-3.18.138-gnu/net/ipv6/tcp_ipv6.c
--- linux-libre-3.18.137-gnu/net/ipv6/tcp_ipv6.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/net/ipv6/tcp_ipv6.c	2019-04-03 00:22:15.000000000 -0400
@@ -1118,11 +1118,11 @@ static struct sock *tcp_v6_syn_recv_sock
 		newnp->ipv6_fl_list = NULL;
 		newnp->pktoptions  = NULL;
 		newnp->opt	   = NULL;
-		newnp->mcast_oif   = tcp_v6_iif(skb);
-		newnp->mcast_hops  = ipv6_hdr(skb)->hop_limit;
-		newnp->rcv_flowinfo = ip6_flowinfo(ipv6_hdr(skb));
+		newnp->mcast_oif   = inet_iif(skb);
+		newnp->mcast_hops  = ip_hdr(skb)->ttl;
+		newnp->rcv_flowinfo = 0;
 		if (np->repflow)
-			newnp->flow_label = ip6_flowlabel(ipv6_hdr(skb));
+			newnp->flow_label = 0;
 
 		/*
 		 * No need to charge this sock to the relevant IPv6 refcnt debug socks count
diff -druNp --no-dereference linux-libre-3.18.137-gnu/net/packet/af_packet.c linux-libre-3.18.138-gnu/net/packet/af_packet.c
--- linux-libre-3.18.137-gnu/net/packet/af_packet.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/net/packet/af_packet.c	2019-04-03 00:22:15.000000000 -0400
@@ -2878,7 +2878,7 @@ static int packet_create(struct net *net
 	}
 
 	mutex_lock(&net->packet.sklist_lock);
-	sk_add_node_rcu(sk, &net->packet.sklist);
+	sk_add_node_tail_rcu(sk, &net->packet.sklist);
 	mutex_unlock(&net->packet.sklist_lock);
 
 	preempt_disable();
@@ -3807,7 +3807,7 @@ static struct pgv *alloc_pg_vec(struct t
 	struct pgv *pg_vec;
 	int i;
 
-	pg_vec = kcalloc(block_nr, sizeof(struct pgv), GFP_KERNEL);
+	pg_vec = kcalloc(block_nr, sizeof(struct pgv), GFP_KERNEL | __GFP_NOWARN);
 	if (unlikely(!pg_vec))
 		goto out;
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/net/rose/rose_subr.c linux-libre-3.18.138-gnu/net/rose/rose_subr.c
--- linux-libre-3.18.137-gnu/net/rose/rose_subr.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/net/rose/rose_subr.c	2019-04-03 00:22:15.000000000 -0400
@@ -105,16 +105,17 @@ void rose_write_internal(struct sock *sk
 	struct sk_buff *skb;
 	unsigned char  *dptr;
 	unsigned char  lci1, lci2;
-	char buffer[100];
-	int len, faclen = 0;
+	int maxfaclen = 0;
+	int len, faclen;
+	int reserve;
 
-	len = AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN + ROSE_MIN_LEN + 1;
+	reserve = AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN + 1;
+	len = ROSE_MIN_LEN;
 
 	switch (frametype) {
 	case ROSE_CALL_REQUEST:
 		len   += 1 + ROSE_ADDR_LEN + ROSE_ADDR_LEN;
-		faclen = rose_create_facilities(buffer, rose);
-		len   += faclen;
+		maxfaclen = 256;
 		break;
 	case ROSE_CALL_ACCEPTED:
 	case ROSE_CLEAR_REQUEST:
@@ -123,15 +124,16 @@ void rose_write_internal(struct sock *sk
 		break;
 	}
 
-	if ((skb = alloc_skb(len, GFP_ATOMIC)) == NULL)
+	skb = alloc_skb(reserve + len + maxfaclen, GFP_ATOMIC);
+	if (!skb)
 		return;
 
 	/*
 	 *	Space for AX.25 header and PID.
 	 */
-	skb_reserve(skb, AX25_BPQ_HEADER_LEN + AX25_MAX_HEADER_LEN + 1);
+	skb_reserve(skb, reserve);
 
-	dptr = skb_put(skb, skb_tailroom(skb));
+	dptr = skb_put(skb, len);
 
 	lci1 = (rose->lci >> 8) & 0x0F;
 	lci2 = (rose->lci >> 0) & 0xFF;
@@ -146,7 +148,8 @@ void rose_write_internal(struct sock *sk
 		dptr   += ROSE_ADDR_LEN;
 		memcpy(dptr, &rose->source_addr, ROSE_ADDR_LEN);
 		dptr   += ROSE_ADDR_LEN;
-		memcpy(dptr, buffer, faclen);
+		faclen = rose_create_facilities(dptr, rose);
+		skb_put(skb, faclen);
 		dptr   += faclen;
 		break;
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/net/wireless/nl80211.c linux-libre-3.18.138-gnu/net/wireless/nl80211.c
--- linux-libre-3.18.137-gnu/net/wireless/nl80211.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/net/wireless/nl80211.c	2019-04-03 00:22:15.000000000 -0400
@@ -10586,7 +10586,7 @@ static void nl80211_send_mlme_event(stru
 	struct sk_buff *msg;
 	void *hdr;
 
-	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
+	msg = nlmsg_new(100 + len, gfp);
 	if (!msg)
 		return;
 
@@ -10738,7 +10738,7 @@ void nl80211_send_connect_result(struct
 	struct sk_buff *msg;
 	void *hdr;
 
-	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
+	msg = nlmsg_new(100 + req_ie_len + resp_ie_len, gfp);
 	if (!msg)
 		return;
 
@@ -10778,7 +10778,7 @@ void nl80211_send_roamed(struct cfg80211
 	struct sk_buff *msg;
 	void *hdr;
 
-	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
+	msg = nlmsg_new(100 + req_ie_len + resp_ie_len, gfp);
 	if (!msg)
 		return;
 
@@ -10816,7 +10816,7 @@ void nl80211_send_disconnected(struct cf
 	struct sk_buff *msg;
 	void *hdr;
 
-	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+	msg = nlmsg_new(100 + ie_len, GFP_KERNEL);
 	if (!msg)
 		return;
 
@@ -10893,7 +10893,7 @@ void cfg80211_notify_new_peer_candidate(
 
 	trace_cfg80211_notify_new_peer_candidate(dev, addr);
 
-	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
+	msg = nlmsg_new(100 + ie_len, gfp);
 	if (!msg)
 		return;
 
@@ -11269,7 +11269,7 @@ int nl80211_send_mgmt(struct cfg80211_re
 	struct sk_buff *msg;
 	void *hdr;
 
-	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
+	msg = nlmsg_new(100 + len, gfp);
 	if (!msg)
 		return -ENOMEM;
 
@@ -11312,7 +11312,7 @@ void cfg80211_mgmt_tx_status(struct wire
 
 	trace_cfg80211_mgmt_tx_status(wdev, cookie, ack);
 
-	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp);
+	msg = nlmsg_new(100 + len, gfp);
 	if (!msg)
 		return;
 
@@ -12022,7 +12022,7 @@ void cfg80211_ft_event(struct net_device
 	if (!ft_event->target_ap)
 		return;
 
-	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+	msg = nlmsg_new(100 + ft_event->ric_ies_len, GFP_KERNEL);
 	if (!msg)
 		return;
 
diff -druNp --no-dereference linux-libre-3.18.137-gnu/sound/core/oss/pcm_oss.c linux-libre-3.18.138-gnu/sound/core/oss/pcm_oss.c
--- linux-libre-3.18.137-gnu/sound/core/oss/pcm_oss.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/sound/core/oss/pcm_oss.c	2019-04-03 00:22:15.000000000 -0400
@@ -951,6 +951,28 @@ static int snd_pcm_oss_change_params_loc
 	oss_frame_size = snd_pcm_format_physical_width(params_format(params)) *
 			 params_channels(params) / 8;
 
+	err = snd_pcm_oss_period_size(substream, params, sparams);
+	if (err < 0)
+		goto failure;
+
+	n = snd_pcm_plug_slave_size(substream, runtime->oss.period_bytes / oss_frame_size);
+	err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, n, NULL);
+	if (err < 0)
+		goto failure;
+
+	err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIODS,
+				     runtime->oss.periods, NULL);
+	if (err < 0)
+		goto failure;
+
+	snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL);
+
+	err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_HW_PARAMS, sparams);
+	if (err < 0) {
+		pcm_dbg(substream->pcm, "HW_PARAMS failed: %i\n", err);
+		goto failure;
+	}
+
 #ifdef CONFIG_SND_PCM_OSS_PLUGINS
 	snd_pcm_oss_plugin_clear(substream);
 	if (!direct) {
@@ -985,27 +1007,6 @@ static int snd_pcm_oss_change_params_loc
 	}
 #endif
 
-	err = snd_pcm_oss_period_size(substream, params, sparams);
-	if (err < 0)
-		goto failure;
-
-	n = snd_pcm_plug_slave_size(substream, runtime->oss.period_bytes / oss_frame_size);
-	err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, n, NULL);
-	if (err < 0)
-		goto failure;
-
-	err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIODS,
-				     runtime->oss.periods, NULL);
-	if (err < 0)
-		goto failure;
-
-	snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL);
-
-	if ((err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_HW_PARAMS, sparams)) < 0) {
-		pcm_dbg(substream->pcm, "HW_PARAMS failed: %i\n", err);
-		goto failure;
-	}
-
 	if (runtime->oss.trigger) {
 		sw_params->start_threshold = 1;
 	} else {
diff -druNp --no-dereference linux-libre-3.18.137-gnu/sound/core/pcm_native.c linux-libre-3.18.138-gnu/sound/core/pcm_native.c
--- linux-libre-3.18.137-gnu/sound/core/pcm_native.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/sound/core/pcm_native.c	2019-04-03 00:22:15.000000000 -0400
@@ -1225,8 +1225,15 @@ static int snd_pcm_pause(struct snd_pcm_
 static int snd_pcm_pre_suspend(struct snd_pcm_substream *substream, int state)
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
-	if (runtime->status->state == SNDRV_PCM_STATE_SUSPENDED)
+	switch (runtime->status->state) {
+	case SNDRV_PCM_STATE_SUSPENDED:
 		return -EBUSY;
+	/* unresumable PCM state; return -EBUSY for skipping suspend */
+	case SNDRV_PCM_STATE_OPEN:
+	case SNDRV_PCM_STATE_SETUP:
+	case SNDRV_PCM_STATE_DISCONNECTED:
+		return -EBUSY;
+	}
 	runtime->trigger_master = substream;
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.18.137-gnu/virt/kvm/kvm_main.c linux-libre-3.18.138-gnu/virt/kvm/kvm_main.c
--- linux-libre-3.18.137-gnu/virt/kvm/kvm_main.c	2019-03-23 03:19:03.000000000 -0400
+++ linux-libre-3.18.138-gnu/virt/kvm/kvm_main.c	2019-04-03 00:22:15.000000000 -0400
@@ -2298,6 +2298,9 @@ static long kvm_device_ioctl(struct file
 {
 	struct kvm_device *dev = filp->private_data;
 
+	if (dev->kvm->mm != current->mm)
+		return -EIO;
+
 	switch (ioctl) {
 	case KVM_SET_DEVICE_ATTR:
 		return kvm_device_ioctl_attr(dev, dev->ops->set_attr, arg);
