diff -druNp --no-dereference linux-libre-3.18.52-gnu/arch/arm/kernel/Makefile linux-libre-3.18.53-gnu/arch/arm/kernel/Makefile
--- linux-libre-3.18.52-gnu/arch/arm/kernel/Makefile	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/arch/arm/kernel/Makefile	2017-05-15 03:19:33.000000000 -0400
@@ -84,7 +84,6 @@ obj-$(CONFIG_CPU_PJ4B)		+= pj4-cp0.o
 obj-$(CONFIG_IWMMXT)		+= iwmmxt.o
 obj-$(CONFIG_PERF_EVENTS)	+= perf_regs.o
 obj-$(CONFIG_HW_PERF_EVENTS)	+= perf_event.o perf_event_cpu.o
-CFLAGS_pj4-cp0.o		:= -marm
 AFLAGS_iwmmxt.o			:= -Wa,-mcpu=iwmmxt
 obj-$(CONFIG_ARM_CPU_TOPOLOGY)  += topology.o
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/arch/arm/kernel/pj4-cp0.c linux-libre-3.18.53-gnu/arch/arm/kernel/pj4-cp0.c
--- linux-libre-3.18.52-gnu/arch/arm/kernel/pj4-cp0.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/arch/arm/kernel/pj4-cp0.c	2017-05-15 03:19:33.000000000 -0400
@@ -66,9 +66,13 @@ static void __init pj4_cp_access_write(u
 
 	__asm__ __volatile__ (
 		"mcr	p15, 0, %1, c1, c0, 2\n\t"
+#ifdef CONFIG_THUMB2_KERNEL
+		"isb\n\t"
+#else
 		"mrc	p15, 0, %0, c1, c0, 2\n\t"
 		"mov	%0, %0\n\t"
 		"sub	pc, pc, #4\n\t"
+#endif
 		: "=r" (temp) : "r" (value));
 }
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/arch/powerpc/platforms/powernv/opal-wrappers.S linux-libre-3.18.53-gnu/arch/powerpc/platforms/powernv/opal-wrappers.S
--- linux-libre-3.18.52-gnu/arch/powerpc/platforms/powernv/opal-wrappers.S	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/arch/powerpc/platforms/powernv/opal-wrappers.S	2017-05-15 03:19:33.000000000 -0400
@@ -148,7 +148,7 @@ opal_tracepoint_entry:
 opal_tracepoint_return:
 	std	r3,STK_REG(R31)(r1)
 	mr	r4,r3
-	ld	r0,STK_REG(R23)(r1)
+	ld	r3,STK_REG(R23)(r1)
 	bl	__trace_opal_exit
 	ld	r3,STK_REG(R31)(r1)
 	addi	r1,r1,STACKFRAMESIZE
diff -druNp --no-dereference linux-libre-3.18.52-gnu/arch/x86/kernel/kprobes/common.h linux-libre-3.18.53-gnu/arch/x86/kernel/kprobes/common.h
--- linux-libre-3.18.52-gnu/arch/x86/kernel/kprobes/common.h	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/arch/x86/kernel/kprobes/common.h	2017-05-15 03:19:33.000000000 -0400
@@ -67,7 +67,7 @@
 #endif
 
 /* Ensure if the instruction can be boostable */
-extern int can_boost(kprobe_opcode_t *instruction);
+extern int can_boost(kprobe_opcode_t *instruction, void *addr);
 /* Recover instruction if given address is probed */
 extern unsigned long recover_probed_instruction(kprobe_opcode_t *buf,
 					 unsigned long addr);
diff -druNp --no-dereference linux-libre-3.18.52-gnu/arch/x86/kernel/kprobes/core.c linux-libre-3.18.53-gnu/arch/x86/kernel/kprobes/core.c
--- linux-libre-3.18.52-gnu/arch/x86/kernel/kprobes/core.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/arch/x86/kernel/kprobes/core.c	2017-05-15 03:19:33.000000000 -0400
@@ -163,12 +163,12 @@ NOKPROBE_SYMBOL(skip_prefixes);
  * Returns non-zero if opcode is boostable.
  * RIP relative instructions are adjusted at copying time in 64 bits mode
  */
-int can_boost(kprobe_opcode_t *opcodes)
+int can_boost(kprobe_opcode_t *opcodes, void *addr)
 {
 	kprobe_opcode_t opcode;
 	kprobe_opcode_t *orig_opcodes = opcodes;
 
-	if (search_exception_tables((unsigned long)opcodes))
+	if (search_exception_tables((unsigned long)addr))
 		return 0;	/* Page fault may occur on this address. */
 
 retry:
@@ -385,7 +385,7 @@ static int arch_copy_kprobe(struct kprob
 	 * __copy_instruction can modify the displacement of the instruction,
 	 * but it doesn't affect boostable check.
 	 */
-	if (can_boost(p->ainsn.insn))
+	if (can_boost(p->ainsn.insn, p->addr))
 		p->ainsn.boostable = 0;
 	else
 		p->ainsn.boostable = -1;
diff -druNp --no-dereference linux-libre-3.18.52-gnu/arch/x86/kernel/kprobes/opt.c linux-libre-3.18.53-gnu/arch/x86/kernel/kprobes/opt.c
--- linux-libre-3.18.52-gnu/arch/x86/kernel/kprobes/opt.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/arch/x86/kernel/kprobes/opt.c	2017-05-15 03:19:33.000000000 -0400
@@ -177,7 +177,7 @@ static int copy_optimized_instructions(u
 
 	while (len < RELATIVEJUMP_SIZE) {
 		ret = __copy_instruction(dest + len, src + len);
-		if (!ret || !can_boost(dest + len))
+		if (!ret || !can_boost(dest + len, src + len))
 			return -EINVAL;
 		len += ret;
 	}
diff -druNp --no-dereference linux-libre-3.18.52-gnu/arch/x86/kernel/pci-calgary_64.c linux-libre-3.18.53-gnu/arch/x86/kernel/pci-calgary_64.c
--- linux-libre-3.18.52-gnu/arch/x86/kernel/pci-calgary_64.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/arch/x86/kernel/pci-calgary_64.c	2017-05-15 03:19:33.000000000 -0400
@@ -296,7 +296,7 @@ static void iommu_free(struct iommu_tabl
 
 	/* were we called with bad_dma_address? */
 	badend = DMA_ERROR_CODE + (EMERGENCY_PAGES * PAGE_SIZE);
-	if (unlikely((dma_addr >= DMA_ERROR_CODE) && (dma_addr < badend))) {
+	if (unlikely(dma_addr < badend)) {
 		WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA "
 		       "address 0x%Lx\n", dma_addr);
 		return;
diff -druNp --no-dereference linux-libre-3.18.52-gnu/arch/x86/kvm/cpuid.c linux-libre-3.18.53-gnu/arch/x86/kvm/cpuid.c
--- linux-libre-3.18.52-gnu/arch/x86/kvm/cpuid.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/arch/x86/kvm/cpuid.c	2017-05-15 03:19:33.000000000 -0400
@@ -787,12 +787,6 @@ void kvm_cpuid(struct kvm_vcpu *vcpu, u3
 	if (!best)
 		best = check_cpuid_limit(vcpu, function, index);
 
-	/*
-	 * Perfmon not yet supported for L2 guest.
-	 */
-	if (is_guest_mode(vcpu) && function == 0xa)
-		best = NULL;
-
 	if (best) {
 		*eax = best->eax;
 		*ebx = best->ebx;
diff -druNp --no-dereference linux-libre-3.18.52-gnu/arch/x86/kvm/vmx.c linux-libre-3.18.53-gnu/arch/x86/kvm/vmx.c
--- linux-libre-3.18.52-gnu/arch/x86/kvm/vmx.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/arch/x86/kvm/vmx.c	2017-05-15 03:19:33.000000000 -0400
@@ -7047,8 +7047,6 @@ static bool nested_vmx_exit_handled(stru
 	case EXIT_REASON_TASK_SWITCH:
 		return 1;
 	case EXIT_REASON_CPUID:
-		if (kvm_register_read(vcpu, VCPU_REGS_RAX) == 0xa)
-			return 0;
 		return 1;
 	case EXIT_REASON_HLT:
 		return nested_cpu_has(vmcs12, CPU_BASED_HLT_EXITING);
diff -druNp --no-dereference linux-libre-3.18.52-gnu/arch/x86/platform/intel-mid/device_libs/platform_wdt.c linux-libre-3.18.53-gnu/arch/x86/platform/intel-mid/device_libs/platform_wdt.c
--- linux-libre-3.18.52-gnu/arch/x86/platform/intel-mid/device_libs/platform_wdt.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/arch/x86/platform/intel-mid/device_libs/platform_wdt.c	2017-05-15 03:19:33.000000000 -0400
@@ -17,7 +17,7 @@
 #include <asm/intel-mid.h>
 #include <asm/io_apic.h>
 
-#define TANGIER_EXT_TIMER0_MSI 15
+#define TANGIER_EXT_TIMER0_MSI 12
 
 static struct platform_device wdt_dev = {
 	.name = "intel_mid_wdt",
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/gpu/drm/ttm/ttm_bo_vm.c linux-libre-3.18.53-gnu/drivers/gpu/drm/ttm/ttm_bo_vm.c
--- linux-libre-3.18.52-gnu/drivers/gpu/drm/ttm/ttm_bo_vm.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/gpu/drm/ttm/ttm_bo_vm.c	2017-05-15 03:19:33.000000000 -0400
@@ -66,8 +66,11 @@ static int ttm_bo_vm_fault_idle(struct t
 		if (vmf->flags & FAULT_FLAG_RETRY_NOWAIT)
 			goto out_unlock;
 
+		ttm_bo_reference(bo);
 		up_read(&vma->vm_mm->mmap_sem);
 		(void) ttm_bo_wait(bo, false, true, false);
+		ttm_bo_unreserve(bo);
+		ttm_bo_unref(&bo);
 		goto out_unlock;
 	}
 
@@ -114,8 +117,10 @@ static int ttm_bo_vm_fault(struct vm_are
 
 		if (vmf->flags & FAULT_FLAG_ALLOW_RETRY) {
 			if (!(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) {
+				ttm_bo_reference(bo);
 				up_read(&vma->vm_mm->mmap_sem);
 				(void) ttm_bo_wait_unreserved(bo);
+				ttm_bo_unref(&bo);
 			}
 
 			return VM_FAULT_RETRY;
@@ -160,6 +165,13 @@ static int ttm_bo_vm_fault(struct vm_are
 	ret = ttm_bo_vm_fault_idle(bo, vma, vmf);
 	if (unlikely(ret != 0)) {
 		retval = ret;
+
+		if (retval == VM_FAULT_RETRY &&
+		    !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) {
+			/* The BO has already been unreserved. */
+			return retval;
+		}
+
 		goto out_unlock;
 	}
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c linux-libre-3.18.53-gnu/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
--- linux-libre-3.18.52-gnu/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c	2017-05-15 03:19:33.000000000 -0400
@@ -192,7 +192,7 @@ static netdev_tx_t brcmf_netdev_start_xm
 	int ret;
 	struct brcmf_if *ifp = netdev_priv(ndev);
 	struct brcmf_pub *drvr = ifp->drvr;
-	struct ethhdr *eh = (struct ethhdr *)(skb->data);
+	struct ethhdr *eh;
 
 	brcmf_dbg(DATA, "Enter, idx=%d\n", ifp->bssidx);
 
@@ -213,22 +213,13 @@ static netdev_tx_t brcmf_netdev_start_xm
 		goto done;
 	}
 
-	/* Make sure there's enough room for any header */
-	if (skb_headroom(skb) < drvr->hdrlen) {
-		struct sk_buff *skb2;
-
-		brcmf_dbg(INFO, "%s: insufficient headroom\n",
+	/* Make sure there's enough writable headroom*/
+	ret = skb_cow_head(skb, drvr->hdrlen);
+	if (ret < 0) {
+		brcmf_err("%s: skb_cow_head failed\n",
 			  brcmf_ifname(drvr, ifp->bssidx));
-		drvr->bus_if->tx_realloc++;
-		skb2 = skb_realloc_headroom(skb, drvr->hdrlen);
 		dev_kfree_skb(skb);
-		skb = skb2;
-		if (skb == NULL) {
-			brcmf_err("%s: skb_realloc_headroom failed\n",
-				  brcmf_ifname(drvr, ifp->bssidx));
-			ret = -ENOMEM;
-			goto done;
-		}
+		goto done;
 	}
 
 	/* validate length for ether packet */
@@ -238,6 +229,8 @@ static netdev_tx_t brcmf_netdev_start_xm
 		goto done;
 	}
 
+	eh = (struct ethhdr *)(skb->data);
+
 	if (eh->h_proto == htons(ETH_P_PAE))
 		atomic_inc(&ifp->pend_8021x_cnt);
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/net/wireless/mwifiex/debugfs.c linux-libre-3.18.53-gnu/drivers/net/wireless/mwifiex/debugfs.c
--- linux-libre-3.18.52-gnu/drivers/net/wireless/mwifiex/debugfs.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/net/wireless/mwifiex/debugfs.c	2017-05-15 03:19:33.000000000 -0400
@@ -220,7 +220,8 @@ mwifiex_info_read(struct file *file, cha
 	if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) {
 		p += sprintf(p, "multicast_count=\"%d\"\n",
 			     netdev_mc_count(netdev));
-		p += sprintf(p, "essid=\"%s\"\n", info.ssid.ssid);
+		p += sprintf(p, "essid=\"%.*s\"\n", info.ssid.ssid_len,
+			     info.ssid.ssid);
 		p += sprintf(p, "bssid=\"%pM\"\n", info.bssid);
 		p += sprintf(p, "channel=\"%d\"\n", (int) info.bss_chan);
 		p += sprintf(p, "country_code = \"%s\"\n", info.country_code);
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/net/wireless/mwifiex/sta_ioctl.c linux-libre-3.18.53-gnu/drivers/net/wireless/mwifiex/sta_ioctl.c
--- linux-libre-3.18.52-gnu/drivers/net/wireless/mwifiex/sta_ioctl.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/net/wireless/mwifiex/sta_ioctl.c	2017-05-15 03:19:33.000000000 -0400
@@ -1074,8 +1074,6 @@ int mwifiex_set_encode(struct mwifiex_pr
 			encrypt_key.is_rx_seq_valid = true;
 		}
 	} else {
-		if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP)
-			return 0;
 		encrypt_key.key_disable = true;
 		if (mac_addr)
 			memcpy(encrypt_key.mac_addr, mac_addr, ETH_ALEN);
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/power/bq24190_charger.c linux-libre-3.18.53-gnu/drivers/power/bq24190_charger.c
--- linux-libre-3.18.52-gnu/drivers/power/bq24190_charger.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/power/bq24190_charger.c	2017-05-15 03:19:33.000000000 -0400
@@ -1400,7 +1400,7 @@ static int bq24190_probe(struct i2c_clie
 
 	ret = devm_request_threaded_irq(dev, bdi->irq, NULL,
 			bq24190_irq_handler_thread,
-			IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+			IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
 			"bq24190-charger", bdi);
 	if (ret < 0) {
 		dev_err(dev, "Can't set up irq handler\n");
@@ -1496,6 +1496,7 @@ static int bq24190_pm_resume(struct devi
 
 	pm_runtime_get_sync(bdi->dev);
 	bq24190_register_reset(bdi);
+	bq24190_set_mode_host(bdi);
 	pm_runtime_put_sync(bdi->dev);
 
 	/* Things may have changed while suspended so alert upper layer */
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/staging/emxx_udc/emxx_udc.c linux-libre-3.18.53-gnu/drivers/staging/emxx_udc/emxx_udc.c
--- linux-libre-3.18.52-gnu/drivers/staging/emxx_udc/emxx_udc.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/staging/emxx_udc/emxx_udc.c	2017-05-15 03:19:33.000000000 -0400
@@ -3286,7 +3286,7 @@ static void __init nbu2ss_drv_set_ep_inf
 }
 
 /*-------------------------------------------------------------------------*/
-static void __init nbu2ss_drv_ep_init(struct nbu2ss_udc *udc)
+static void nbu2ss_drv_ep_init(struct nbu2ss_udc *udc)
 {
 	int	i;
 
@@ -3302,7 +3302,7 @@ static void __init nbu2ss_drv_ep_init(st
 
 /*-------------------------------------------------------------------------*/
 /* platform_driver */
-static int __init nbu2ss_drv_contest_init(
+static int nbu2ss_drv_contest_init(
 	struct platform_device *pdev,
 	struct nbu2ss_udc *udc)
 {
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/tty/sysrq.c linux-libre-3.18.53-gnu/drivers/tty/sysrq.c
--- linux-libre-3.18.52-gnu/drivers/tty/sysrq.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/tty/sysrq.c	2017-05-15 03:19:33.000000000 -0400
@@ -55,9 +55,6 @@
 static int __read_mostly sysrq_enabled = CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE;
 static bool __read_mostly sysrq_always_enabled;
 
-unsigned short platform_sysrq_reset_seq[] __weak = { KEY_RESERVED };
-int sysrq_reset_downtime_ms __weak;
-
 static bool sysrq_on(void)
 {
 	return sysrq_enabled || sysrq_always_enabled;
@@ -567,6 +564,7 @@ void handle_sysrq(int key)
 EXPORT_SYMBOL(handle_sysrq);
 
 #ifdef CONFIG_INPUT
+static int sysrq_reset_downtime_ms;
 
 /* Simple translation table for the SysRq keys */
 static const unsigned char sysrq_xlate[KEY_CNT] =
@@ -947,23 +945,8 @@ static bool sysrq_handler_registered;
 
 static inline void sysrq_register_handler(void)
 {
-	unsigned short key;
 	int error;
-	int i;
 
-	/* First check if a __weak interface was instantiated. */
-	for (i = 0; i < ARRAY_SIZE(sysrq_reset_seq); i++) {
-		key = platform_sysrq_reset_seq[i];
-		if (key == KEY_RESERVED || key > KEY_MAX)
-			break;
-
-		sysrq_reset_seq[sysrq_reset_seq_len++] = key;
-	}
-
-	/*
-	 * DT configuration takes precedence over anything that would
-	 * have been defined via the __weak interface.
-	 */
 	sysrq_of_get_keyreset_config();
 
 	error = input_register_handler(&sysrq_handler);
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/usb/host/ehci-exynos.c linux-libre-3.18.53-gnu/drivers/usb/host/ehci-exynos.c
--- linux-libre-3.18.52-gnu/drivers/usb/host/ehci-exynos.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/usb/host/ehci-exynos.c	2017-05-15 03:19:33.000000000 -0400
@@ -78,10 +78,12 @@ static int exynos_ehci_get_phy(struct de
 		if (IS_ERR(phy)) {
 			ret = PTR_ERR(phy);
 			if (ret == -EPROBE_DEFER) {
+				of_node_put(child);
 				return ret;
 			} else if (ret != -ENOSYS && ret != -ENODEV) {
 				dev_err(dev,
 					"Error retrieving usb2 phy: %d\n", ret);
+				of_node_put(child);
 				return ret;
 			}
 		}
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/usb/host/ohci-exynos.c linux-libre-3.18.53-gnu/drivers/usb/host/ohci-exynos.c
--- linux-libre-3.18.52-gnu/drivers/usb/host/ohci-exynos.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/usb/host/ohci-exynos.c	2017-05-15 03:19:33.000000000 -0400
@@ -67,10 +67,12 @@ static int exynos_ohci_get_phy(struct de
 		if (IS_ERR(phy)) {
 			ret = PTR_ERR(phy);
 			if (ret == -EPROBE_DEFER) {
+				of_node_put(child);
 				return ret;
 			} else if (ret != -ENOSYS && ret != -ENODEV) {
 				dev_err(dev,
 					"Error retrieving usb2 phy: %d\n", ret);
+				of_node_put(child);
 				return ret;
 			}
 		}
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/usb/serial/ark3116.c linux-libre-3.18.53-gnu/drivers/usb/serial/ark3116.c
--- linux-libre-3.18.52-gnu/drivers/usb/serial/ark3116.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/usb/serial/ark3116.c	2017-05-15 03:19:33.000000000 -0400
@@ -366,23 +366,29 @@ static int ark3116_open(struct tty_struc
 		dev_dbg(&port->dev,
 			"%s - usb_serial_generic_open failed: %d\n",
 			__func__, result);
-		goto err_out;
+		goto err_free;
 	}
 
 	/* remove any data still left: also clears error state */
 	ark3116_read_reg(serial, UART_RX, buf);
 
 	/* read modem status */
-	priv->msr = ark3116_read_reg(serial, UART_MSR, buf);
+	result = ark3116_read_reg(serial, UART_MSR, buf);
+	if (result < 0)
+		goto err_close;
+	priv->msr = *buf;
+
 	/* read line status */
-	priv->lsr = ark3116_read_reg(serial, UART_LSR, buf);
+	result = ark3116_read_reg(serial, UART_LSR, buf);
+	if (result < 0)
+		goto err_close;
+	priv->lsr = *buf;
 
 	result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
 	if (result) {
 		dev_err(&port->dev, "submit irq_in urb failed %d\n",
 			result);
-		ark3116_close(port);
-		goto err_out;
+		goto err_close;
 	}
 
 	/* activate interrupts */
@@ -395,8 +401,15 @@ static int ark3116_open(struct tty_struc
 	if (tty)
 		ark3116_set_termios(tty, port, NULL);
 
-err_out:
 	kfree(buf);
+
+	return 0;
+
+err_close:
+	usb_serial_generic_close(port);
+err_free:
+	kfree(buf);
+
 	return result;
 }
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/usb/serial/digi_acceleport.c linux-libre-3.18.53-gnu/drivers/usb/serial/digi_acceleport.c
--- linux-libre-3.18.52-gnu/drivers/usb/serial/digi_acceleport.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/usb/serial/digi_acceleport.c	2017-05-15 03:19:33.000000000 -0400
@@ -1399,25 +1399,30 @@ static int digi_read_inb_callback(struct
 {
 	struct usb_serial_port *port = urb->context;
 	struct digi_port *priv = usb_get_serial_port_data(port);
-	int opcode = ((unsigned char *)urb->transfer_buffer)[0];
-	int len = ((unsigned char *)urb->transfer_buffer)[1];
-	int port_status = ((unsigned char *)urb->transfer_buffer)[2];
-	unsigned char *data = ((unsigned char *)urb->transfer_buffer) + 3;
+	unsigned char *buf = urb->transfer_buffer;
+	int opcode;
+	int len;
+	int port_status;
+	unsigned char *data;
 	int flag, throttled;
-	int status = urb->status;
-
-	/* do not process callbacks on closed ports */
-	/* but do continue the read chain */
-	if (urb->status == -ENOENT)
-		return 0;
 
 	/* short/multiple packet check */
+	if (urb->actual_length < 2) {
+		dev_warn(&port->dev, "short packet received\n");
+		return -1;
+	}
+
+	opcode = buf[0];
+	len = buf[1];
+
 	if (urb->actual_length != len + 2) {
-		dev_err(&port->dev, "%s: INCOMPLETE OR MULTIPLE PACKET, "
-			"status=%d, port=%d, opcode=%d, len=%d, "
-			"actual_length=%d, status=%d\n", __func__, status,
-			priv->dp_port_num, opcode, len, urb->actual_length,
-			port_status);
+		dev_err(&port->dev, "malformed packet received: port=%d, opcode=%d, len=%d, actual_length=%u\n",
+			priv->dp_port_num, opcode, len, urb->actual_length);
+		return -1;
+	}
+
+	if (opcode == DIGI_CMD_RECEIVE_DATA && len < 1) {
+		dev_err(&port->dev, "malformed data packet received\n");
 		return -1;
 	}
 
@@ -1431,6 +1436,9 @@ static int digi_read_inb_callback(struct
 
 	/* receive data */
 	if (opcode == DIGI_CMD_RECEIVE_DATA) {
+		port_status = buf[2];
+		data = &buf[3];
+
 		/* get flag from port_status */
 		flag = 0;
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/usb/serial/ftdi_sio.c linux-libre-3.18.53-gnu/drivers/usb/serial/ftdi_sio.c
--- linux-libre-3.18.52-gnu/drivers/usb/serial/ftdi_sio.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/usb/serial/ftdi_sio.c	2017-05-15 03:19:33.000000000 -0400
@@ -1437,10 +1437,13 @@ static int read_latency_timer(struct usb
 			     FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE,
 			     0, priv->interface,
 			     buf, 1, WDR_TIMEOUT);
-	if (rv < 0)
+	if (rv < 1) {
 		dev_err(&port->dev, "Unable to read latency timer: %i\n", rv);
-	else
+		if (rv >= 0)
+			rv = -EIO;
+	} else {
 		priv->latency = buf[0];
+	}
 
 	kfree(buf);
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/usb/serial/io_edgeport.c linux-libre-3.18.53-gnu/drivers/usb/serial/io_edgeport.c
--- linux-libre-3.18.52-gnu/drivers/usb/serial/io_edgeport.c	2017-05-08 03:24:52.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/usb/serial/io_edgeport.c	2017-05-16 12:25:44.000000000 -0400
@@ -492,20 +492,24 @@ static int get_epic_descriptor(struct ed
 	int result;
 	struct usb_serial *serial = ep->serial;
 	struct edgeport_product_info *product_info = &ep->product_info;
-	struct edge_compatibility_descriptor *epic = &ep->epic_descriptor;
+	struct edge_compatibility_descriptor *epic;
 	struct edge_compatibility_bits *bits;
 	struct device *dev = &serial->dev->dev;
 
 	ep->is_epic = 0;
+
+	epic = kmalloc(sizeof(*epic), GFP_KERNEL);
+	if (!epic)
+		return -ENOMEM;
+
 	result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
 				 USB_REQUEST_ION_GET_EPIC_DESC,
 				 0xC0, 0x00, 0x00,
-				 &ep->epic_descriptor,
-				 sizeof(struct edge_compatibility_descriptor),
+				 epic, sizeof(*epic),
 				 300);
-
-	if (result > 0) {
+	if (result == sizeof(*epic)) {
 		ep->is_epic = 1;
+		memcpy(&ep->epic_descriptor, epic, sizeof(*epic));
 		memset(product_info, 0, sizeof(struct edgeport_product_info));
 
 		product_info->NumPorts = epic->NumPorts;
@@ -534,8 +538,16 @@ static int get_epic_descriptor(struct ed
 		dev_dbg(dev, "  IOSPWriteLCR     : %s\n", bits->IOSPWriteLCR	? "TRUE": "FALSE");
 		dev_dbg(dev, "  IOSPSetBaudRate  : %s\n", bits->IOSPSetBaudRate	? "TRUE": "FALSE");
 		dev_dbg(dev, "  TrueEdgeport     : %s\n", bits->TrueEdgeport	? "TRUE": "FALSE");
+
+		result = 0;
+	} else if (result >= 0) {
+		dev_warn(&serial->interface->dev, "short epic descriptor received: %d\n",
+			 result);
+		result = -EIO;
 	}
 
+	kfree(epic);
+
 	return result;
 }
 
@@ -2097,8 +2109,7 @@ static int rom_write(struct usb_serial *
  * rom_read
  *	reads a number of bytes from the Edgeport device starting at the given
  *	address.
- *	If successful returns the number of bytes read, otherwise it returns
- *	a negative error number of the problem.
+ *	Returns zero on success or a negative error number.
  ****************************************************************************/
 static int rom_read(struct usb_serial *serial, __u16 extAddr,
 					__u16 addr, __u16 length, __u8 *data)
@@ -2123,12 +2134,17 @@ static int rom_read(struct usb_serial *s
 					USB_REQUEST_ION_READ_ROM,
 					0xC0, addr, extAddr, transfer_buffer,
 					current_length, 300);
-		if (result < 0)
+		if (result < current_length) {
+			if (result >= 0)
+				result = -EIO;
 			break;
+		}
 		memcpy(data, transfer_buffer, current_length);
 		length -= current_length;
 		addr += current_length;
 		data += current_length;
+
+		result = 0;
 	}
 
 	kfree(transfer_buffer);
@@ -2585,9 +2601,10 @@ static void get_manufacturing_desc(struc
 				EDGE_MANUF_DESC_LEN,
 				(__u8 *)(&edge_serial->manuf_descriptor));
 
-	if (response < 1)
-		dev_err(dev, "error in getting manufacturer descriptor\n");
-	else {
+	if (response < 0) {
+		dev_err(dev, "error in getting manufacturer descriptor: %d\n",
+				response);
+	} else {
 		char string[30];
 		dev_dbg(dev, "**Manufacturer Descriptor\n");
 		dev_dbg(dev, "  RomSize:        %dK\n",
@@ -2644,9 +2661,10 @@ static void get_boot_desc(struct edgepor
 				EDGE_BOOT_DESC_LEN,
 				(__u8 *)(&edge_serial->boot_descriptor));
 
-	if (response < 1)
-		dev_err(dev, "error in getting boot descriptor\n");
-	else {
+	if (response < 0) {
+		dev_err(dev, "error in getting boot descriptor: %d\n",
+				response);
+	} else {
 		dev_dbg(dev, "**Boot Descriptor:\n");
 		dev_dbg(dev, "  BootCodeLength: %d\n",
 			le16_to_cpu(edge_serial->boot_descriptor.BootCodeLength));
@@ -2784,7 +2802,7 @@ static int edge_startup(struct usb_seria
 	dev_info(&serial->dev->dev, "%s detected\n", edge_serial->name);
 
 	/* Read the epic descriptor */
-	if (get_epic_descriptor(edge_serial) <= 0) {
+	if (get_epic_descriptor(edge_serial) < 0) {
 		/* memcpy descriptor to Supports structures */
 		memcpy(&edge_serial->epic_descriptor.Supports, descriptor,
 		       sizeof(struct edge_compatibility_bits));
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/usb/serial/keyspan_pda.c linux-libre-3.18.53-gnu/drivers/usb/serial/keyspan_pda.c
--- linux-libre-3.18.52-gnu/drivers/usb/serial/keyspan_pda.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/usb/serial/keyspan_pda.c	2017-05-15 03:19:33.000000000 -0400
@@ -139,6 +139,7 @@ static void keyspan_pda_rx_interrupt(str
 {
 	struct usb_serial_port *port = urb->context;
 	unsigned char *data = urb->transfer_buffer;
+	unsigned int len = urb->actual_length;
 	int retval;
 	int status = urb->status;
 	struct keyspan_pda_private *priv;
@@ -159,18 +160,26 @@ static void keyspan_pda_rx_interrupt(str
 		goto exit;
 	}
 
+	if (len < 1) {
+		dev_warn(&port->dev, "short message received\n");
+		goto exit;
+	}
+
 	/* see if the message is data or a status interrupt */
 	switch (data[0]) {
 	case 0:
 		 /* rest of message is rx data */
-		if (urb->actual_length) {
-			tty_insert_flip_string(&port->port, data + 1,
-						urb->actual_length - 1);
-			tty_flip_buffer_push(&port->port);
-		}
+		if (len < 2)
+			break;
+		tty_insert_flip_string(&port->port, data + 1, len - 1);
+		tty_flip_buffer_push(&port->port);
 		break;
 	case 1:
 		/* status interrupt */
+		if (len < 3) {
+			dev_warn(&port->dev, "short interrupt message received\n");
+			break;
+		}
 		dev_dbg(&port->dev, "rx int, d1=%d, d2=%d\n", data[1], data[2]);
 		switch (data[1]) {
 		case 1: /* modemline change */
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/usb/serial/mct_u232.c linux-libre-3.18.53-gnu/drivers/usb/serial/mct_u232.c
--- linux-libre-3.18.52-gnu/drivers/usb/serial/mct_u232.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/usb/serial/mct_u232.c	2017-05-15 03:19:33.000000000 -0400
@@ -322,8 +322,12 @@ static int mct_u232_get_modem_stat(struc
 			MCT_U232_GET_REQUEST_TYPE,
 			0, 0, buf, MCT_U232_GET_MODEM_STAT_SIZE,
 			WDR_TIMEOUT);
-	if (rc < 0) {
+	if (rc < MCT_U232_GET_MODEM_STAT_SIZE) {
 		dev_err(&port->dev, "Get MODEM STATus failed (error = %d)\n", rc);
+
+		if (rc >= 0)
+			rc = -EIO;
+
 		*msr = 0;
 	} else {
 		*msr = buf[0];
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/usb/serial/quatech2.c linux-libre-3.18.53-gnu/drivers/usb/serial/quatech2.c
--- linux-libre-3.18.52-gnu/drivers/usb/serial/quatech2.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/usb/serial/quatech2.c	2017-05-15 03:19:33.000000000 -0400
@@ -188,22 +188,22 @@ static inline int qt2_setdevice(struct u
 }
 
 
-static inline int qt2_getdevice(struct usb_device *dev, u8 *data)
-{
-	return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
-			       QT_SET_GET_DEVICE, 0xc0, 0, 0,
-			       data, 3, QT2_USB_TIMEOUT);
-}
-
 static inline int qt2_getregister(struct usb_device *dev,
 				  u8 uart,
 				  u8 reg,
 				  u8 *data)
 {
-	return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
-			       QT_SET_GET_REGISTER, 0xc0, reg,
-			       uart, data, sizeof(*data), QT2_USB_TIMEOUT);
+	int ret;
+
+	ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+			      QT_SET_GET_REGISTER, 0xc0, reg,
+			      uart, data, sizeof(*data), QT2_USB_TIMEOUT);
+	if (ret < sizeof(*data)) {
+		if (ret >= 0)
+			ret = -EIO;
+	}
 
+	return ret;
 }
 
 static inline int qt2_setregister(struct usb_device *dev,
@@ -372,9 +372,11 @@ static int qt2_open(struct tty_struct *t
 				 0xc0, 0,
 				 device_port, data, 2, QT2_USB_TIMEOUT);
 
-	if (status < 0) {
+	if (status < 2) {
 		dev_err(&port->dev, "%s - open port failed %i\n", __func__,
 			status);
+		if (status >= 0)
+			status = -EIO;
 		kfree(data);
 		return status;
 	}
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/usb/serial/ssu100.c linux-libre-3.18.53-gnu/drivers/usb/serial/ssu100.c
--- linux-libre-3.18.52-gnu/drivers/usb/serial/ssu100.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/usb/serial/ssu100.c	2017-05-15 03:19:33.000000000 -0400
@@ -80,9 +80,17 @@ static inline int ssu100_setdevice(struc
 
 static inline int ssu100_getdevice(struct usb_device *dev, u8 *data)
 {
-	return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
-			       QT_SET_GET_DEVICE, 0xc0, 0, 0,
-			       data, 3, 300);
+	int ret;
+
+	ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+			      QT_SET_GET_DEVICE, 0xc0, 0, 0,
+			      data, 3, 300);
+	if (ret < 3) {
+		if (ret >= 0)
+			ret = -EIO;
+	}
+
+	return ret;
 }
 
 static inline int ssu100_getregister(struct usb_device *dev,
@@ -90,10 +98,17 @@ static inline int ssu100_getregister(str
 				     unsigned short reg,
 				     u8 *data)
 {
-	return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
-			       QT_SET_GET_REGISTER, 0xc0, reg,
-			       uart, data, sizeof(*data), 300);
+	int ret;
 
+	ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+			      QT_SET_GET_REGISTER, 0xc0, reg,
+			      uart, data, sizeof(*data), 300);
+	if (ret < sizeof(*data)) {
+		if (ret >= 0)
+			ret = -EIO;
+	}
+
+	return ret;
 }
 
 
@@ -289,8 +304,10 @@ static int ssu100_open(struct tty_struct
 				 QT_OPEN_CLOSE_CHANNEL,
 				 QT_TRANSFER_IN, 0x01,
 				 0, data, 2, 300);
-	if (result < 0) {
+	if (result < 2) {
 		dev_dbg(&port->dev, "%s - open failed %i\n", __func__, result);
+		if (result >= 0)
+			result = -EIO;
 		kfree(data);
 		return result;
 	}
diff -druNp --no-dereference linux-libre-3.18.52-gnu/drivers/usb/serial/ti_usb_3410_5052.c linux-libre-3.18.53-gnu/drivers/usb/serial/ti_usb_3410_5052.c
--- linux-libre-3.18.52-gnu/drivers/usb/serial/ti_usb_3410_5052.c	2017-05-08 03:25:45.000000000 -0400
+++ linux-libre-3.18.53-gnu/drivers/usb/serial/ti_usb_3410_5052.c	2017-05-16 12:25:57.000000000 -0400
@@ -1337,13 +1337,10 @@ static int ti_command_out_sync(struct ti
 		(USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT),
 		value, moduleid, data, size, 1000);
 
-	if (status == size)
-		status = 0;
-
-	if (status > 0)
-		status = -ECOMM;
+	if (status < 0)
+		return status;
 
-	return status;
+	return 0;
 }
 
 
@@ -1359,8 +1356,7 @@ static int ti_command_in_sync(struct ti_
 
 	if (status == size)
 		status = 0;
-
-	if (status > 0)
+	else if (status >= 0)
 		status = -ECOMM;
 
 	return status;
diff -druNp --no-dereference linux-libre-3.18.52-gnu/fs/9p/acl.c linux-libre-3.18.53-gnu/fs/9p/acl.c
--- linux-libre-3.18.52-gnu/fs/9p/acl.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/fs/9p/acl.c	2017-05-15 03:19:33.000000000 -0400
@@ -321,6 +321,7 @@ static int v9fs_xattr_set_acl(struct den
 		name = POSIX_ACL_XATTR_ACCESS;
 		if (acl) {
 			struct iattr iattr;
+			struct posix_acl *old_acl = acl;
 
 			retval = posix_acl_update_mode(inode, &iattr.ia_mode, &acl);
 			if (retval)
@@ -331,6 +332,7 @@ static int v9fs_xattr_set_acl(struct den
 				 * by the mode bits. So don't
 				 * update ACL.
 				 */
+				posix_acl_release(old_acl);
 				value = NULL;
 				size = 0;
 			}
diff -druNp --no-dereference linux-libre-3.18.52-gnu/fs/f2fs/super.c linux-libre-3.18.53-gnu/fs/f2fs/super.c
--- linux-libre-3.18.52-gnu/fs/f2fs/super.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/fs/f2fs/super.c	2017-05-15 03:19:33.000000000 -0400
@@ -913,6 +913,13 @@ static int sanity_check_raw_super(struct
 		return 1;
 	}
 
+	if (le32_to_cpu(raw_super->segment_count) > F2FS_MAX_SEGMENT) {
+		f2fs_msg(sb, KERN_INFO,
+			"Invalid segment count (%u)",
+			le32_to_cpu(raw_super->segment_count));
+		return 1;
+	}
+
 	/* check CP/SIT/NAT/SSA/MAIN_AREA area boundary */
 	if (sanity_check_area_boundary(sb, raw_super))
 		return 1;
diff -druNp --no-dereference linux-libre-3.18.52-gnu/include/linux/f2fs_fs.h linux-libre-3.18.53-gnu/include/linux/f2fs_fs.h
--- linux-libre-3.18.52-gnu/include/linux/f2fs_fs.h	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/include/linux/f2fs_fs.h	2017-05-15 03:19:33.000000000 -0400
@@ -269,6 +269,12 @@ struct f2fs_nat_block {
 #define SIT_ENTRY_PER_BLOCK (PAGE_CACHE_SIZE / sizeof(struct f2fs_sit_entry))
 
 /*
+ * F2FS uses 4 bytes to represent block address. As a result, supported size of
+ * disk is 16 TB and it equals to 16 * 1024 * 1024 / 2 segments.
+ */
+#define F2FS_MAX_SEGMENT       ((16 * 1024 * 1024) / 2)
+
+/*
  * Note that f2fs_sit_entry->vblocks has the following bit-field information.
  * [15:10] : allocation type such as CURSEG_XXXX_TYPE
  * [9:0] : valid block count
diff -druNp --no-dereference linux-libre-3.18.52-gnu/include/linux/mtd/map.h linux-libre-3.18.53-gnu/include/linux/mtd/map.h
--- linux-libre-3.18.52-gnu/include/linux/mtd/map.h	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/include/linux/mtd/map.h	2017-05-15 03:19:33.000000000 -0400
@@ -309,7 +309,17 @@ static inline map_word map_word_or(struc
 	return r;
 }
 
-#define map_word_andequal(m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b))
+static inline int map_word_andequal(struct map_info *map, map_word val1, map_word val2, map_word val3)
+{
+	int i;
+
+	for (i = 0; i < map_words(map); i++) {
+		if ((val1.x[i] & val2.x[i]) != val3.x[i])
+			return 0;
+	}
+
+	return 1;
+}
 
 static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word val2)
 {
diff -druNp --no-dereference linux-libre-3.18.52-gnu/include/net/addrconf.h linux-libre-3.18.53-gnu/include/net/addrconf.h
--- linux-libre-3.18.52-gnu/include/net/addrconf.h	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/include/net/addrconf.h	2017-05-15 03:19:33.000000000 -0400
@@ -19,6 +19,8 @@
 #define ADDRCONF_TIMER_FUZZ		(HZ / 4)
 #define ADDRCONF_TIMER_FUZZ_MAX		(HZ)
 
+#define ADDRCONF_NOTIFY_PRIORITY	0
+
 #include <linux/in.h>
 #include <linux/in6.h>
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/include/net/ip6_route.h linux-libre-3.18.53-gnu/include/net/ip6_route.h
--- linux-libre-3.18.52-gnu/include/net/ip6_route.h	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/include/net/ip6_route.h	2017-05-15 03:19:33.000000000 -0400
@@ -69,6 +69,7 @@ struct dst_entry *ip6_route_output(struc
 struct dst_entry *ip6_route_lookup(struct net *net, struct flowi6 *fl6,
 				   int flags);
 
+void ip6_route_init_special_entries(void);
 int ip6_route_init(void);
 void ip6_route_cleanup(void);
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/Makefile linux-libre-3.18.53-gnu/Makefile
--- linux-libre-3.18.52-gnu/Makefile	2017-05-08 02:47:54.000000000 -0400
+++ linux-libre-3.18.53-gnu/Makefile	2017-05-16 12:04:09.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 18
-SUBLEVEL = 52
+SUBLEVEL = 53
 EXTRAVERSION =-gnu
 NAME = Diseased Newt
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/net/ipv4/raw.c linux-libre-3.18.53-gnu/net/ipv4/raw.c
--- linux-libre-3.18.52-gnu/net/ipv4/raw.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/net/ipv4/raw.c	2017-05-15 03:19:33.000000000 -0400
@@ -345,6 +345,9 @@ static int raw_send_hdrinc(struct sock *
 			       rt->dst.dev->mtu);
 		return -EMSGSIZE;
 	}
+	if (length < sizeof(struct iphdr))
+		return -EINVAL;
+
 	if (flags&MSG_PROBE)
 		goto out;
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/net/ipv4/tcp_lp.c linux-libre-3.18.53-gnu/net/ipv4/tcp_lp.c
--- linux-libre-3.18.52-gnu/net/ipv4/tcp_lp.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/net/ipv4/tcp_lp.c	2017-05-15 03:19:33.000000000 -0400
@@ -264,13 +264,15 @@ static void tcp_lp_pkts_acked(struct soc
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct lp *lp = inet_csk_ca(sk);
+	u32 delta;
 
 	if (rtt_us > 0)
 		tcp_lp_rtt_sample(sk, rtt_us);
 
 	/* calc inference */
-	if (tcp_time_stamp > tp->rx_opt.rcv_tsecr)
-		lp->inference = 3 * (tcp_time_stamp - tp->rx_opt.rcv_tsecr);
+	delta = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
+	if ((s32)delta > 0)
+		lp->inference = 3 * delta;
 
 	/* test if within inference */
 	if (lp->last_drop && (tcp_time_stamp - lp->last_drop < lp->inference))
diff -druNp --no-dereference linux-libre-3.18.52-gnu/net/ipv4/tcp_output.c linux-libre-3.18.53-gnu/net/ipv4/tcp_output.c
--- linux-libre-3.18.52-gnu/net/ipv4/tcp_output.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/net/ipv4/tcp_output.c	2017-05-15 03:19:33.000000000 -0400
@@ -1212,7 +1212,7 @@ int tcp_fragment(struct sock *sk, struct
  * eventually). The difference is that pulled data not copied, but
  * immediately discarded.
  */
-static void __pskb_trim_head(struct sk_buff *skb, int len)
+static int __pskb_trim_head(struct sk_buff *skb, int len)
 {
 	struct skb_shared_info *shinfo;
 	int i, k, eat;
@@ -1222,7 +1222,7 @@ static void __pskb_trim_head(struct sk_b
 		__skb_pull(skb, eat);
 		len -= eat;
 		if (!len)
-			return;
+			return 0;
 	}
 	eat = len;
 	k = 0;
@@ -1248,23 +1248,28 @@ static void __pskb_trim_head(struct sk_b
 	skb_reset_tail_pointer(skb);
 	skb->data_len -= len;
 	skb->len = skb->data_len;
+	return len;
 }
 
 /* Remove acked data from a packet in the transmit queue. */
 int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
 {
+	u32 delta_truesize;
+
 	if (skb_unclone(skb, GFP_ATOMIC))
 		return -ENOMEM;
 
-	__pskb_trim_head(skb, len);
+	delta_truesize = __pskb_trim_head(skb, len);
 
 	TCP_SKB_CB(skb)->seq += len;
 	skb->ip_summed = CHECKSUM_PARTIAL;
 
-	skb->truesize	     -= len;
-	sk->sk_wmem_queued   -= len;
-	sk_mem_uncharge(sk, len);
-	sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
+	if (delta_truesize) {
+		skb->truesize	   -= delta_truesize;
+		sk->sk_wmem_queued -= delta_truesize;
+		sk_mem_uncharge(sk, delta_truesize);
+		sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
+	}
 
 	/* Any change of skb->len requires recalculation of tso factor. */
 	if (tcp_skb_pcount(skb) > 1)
diff -druNp --no-dereference linux-libre-3.18.52-gnu/net/ipv6/addrconf.c linux-libre-3.18.53-gnu/net/ipv6/addrconf.c
--- linux-libre-3.18.52-gnu/net/ipv6/addrconf.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/net/ipv6/addrconf.c	2017-05-15 03:19:33.000000000 -0400
@@ -2984,6 +2984,7 @@ static int addrconf_notify(struct notifi
  */
 static struct notifier_block ipv6_dev_notf = {
 	.notifier_call = addrconf_notify,
+	.priority = ADDRCONF_NOTIFY_PRIORITY,
 };
 
 static void addrconf_type_change(struct net_device *dev, unsigned long event)
@@ -5441,6 +5442,8 @@ int __init addrconf_init(void)
 		goto errlo;
 	}
 
+	ip6_route_init_special_entries();
+
 	for (i = 0; i < IN6_ADDR_HSIZE; i++)
 		INIT_HLIST_HEAD(&inet6_addr_lst[i]);
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/net/ipv6/raw.c linux-libre-3.18.53-gnu/net/ipv6/raw.c
--- linux-libre-3.18.52-gnu/net/ipv6/raw.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/net/ipv6/raw.c	2017-05-15 03:19:33.000000000 -0400
@@ -624,6 +624,8 @@ static int rawv6_send_hdrinc(struct sock
 		ipv6_local_error(sk, EMSGSIZE, fl6, rt->dst.dev->mtu);
 		return -EMSGSIZE;
 	}
+	if (length < sizeof(struct ipv6hdr))
+		return -EINVAL;
 	if (flags&MSG_PROBE)
 		goto out;
 
diff -druNp --no-dereference linux-libre-3.18.52-gnu/net/ipv6/route.c linux-libre-3.18.53-gnu/net/ipv6/route.c
--- linux-libre-3.18.52-gnu/net/ipv6/route.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/net/ipv6/route.c	2017-05-15 03:19:33.000000000 -0400
@@ -2815,7 +2815,10 @@ static int ip6_route_dev_notify(struct n
 	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
 	struct net *net = dev_net(dev);
 
-	if (event == NETDEV_REGISTER && (dev->flags & IFF_LOOPBACK)) {
+	if (!(dev->flags & IFF_LOOPBACK))
+		return NOTIFY_OK;
+
+	if (event == NETDEV_REGISTER) {
 		net->ipv6.ip6_null_entry->dst.dev = dev;
 		net->ipv6.ip6_null_entry->rt6i_idev = in6_dev_get(dev);
 #ifdef CONFIG_IPV6_MULTIPLE_TABLES
@@ -2824,6 +2827,12 @@ static int ip6_route_dev_notify(struct n
 		net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
 		net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
 #endif
+	 } else if (event == NETDEV_UNREGISTER) {
+		in6_dev_put(net->ipv6.ip6_null_entry->rt6i_idev);
+#ifdef CONFIG_IPV6_MULTIPLE_TABLES
+		in6_dev_put(net->ipv6.ip6_prohibit_entry->rt6i_idev);
+		in6_dev_put(net->ipv6.ip6_blk_hole_entry->rt6i_idev);
+#endif
 	}
 
 	return NOTIFY_OK;
@@ -3130,9 +3139,24 @@ static struct pernet_operations ip6_rout
 
 static struct notifier_block ip6_route_dev_notifier = {
 	.notifier_call = ip6_route_dev_notify,
-	.priority = 0,
+	.priority = ADDRCONF_NOTIFY_PRIORITY - 10,
 };
 
+void __init ip6_route_init_special_entries(void)
+{
+	/* Registering of the loopback is done before this portion of code,
+	 * the loopback reference in rt6_info will not be taken, do it
+	 * manually for init_net */
+	init_net.ipv6.ip6_null_entry->dst.dev = init_net.loopback_dev;
+	init_net.ipv6.ip6_null_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
+  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
+	init_net.ipv6.ip6_prohibit_entry->dst.dev = init_net.loopback_dev;
+	init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
+	init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
+	init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
+  #endif
+}
+
 int __init ip6_route_init(void)
 {
 	int ret;
@@ -3158,17 +3182,6 @@ int __init ip6_route_init(void)
 
 	ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops_template.kmem_cachep;
 
-	/* Registering of the loopback is done before this portion of code,
-	 * the loopback reference in rt6_info will not be taken, do it
-	 * manually for init_net */
-	init_net.ipv6.ip6_null_entry->dst.dev = init_net.loopback_dev;
-	init_net.ipv6.ip6_null_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
-  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
-	init_net.ipv6.ip6_prohibit_entry->dst.dev = init_net.loopback_dev;
-	init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
-	init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
-	init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
-  #endif
 	ret = fib6_init();
 	if (ret)
 		goto out_register_subsys;
diff -druNp --no-dereference linux-libre-3.18.52-gnu/tools/power/cpupower/utils/helpers/cpuid.c linux-libre-3.18.53-gnu/tools/power/cpupower/utils/helpers/cpuid.c
--- linux-libre-3.18.52-gnu/tools/power/cpupower/utils/helpers/cpuid.c	2017-05-08 01:44:29.000000000 -0400
+++ linux-libre-3.18.53-gnu/tools/power/cpupower/utils/helpers/cpuid.c	2017-05-15 03:19:33.000000000 -0400
@@ -156,6 +156,7 @@ out:
 					 */
 			case 0x2C:	/* Westmere EP - Gulftown */
 				cpu_info->caps |= CPUPOWER_CAP_HAS_TURBO_RATIO;
+				break;
 			case 0x2A:	/* SNB */
 			case 0x2D:	/* SNB Xeon */
 			case 0x3A:	/* IVB */
