diff -druNp --no-dereference linux-libre-3.18.59-gnu/arch/arm/boot/dts/bcm5301x.dtsi linux-libre-3.18.60-gnu/arch/arm/boot/dts/bcm5301x.dtsi
--- linux-libre-3.18.59-gnu/arch/arm/boot/dts/bcm5301x.dtsi	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/arch/arm/boot/dts/bcm5301x.dtsi	2017-07-05 08:35:29.000000000 -0400
@@ -52,14 +52,14 @@
 		timer@0200 {
 			compatible = "arm,cortex-a9-global-timer";
 			reg = <0x0200 0x100>;
-			interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&clk_periph>;
 		};
 
 		local-timer@0600 {
 			compatible = "arm,cortex-a9-twd-timer";
 			reg = <0x0600 0x100>;
-			interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_PPI 13 IRQ_TYPE_EDGE_RISING>;
 			clocks = <&clk_periph>;
 		};
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/arch/arm/mm/mmu.c linux-libre-3.18.60-gnu/arch/arm/mm/mmu.c
--- linux-libre-3.18.59-gnu/arch/arm/mm/mmu.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/arch/arm/mm/mmu.c	2017-07-05 08:35:29.000000000 -0400
@@ -1142,15 +1142,15 @@ void __init sanity_check_meminfo(void)
 
 	high_memory = __va(arm_lowmem_limit - 1) + 1;
 
+	if (!memblock_limit)
+		memblock_limit = arm_lowmem_limit;
+
 	/*
 	 * Round the memblock limit down to a pmd size.  This
 	 * helps to ensure that we will allocate memory from the
 	 * last full pmd, which should be mapped.
 	 */
-	if (memblock_limit)
-		memblock_limit = round_down(memblock_limit, PMD_SIZE);
-	if (!memblock_limit)
-		memblock_limit = arm_lowmem_limit;
+	memblock_limit = round_down(memblock_limit, PMD_SIZE);
 
 	memblock_set_current_limit(memblock_limit);
 }
diff -druNp --no-dereference linux-libre-3.18.59-gnu/arch/arm64/kernel/setup.c linux-libre-3.18.60-gnu/arch/arm64/kernel/setup.c
--- linux-libre-3.18.59-gnu/arch/arm64/kernel/setup.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/arch/arm64/kernel/setup.c	2017-07-05 08:35:29.000000000 -0400
@@ -473,7 +473,8 @@ static const char *compat_hwcap_str[] =
 	"idivt",
 	"vfpd32",
 	"lpae",
-	"evtstrm"
+	"evtstrm",
+	NULL
 };
 
 static const char *compat_hwcap2_str[] = {
diff -druNp --no-dereference linux-libre-3.18.59-gnu/arch/mips/kernel/entry.S linux-libre-3.18.60-gnu/arch/mips/kernel/entry.S
--- linux-libre-3.18.59-gnu/arch/mips/kernel/entry.S	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/arch/mips/kernel/entry.S	2017-07-05 08:35:29.000000000 -0400
@@ -11,6 +11,7 @@
 #include <asm/asm.h>
 #include <asm/asmmacro.h>
 #include <asm/compiler.h>
+#include <asm/irqflags.h>
 #include <asm/regdef.h>
 #include <asm/mipsregs.h>
 #include <asm/stackframe.h>
@@ -119,6 +120,7 @@ work_pending:
 	andi	t0, a2, _TIF_NEED_RESCHED # a2 is preloaded with TI_FLAGS
 	beqz	t0, work_notifysig
 work_resched:
+	TRACE_IRQS_OFF
 	jal	schedule
 
 	local_irq_disable		# make sure need_resched and
@@ -155,6 +157,7 @@ syscall_exit_work:
 	beqz	t0, work_pending	# trace bit set?
 	local_irq_enable		# could let syscall_trace_leave()
 					# call schedule() instead
+	TRACE_IRQS_ON
 	move	a0, sp
 	jal	syscall_trace_leave
 	b	resume_userspace
diff -druNp --no-dereference linux-libre-3.18.59-gnu/arch/mips/kernel/pm-cps.c linux-libre-3.18.60-gnu/arch/mips/kernel/pm-cps.c
--- linux-libre-3.18.59-gnu/arch/mips/kernel/pm-cps.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/arch/mips/kernel/pm-cps.c	2017-07-05 08:35:29.000000000 -0400
@@ -55,7 +55,6 @@ DECLARE_BITMAP(state_support, CPS_PM_STA
  * state. Actually per-core rather than per-CPU.
  */
 static DEFINE_PER_CPU_ALIGNED(u32*, ready_count);
-static DEFINE_PER_CPU_ALIGNED(void*, ready_count_alloc);
 
 /* Indicates online CPUs coupled with the current CPU */
 static DEFINE_PER_CPU_ALIGNED(cpumask_t, online_coupled);
@@ -624,7 +623,6 @@ static int __init cps_gen_core_entries(u
 {
 	enum cps_pm_state state;
 	unsigned core = cpu_data[cpu].core;
-	unsigned dlinesz = cpu_data[cpu].dcache.linesz;
 	void *entry_fn, *core_rc;
 
 	for (state = CPS_PM_NC_WAIT; state < CPS_PM_STATE_COUNT; state++) {
@@ -644,16 +642,11 @@ static int __init cps_gen_core_entries(u
 	}
 
 	if (!per_cpu(ready_count, core)) {
-		core_rc = kmalloc(dlinesz * 2, GFP_KERNEL);
+		core_rc = kmalloc(sizeof(u32), GFP_KERNEL);
 		if (!core_rc) {
 			pr_err("Failed allocate core %u ready_count\n", core);
 			return -ENOMEM;
 		}
-		per_cpu(ready_count_alloc, core) = core_rc;
-
-		/* Ensure ready_count is aligned to a cacheline boundary */
-		core_rc += dlinesz - 1;
-		core_rc = (void *)((unsigned long)core_rc & ~(dlinesz - 1));
 		per_cpu(ready_count, core) = core_rc;
 	}
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/arch/mips/kernel/traps.c linux-libre-3.18.60-gnu/arch/mips/kernel/traps.c
--- linux-libre-3.18.59-gnu/arch/mips/kernel/traps.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/arch/mips/kernel/traps.c	2017-07-05 08:35:29.000000000 -0400
@@ -191,6 +191,8 @@ void show_stack(struct task_struct *task
 {
 	struct pt_regs regs;
 	mm_segment_t old_fs = get_fs();
+
+	regs.cp0_status = KSU_KERNEL;
 	if (sp) {
 		regs.regs[29] = (unsigned long)sp;
 		regs.regs[31] = 0;
diff -druNp --no-dereference linux-libre-3.18.59-gnu/arch/x86/kvm/vmx.c linux-libre-3.18.60-gnu/arch/x86/kvm/vmx.c
--- linux-libre-3.18.59-gnu/arch/x86/kvm/vmx.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/arch/x86/kvm/vmx.c	2017-07-05 08:35:29.000000000 -0400
@@ -2026,7 +2026,7 @@ static int nested_vmx_check_exception(st
 	if (!(vmcs12->exception_bitmap & (1u << nr)))
 		return 0;
 
-	nested_vmx_vmexit(vcpu, to_vmx(vcpu)->exit_reason,
+	nested_vmx_vmexit(vcpu, EXIT_REASON_EXCEPTION_NMI,
 			  vmcs_read32(VM_EXIT_INTR_INFO),
 			  vmcs_readl(EXIT_QUALIFICATION));
 	return 1;
diff -druNp --no-dereference linux-libre-3.18.59-gnu/arch/x86/kvm/x86.c linux-libre-3.18.60-gnu/arch/x86/kvm/x86.c
--- linux-libre-3.18.59-gnu/arch/x86/kvm/x86.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/arch/x86/kvm/x86.c	2017-07-05 08:35:29.000000000 -0400
@@ -4853,6 +4853,8 @@ static bool emulator_get_segment(struct
 
 	if (var.unusable) {
 		memset(desc, 0, sizeof(*desc));
+		if (base3)
+			*base3 = 0;
 		return false;
 	}
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/Documentation/sysctl/kernel.txt linux-libre-3.18.60-gnu/Documentation/sysctl/kernel.txt
--- linux-libre-3.18.59-gnu/Documentation/sysctl/kernel.txt	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/Documentation/sysctl/kernel.txt	2017-07-05 08:35:29.000000000 -0400
@@ -775,14 +775,13 @@ via the /proc/sys interface:
        Each write syscall must fully contain the sysctl value to be
        written, and multiple writes on the same sysctl file descriptor
        will rewrite the sysctl value, regardless of file position.
-   0 - (default) Same behavior as above, but warn about processes that
-       perform writes to a sysctl file descriptor when the file position
-       is not 0.
-   1 - Respect file position when writing sysctl strings. Multiple writes
-       will append to the sysctl value buffer. Anything past the max length
-       of the sysctl value buffer will be ignored. Writes to numeric sysctl
-       entries must always be at file position 0 and the value must be
-       fully contained in the buffer sent in the write syscall.
+   0 - Same behavior as above, but warn about processes that perform writes
+       to a sysctl file descriptor when the file position is not 0.
+   1 - (default) Respect file position when writing sysctl strings. Multiple
+       writes will append to the sysctl value buffer. Anything past the max
+       length of the sysctl value buffer will be ignored. Writes to numeric
+       sysctl entries must always be at file position 0 and the value must
+       be fully contained in the buffer sent in the write syscall.
 
 ==============================================================
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/drivers/cpufreq/s3c2416-cpufreq.c linux-libre-3.18.60-gnu/drivers/cpufreq/s3c2416-cpufreq.c
--- linux-libre-3.18.59-gnu/drivers/cpufreq/s3c2416-cpufreq.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/drivers/cpufreq/s3c2416-cpufreq.c	2017-07-05 08:35:29.000000000 -0400
@@ -400,7 +400,6 @@ static int s3c2416_cpufreq_driver_init(s
 	rate = clk_get_rate(s3c_freq->hclk);
 	if (rate < 133 * 1000 * 1000) {
 		pr_err("cpufreq: HCLK not at 133MHz\n");
-		clk_put(s3c_freq->hclk);
 		ret = -EINVAL;
 		goto err_armclk;
 	}
diff -druNp --no-dereference linux-libre-3.18.59-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c linux-libre-3.18.60-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
--- linux-libre-3.18.59-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c	2017-07-05 08:35:29.000000000 -0400
@@ -317,6 +317,7 @@ void vmw_cmdbuf_res_man_destroy(struct v
 	list_for_each_entry_safe(entry, next, &man->list, head)
 		vmw_cmdbuf_res_free(man, entry);
 
+	drm_ht_remove(&man->resources);
 	kfree(man);
 }
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/drivers/iommu/amd_iommu_v2.c linux-libre-3.18.60-gnu/drivers/iommu/amd_iommu_v2.c
--- linux-libre-3.18.59-gnu/drivers/iommu/amd_iommu_v2.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/drivers/iommu/amd_iommu_v2.c	2017-07-05 08:35:29.000000000 -0400
@@ -701,9 +701,9 @@ out_clear_state:
 
 out_unregister:
 	mmu_notifier_unregister(&pasid_state->mn, mm);
+	mmput(mm);
 
 out_free:
-	mmput(mm);
 	free_pasid_state(pasid_state);
 
 out:
diff -druNp --no-dereference linux-libre-3.18.59-gnu/drivers/iommu/intel-iommu.c linux-libre-3.18.60-gnu/drivers/iommu/intel-iommu.c
--- linux-libre-3.18.59-gnu/drivers/iommu/intel-iommu.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/drivers/iommu/intel-iommu.c	2017-07-05 08:35:29.000000000 -0400
@@ -980,7 +980,7 @@ static void dma_pte_free_level(struct dm
 		if (!dma_pte_present(pte) || dma_pte_superpage(pte))
 			goto next;
 
-		level_pfn = pfn & level_mask(level - 1);
+		level_pfn = pfn & level_mask(level);
 		level_pte = phys_to_virt(dma_pte_addr(pte));
 
 		if (level > 2)
diff -druNp --no-dereference linux-libre-3.18.59-gnu/drivers/mtd/bcm47xxpart.c linux-libre-3.18.60-gnu/drivers/mtd/bcm47xxpart.c
--- linux-libre-3.18.59-gnu/drivers/mtd/bcm47xxpart.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/drivers/mtd/bcm47xxpart.c	2017-07-05 08:35:29.000000000 -0400
@@ -87,8 +87,8 @@ static int bcm47xxpart_parse(struct mtd_
 	/* Parse block by block looking for magics */
 	for (offset = 0; offset <= master->size - blocksize;
 	     offset += blocksize) {
-		/* Nothing more in higher memory */
-		if (offset >= 0x2000000)
+		/* Nothing more in higher memory on BCM47XX (MIPS) */
+		if (config_enabled(CONFIG_BCM47XX) && offset >= 0x2000000)
 			break;
 
 		if (curr_part >= BCM47XXPART_MAX_PARTS) {
diff -druNp --no-dereference linux-libre-3.18.59-gnu/drivers/net/ethernet/korina.c linux-libre-3.18.60-gnu/drivers/net/ethernet/korina.c
--- linux-libre-3.18.59-gnu/drivers/net/ethernet/korina.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/drivers/net/ethernet/korina.c	2017-07-05 08:35:29.000000000 -0400
@@ -900,10 +900,10 @@ static void korina_restart_task(struct w
 				DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR,
 				&lp->rx_dma_regs->dmasm);
 
-	korina_free_ring(dev);
-
 	napi_disable(&lp->napi);
 
+	korina_free_ring(dev);
+
 	if (korina_init(dev) < 0) {
 		printk(KERN_ERR "%s: cannot restart device\n", dev->name);
 		return;
@@ -1064,12 +1064,12 @@ static int korina_close(struct net_devic
 	tmp = tmp | DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR;
 	writel(tmp, &lp->rx_dma_regs->dmasm);
 
-	korina_free_ring(dev);
-
 	napi_disable(&lp->napi);
 
 	cancel_work_sync(&lp->restart_task);
 
+	korina_free_ring(dev);
+
 	free_irq(lp->rx_irq, dev);
 	free_irq(lp->tx_irq, dev);
 	free_irq(lp->ovr_irq, dev);
diff -druNp --no-dereference linux-libre-3.18.59-gnu/drivers/usb/gadget/function/f_fs.c linux-libre-3.18.60-gnu/drivers/usb/gadget/function/f_fs.c
--- linux-libre-3.18.59-gnu/drivers/usb/gadget/function/f_fs.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/drivers/usb/gadget/function/f_fs.c	2017-07-05 08:35:29.000000000 -0400
@@ -3412,6 +3412,7 @@ static void ffs_closed(struct ffs_data *
 {
 	struct ffs_dev *ffs_obj;
 	struct f_fs_opts *opts;
+	struct config_item *ci;
 
 	ENTER();
 	ffs_dev_lock();
@@ -3434,8 +3435,11 @@ static void ffs_closed(struct ffs_data *
 	    || !atomic_read(&opts->func_inst.group.cg_item.ci_kref.refcount))
 		goto done;
 
-	unregister_gadget_item(ffs_obj->opts->
-			       func_inst.group.cg_item.ci_parent->ci_parent);
+	ci = opts->func_inst.group.cg_item.ci_parent->ci_parent;
+	ffs_dev_unlock();
+
+	unregister_gadget_item(ci);
+	return;
 done:
 	ffs_dev_unlock();
 }
diff -druNp --no-dereference linux-libre-3.18.59-gnu/drivers/usb/host/xhci.c linux-libre-3.18.60-gnu/drivers/usb/host/xhci.c
--- linux-libre-3.18.59-gnu/drivers/usb/host/xhci.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/drivers/usb/host/xhci.c	2017-07-05 08:35:29.000000000 -0400
@@ -1565,19 +1565,6 @@ int xhci_urb_dequeue(struct usb_hcd *hcd
 		xhci_urb_free_priv(xhci, urb_priv);
 		return ret;
 	}
-	if ((xhci->xhc_state & XHCI_STATE_DYING) ||
-			(xhci->xhc_state & XHCI_STATE_HALTED)) {
-		xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
-				"Ep 0x%x: URB %p to be canceled on "
-				"non-responsive xHCI host.",
-				urb->ep->desc.bEndpointAddress, urb);
-		/* Let the stop endpoint command watchdog timer (which set this
-		 * state) finish cleaning up the endpoint TD lists.  We must
-		 * have caught it in the middle of dropping a lock and giving
-		 * back an URB.
-		 */
-		goto done;
-	}
 
 	ep_index = xhci_get_endpoint_index(&urb->ep->desc);
 	ep = &xhci->devs[urb->dev->slot_id]->eps[ep_index];
diff -druNp --no-dereference linux-libre-3.18.59-gnu/drivers/usb/host/xhci-ring.c linux-libre-3.18.60-gnu/drivers/usb/host/xhci-ring.c
--- linux-libre-3.18.59-gnu/drivers/usb/host/xhci-ring.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/drivers/usb/host/xhci-ring.c	2017-07-05 08:35:29.000000000 -0400
@@ -839,17 +839,6 @@ void xhci_stop_endpoint_command_watchdog
 	spin_lock_irqsave(&xhci->lock, flags);
 
 	ep->stop_cmds_pending--;
-	if (xhci->xhc_state & XHCI_STATE_REMOVING) {
-		spin_unlock_irqrestore(&xhci->lock, flags);
-		return;
-	}
-	if (xhci->xhc_state & XHCI_STATE_DYING) {
-		xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
-				"Stop EP timer ran, but another timer marked "
-				"xHCI as DYING, exiting.");
-		spin_unlock_irqrestore(&xhci->lock, flags);
-		return;
-	}
 	if (!(ep->stop_cmds_pending == 0 && (ep->ep_state & EP_HALT_PENDING))) {
 		xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
 				"Stop EP timer ran, but no command pending, "
diff -druNp --no-dereference linux-libre-3.18.59-gnu/drivers/watchdog/bcm_kona_wdt.c linux-libre-3.18.60-gnu/drivers/watchdog/bcm_kona_wdt.c
--- linux-libre-3.18.59-gnu/drivers/watchdog/bcm_kona_wdt.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/drivers/watchdog/bcm_kona_wdt.c	2017-07-05 08:35:29.000000000 -0400
@@ -299,6 +299,8 @@ static int bcm_kona_wdt_probe(struct pla
 	if (!wdt)
 		return -ENOMEM;
 
+	spin_lock_init(&wdt->lock);
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	wdt->base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(wdt->base))
@@ -311,7 +313,6 @@ static int bcm_kona_wdt_probe(struct pla
 		return ret;
 	}
 
-	spin_lock_init(&wdt->lock);
 	platform_set_drvdata(pdev, wdt);
 	watchdog_set_drvdata(&bcm_kona_wdt_wdd, wdt);
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/include/net/xfrm.h linux-libre-3.18.60-gnu/include/net/xfrm.h
--- linux-libre-3.18.59-gnu/include/net/xfrm.h	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/include/net/xfrm.h	2017-07-05 08:35:29.000000000 -0400
@@ -949,10 +949,6 @@ struct xfrm_dst {
 	struct flow_cache_object flo;
 	struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
 	int num_pols, num_xfrms;
-#ifdef CONFIG_XFRM_SUB_POLICY
-	struct flowi *origin;
-	struct xfrm_selector *partner;
-#endif
 	u32 xfrm_genid;
 	u32 policy_genid;
 	u32 route_mtu_cached;
@@ -968,12 +964,6 @@ static inline void xfrm_dst_destroy(stru
 	dst_release(xdst->route);
 	if (likely(xdst->u.dst.xfrm))
 		xfrm_state_put(xdst->u.dst.xfrm);
-#ifdef CONFIG_XFRM_SUB_POLICY
-	kfree(xdst->origin);
-	xdst->origin = NULL;
-	kfree(xdst->partner);
-	xdst->partner = NULL;
-#endif
 }
 #endif
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/kernel/sysctl.c linux-libre-3.18.60-gnu/kernel/sysctl.c
--- linux-libre-3.18.59-gnu/kernel/sysctl.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/kernel/sysctl.c	2017-07-05 08:35:29.000000000 -0400
@@ -173,7 +173,7 @@ extern int no_unaligned_warning;
 #define SYSCTL_WRITES_WARN	 0
 #define SYSCTL_WRITES_STRICT	 1
 
-static int sysctl_writes_strict = SYSCTL_WRITES_WARN;
+static int sysctl_writes_strict = SYSCTL_WRITES_STRICT;
 
 static int proc_do_cad_pid(struct ctl_table *table, int write,
 		  void __user *buffer, size_t *lenp, loff_t *ppos);
diff -druNp --no-dereference linux-libre-3.18.59-gnu/Makefile linux-libre-3.18.60-gnu/Makefile
--- linux-libre-3.18.59-gnu/Makefile	2017-06-29 10:00:00.000000000 -0400
+++ linux-libre-3.18.60-gnu/Makefile	2017-07-05 12:41:08.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 18
-SUBLEVEL = 59
+SUBLEVEL = 60
 EXTRAVERSION =-gnu
 NAME = Diseased Newt
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/mm/huge_memory.c linux-libre-3.18.60-gnu/mm/huge_memory.c
--- linux-libre-3.18.59-gnu/mm/huge_memory.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/mm/huge_memory.c	2017-07-05 08:35:29.000000000 -0400
@@ -1294,8 +1294,12 @@ int do_huge_pmd_numa_page(struct mm_stru
 	 * check_same as the page may no longer be mapped.
 	 */
 	if (unlikely(pmd_trans_migrating(*pmdp))) {
+		page = pmd_page(*pmdp);
+		if (!get_page_unless_zero(page))
+			goto out_unlock;
 		spin_unlock(ptl);
 		wait_migrate_huge_page(vma->anon_vma, pmdp);
+		put_page(page);
 		goto out;
 	}
 
@@ -1331,8 +1335,11 @@ int do_huge_pmd_numa_page(struct mm_stru
 
 	/* Migration could have started since the pmd_trans_migrating check */
 	if (!page_locked) {
+		if (!get_page_unless_zero(page))
+			goto out_unlock;
 		spin_unlock(ptl);
 		wait_on_page_locked(page);
+		put_page(page);
 		page_nid = -1;
 		goto out;
 	}
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/8021q/vlan.c linux-libre-3.18.60-gnu/net/8021q/vlan.c
--- linux-libre-3.18.59-gnu/net/8021q/vlan.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/8021q/vlan.c	2017-07-05 08:35:29.000000000 -0400
@@ -278,7 +278,8 @@ static int register_vlan_device(struct n
 	return 0;
 
 out_free_newdev:
-	free_netdev(new_dev);
+	if (new_dev->reg_state == NETREG_UNINITIALIZED)
+		free_netdev(new_dev);
 	return err;
 }
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/caif/cfpkt_skbuff.c linux-libre-3.18.60-gnu/net/caif/cfpkt_skbuff.c
--- linux-libre-3.18.59-gnu/net/caif/cfpkt_skbuff.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/caif/cfpkt_skbuff.c	2017-07-05 08:35:29.000000000 -0400
@@ -81,11 +81,7 @@ static struct cfpkt *cfpkt_create_pfx(u1
 {
 	struct sk_buff *skb;
 
-	if (likely(in_interrupt()))
-		skb = alloc_skb(len + pfx, GFP_ATOMIC);
-	else
-		skb = alloc_skb(len + pfx, GFP_KERNEL);
-
+	skb = alloc_skb(len + pfx, GFP_ATOMIC);
 	if (unlikely(skb == NULL))
 		return NULL;
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/core/dev.c linux-libre-3.18.60-gnu/net/core/dev.c
--- linux-libre-3.18.59-gnu/net/core/dev.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/core/dev.c	2017-07-05 08:35:29.000000000 -0400
@@ -1194,8 +1194,9 @@ int dev_set_alias(struct net_device *dev
 	if (!new_ifalias)
 		return -ENOMEM;
 	dev->ifalias = new_ifalias;
+	memcpy(dev->ifalias, alias, len);
+	dev->ifalias[len] = 0;
 
-	strlcpy(dev->ifalias, alias, len+1);
 	return len;
 }
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/core/dst.c linux-libre-3.18.60-gnu/net/core/dst.c
--- linux-libre-3.18.59-gnu/net/core/dst.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/core/dst.c	2017-07-05 08:35:29.000000000 -0400
@@ -397,6 +397,20 @@ static int dst_dev_event(struct notifier
 		spin_lock_bh(&dst_garbage.lock);
 		dst = dst_garbage.list;
 		dst_garbage.list = NULL;
+		/* The code in dst_ifdown places a hold on the loopback device.
+		 * If the gc entry processing is set to expire after a lengthy
+		 * interval, this hold can cause netdev_wait_allrefs() to hang
+		 * out and wait for a long time -- until the the loopback
+		 * interface is released.  If we're really unlucky, it'll emit
+		 * pr_emerg messages to console too.  Reset the interval here,
+		 * so dst cleanups occur in a more timely fashion.
+		 */
+		if (dst_garbage.timer_inc > DST_GC_INC) {
+			dst_garbage.timer_inc = DST_GC_INC;
+			dst_garbage.timer_expires = DST_GC_MIN;
+			mod_delayed_work(system_wq, &dst_gc_work,
+					 dst_garbage.timer_expires);
+		}
 		spin_unlock_bh(&dst_garbage.lock);
 
 		if (last)
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/decnet/dn_route.c linux-libre-3.18.60-gnu/net/decnet/dn_route.c
--- linux-libre-3.18.59-gnu/net/decnet/dn_route.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/decnet/dn_route.c	2017-07-05 08:35:29.000000000 -0400
@@ -189,12 +189,6 @@ static inline void dnrt_free(struct dn_r
 	call_rcu_bh(&rt->dst.rcu_head, dst_rcu_free);
 }
 
-static inline void dnrt_drop(struct dn_route *rt)
-{
-	dst_release(&rt->dst);
-	call_rcu_bh(&rt->dst.rcu_head, dst_rcu_free);
-}
-
 static void dn_dst_check_expire(unsigned long dummy)
 {
 	int i;
@@ -249,7 +243,7 @@ static int dn_dst_gc(struct dst_ops *ops
 			}
 			*rtp = rt->dst.dn_next;
 			rt->dst.dn_next = NULL;
-			dnrt_drop(rt);
+			dnrt_free(rt);
 			break;
 		}
 		spin_unlock_bh(&dn_rt_hash_table[i].lock);
@@ -351,7 +345,7 @@ static int dn_insert_route(struct dn_rou
 			dst_use(&rth->dst, now);
 			spin_unlock_bh(&dn_rt_hash_table[hash].lock);
 
-			dnrt_drop(rt);
+			dst_free(&rt->dst);
 			*rp = rth;
 			return 0;
 		}
@@ -381,7 +375,7 @@ static void dn_run_flush(unsigned long d
 		for(; rt; rt = next) {
 			next = rcu_dereference_raw(rt->dst.dn_next);
 			RCU_INIT_POINTER(rt->dst.dn_next, NULL);
-			dst_free((struct dst_entry *)rt);
+			dnrt_free(rt);
 		}
 
 nothing_to_declare:
@@ -1195,7 +1189,7 @@ make_route:
 	if (dev_out->flags & IFF_LOOPBACK)
 		flags |= RTCF_LOCAL;
 
-	rt = dst_alloc(&dn_dst_ops, dev_out, 1, DST_OBSOLETE_NONE, DST_HOST);
+	rt = dst_alloc(&dn_dst_ops, dev_out, 0, DST_OBSOLETE_NONE, DST_HOST);
 	if (rt == NULL)
 		goto e_nobufs;
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/decnet/netfilter/dn_rtmsg.c linux-libre-3.18.60-gnu/net/decnet/netfilter/dn_rtmsg.c
--- linux-libre-3.18.59-gnu/net/decnet/netfilter/dn_rtmsg.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/decnet/netfilter/dn_rtmsg.c	2017-07-05 08:35:29.000000000 -0400
@@ -104,7 +104,9 @@ static inline void dnrmg_receive_user_sk
 {
 	struct nlmsghdr *nlh = nlmsg_hdr(skb);
 
-	if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len)
+	if (skb->len < sizeof(*nlh) ||
+	    nlh->nlmsg_len < sizeof(*nlh) ||
+	    skb->len < nlh->nlmsg_len)
 		return;
 
 	if (!netlink_capable(skb, CAP_NET_ADMIN))
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/ipv4/igmp.c linux-libre-3.18.60-gnu/net/ipv4/igmp.c
--- linux-libre-3.18.59-gnu/net/ipv4/igmp.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/ipv4/igmp.c	2017-07-05 08:35:29.000000000 -0400
@@ -1080,6 +1080,7 @@ static void igmpv3_add_delrec(struct in_
 	pmc = kzalloc(sizeof(*pmc), GFP_KERNEL);
 	if (!pmc)
 		return;
+	spin_lock_init(&pmc->lock);
 	spin_lock_bh(&im->lock);
 	pmc->interface = im->interface;
 	in_dev_hold(in_dev);
@@ -1832,21 +1833,26 @@ static int ip_mc_add_src(struct in_devic
 
 static void ip_mc_clear_src(struct ip_mc_list *pmc)
 {
-	struct ip_sf_list *psf, *nextpsf;
+	struct ip_sf_list *psf, *nextpsf, *tomb, *sources;
 
-	for (psf = pmc->tomb; psf; psf = nextpsf) {
+	spin_lock_bh(&pmc->lock);
+	tomb = pmc->tomb;
+	pmc->tomb = NULL;
+	sources = pmc->sources;
+	pmc->sources = NULL;
+	pmc->sfmode = MCAST_EXCLUDE;
+	pmc->sfcount[MCAST_INCLUDE] = 0;
+	pmc->sfcount[MCAST_EXCLUDE] = 1;
+	spin_unlock_bh(&pmc->lock);
+
+	for (psf = tomb; psf; psf = nextpsf) {
 		nextpsf = psf->sf_next;
 		kfree(psf);
 	}
-	pmc->tomb = NULL;
-	for (psf = pmc->sources; psf; psf = nextpsf) {
+	for (psf = sources; psf; psf = nextpsf) {
 		nextpsf = psf->sf_next;
 		kfree(psf);
 	}
-	pmc->sources = NULL;
-	pmc->sfmode = MCAST_EXCLUDE;
-	pmc->sfcount[MCAST_INCLUDE] = 0;
-	pmc->sfcount[MCAST_EXCLUDE] = 1;
 }
 
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/ipv6/addrconf.c linux-libre-3.18.60-gnu/net/ipv6/addrconf.c
--- linux-libre-3.18.59-gnu/net/ipv6/addrconf.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/ipv6/addrconf.c	2017-07-05 08:35:29.000000000 -0400
@@ -269,9 +269,9 @@ static void addrconf_mod_rs_timer(struct
 static void addrconf_mod_dad_work(struct inet6_ifaddr *ifp,
 				   unsigned long delay)
 {
-	if (!delayed_work_pending(&ifp->dad_work))
-		in6_ifa_hold(ifp);
-	mod_delayed_work(addrconf_wq, &ifp->dad_work, delay);
+	in6_ifa_hold(ifp);
+	if (mod_delayed_work(addrconf_wq, &ifp->dad_work, delay))
+		in6_ifa_put(ifp);
 }
 
 static int snmp6_alloc_dev(struct inet6_dev *idev)
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/ipv6/ip6_output.c linux-libre-3.18.60-gnu/net/ipv6/ip6_output.c
--- linux-libre-3.18.59-gnu/net/ipv6/ip6_output.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/ipv6/ip6_output.c	2017-07-05 08:35:29.000000000 -0400
@@ -961,8 +961,10 @@ static int ip6_dst_lookup_tail(struct so
 	}
 #endif
 	if (ipv6_addr_v4mapped(&fl6->saddr) &&
-	    !(ipv6_addr_v4mapped(&fl6->daddr) || ipv6_addr_any(&fl6->daddr)))
-		return -EAFNOSUPPORT;
+	    !(ipv6_addr_v4mapped(&fl6->daddr) || ipv6_addr_any(&fl6->daddr))) {
+		err = -EAFNOSUPPORT;
+		goto out_err_release;
+	}
 
 	return 0;
 
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/key/af_key.c linux-libre-3.18.60-gnu/net/key/af_key.c
--- linux-libre-3.18.59-gnu/net/key/af_key.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/key/af_key.c	2017-07-05 08:35:29.000000000 -0400
@@ -1135,6 +1135,7 @@ static struct xfrm_state * pfkey_msg2xfr
 			goto out;
 	}
 
+	err = -ENOBUFS;
 	key = ext_hdrs[SADB_EXT_KEY_AUTH - 1];
 	if (sa->sadb_sa_auth) {
 		int keysize = 0;
@@ -1146,8 +1147,10 @@ static struct xfrm_state * pfkey_msg2xfr
 		if (key)
 			keysize = (key->sadb_key_bits + 7) / 8;
 		x->aalg = kmalloc(sizeof(*x->aalg) + keysize, GFP_KERNEL);
-		if (!x->aalg)
+		if (!x->aalg) {
+			err = -ENOMEM;
 			goto out;
+		}
 		strcpy(x->aalg->alg_name, a->name);
 		x->aalg->alg_key_len = 0;
 		if (key) {
@@ -1166,8 +1169,10 @@ static struct xfrm_state * pfkey_msg2xfr
 				goto out;
 			}
 			x->calg = kmalloc(sizeof(*x->calg), GFP_KERNEL);
-			if (!x->calg)
+			if (!x->calg) {
+				err = -ENOMEM;
 				goto out;
+			}
 			strcpy(x->calg->alg_name, a->name);
 			x->props.calgo = sa->sadb_sa_encrypt;
 		} else {
@@ -1181,8 +1186,10 @@ static struct xfrm_state * pfkey_msg2xfr
 			if (key)
 				keysize = (key->sadb_key_bits + 7) / 8;
 			x->ealg = kmalloc(sizeof(*x->ealg) + keysize, GFP_KERNEL);
-			if (!x->ealg)
+			if (!x->ealg) {
+				err = -ENOMEM;
 				goto out;
+			}
 			strcpy(x->ealg->alg_name, a->name);
 			x->ealg->alg_key_len = 0;
 			if (key) {
@@ -1226,8 +1233,10 @@ static struct xfrm_state * pfkey_msg2xfr
 		struct xfrm_encap_tmpl *natt;
 
 		x->encap = kmalloc(sizeof(*x->encap), GFP_KERNEL);
-		if (!x->encap)
+		if (!x->encap) {
+			err = -ENOMEM;
 			goto out;
+		}
 
 		natt = x->encap;
 		n_type = ext_hdrs[SADB_X_EXT_NAT_T_TYPE-1];
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/netfilter/nf_conntrack_netlink.c linux-libre-3.18.60-gnu/net/netfilter/nf_conntrack_netlink.c
--- linux-libre-3.18.59-gnu/net/netfilter/nf_conntrack_netlink.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/netfilter/nf_conntrack_netlink.c	2017-07-05 08:35:29.000000000 -0400
@@ -45,6 +45,8 @@
 #include <net/netfilter/nf_conntrack_zones.h>
 #include <net/netfilter/nf_conntrack_timestamp.h>
 #include <net/netfilter/nf_conntrack_labels.h>
+#include <net/netfilter/nf_conntrack_seqadj.h>
+#include <net/netfilter/nf_conntrack_synproxy.h>
 #ifdef CONFIG_NF_NAT_NEEDED
 #include <net/netfilter/nf_nat_core.h>
 #include <net/netfilter/nf_nat_l4proto.h>
@@ -1688,6 +1690,8 @@ ctnetlink_create_conntrack(struct net *n
 	nf_ct_tstamp_ext_add(ct, GFP_ATOMIC);
 	nf_ct_ecache_ext_add(ct, 0, 0, GFP_ATOMIC);
 	nf_ct_labels_ext_add(ct);
+	nfct_seqadj_ext_add(ct);
+	nfct_synproxy_ext_add(ct);
 
 	/* we must add conntrack extensions before confirmation. */
 	ct->status |= IPS_CONFIRMED;
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/netfilter/xt_TCPMSS.c linux-libre-3.18.60-gnu/net/netfilter/xt_TCPMSS.c
--- linux-libre-3.18.59-gnu/net/netfilter/xt_TCPMSS.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/netfilter/xt_TCPMSS.c	2017-07-05 08:35:29.000000000 -0400
@@ -104,7 +104,7 @@ tcpmss_mangle_packet(struct sk_buff *skb
 	tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff);
 	tcp_hdrlen = tcph->doff * 4;
 
-	if (len < tcp_hdrlen)
+	if (len < tcp_hdrlen || tcp_hdrlen < sizeof(struct tcphdr))
 		return -1;
 
 	if (info->mss == XT_TCPMSS_CLAMP_PMTU) {
@@ -156,6 +156,10 @@ tcpmss_mangle_packet(struct sk_buff *skb
 	if (len > tcp_hdrlen)
 		return 0;
 
+	/* tcph->doff has 4 bits, do not wrap it to 0 */
+	if (tcp_hdrlen >= 15 * 4)
+		return 0;
+
 	/*
 	 * MSS Option not found ?! add it..
 	 */
diff -druNp --no-dereference linux-libre-3.18.59-gnu/net/xfrm/xfrm_policy.c linux-libre-3.18.60-gnu/net/xfrm/xfrm_policy.c
--- linux-libre-3.18.59-gnu/net/xfrm/xfrm_policy.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/net/xfrm/xfrm_policy.c	2017-07-05 08:35:29.000000000 -0400
@@ -1751,43 +1751,6 @@ free_dst:
 	goto out;
 }
 
-#ifdef CONFIG_XFRM_SUB_POLICY
-static int xfrm_dst_alloc_copy(void **target, const void *src, int size)
-{
-	if (!*target) {
-		*target = kmalloc(size, GFP_ATOMIC);
-		if (!*target)
-			return -ENOMEM;
-	}
-
-	memcpy(*target, src, size);
-	return 0;
-}
-#endif
-
-static int xfrm_dst_update_parent(struct dst_entry *dst,
-				  const struct xfrm_selector *sel)
-{
-#ifdef CONFIG_XFRM_SUB_POLICY
-	struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
-	return xfrm_dst_alloc_copy((void **)&(xdst->partner),
-				   sel, sizeof(*sel));
-#else
-	return 0;
-#endif
-}
-
-static int xfrm_dst_update_origin(struct dst_entry *dst,
-				  const struct flowi *fl)
-{
-#ifdef CONFIG_XFRM_SUB_POLICY
-	struct xfrm_dst *xdst = (struct xfrm_dst *)dst;
-	return xfrm_dst_alloc_copy((void **)&(xdst->origin), fl, sizeof(*fl));
-#else
-	return 0;
-#endif
-}
-
 static int xfrm_expand_policies(const struct flowi *fl, u16 family,
 				struct xfrm_policy **pols,
 				int *num_pols, int *num_xfrms)
@@ -1859,16 +1822,6 @@ xfrm_resolve_and_create_bundle(struct xf
 
 	xdst = (struct xfrm_dst *)dst;
 	xdst->num_xfrms = err;
-	if (num_pols > 1)
-		err = xfrm_dst_update_parent(dst, &pols[1]->selector);
-	else
-		err = xfrm_dst_update_origin(dst, fl);
-	if (unlikely(err)) {
-		dst_free(dst);
-		XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTBUNDLECHECKERROR);
-		return ERR_PTR(err);
-	}
-
 	xdst->num_pols = num_pols;
 	memcpy(xdst->pols, pols, sizeof(struct xfrm_policy *) * num_pols);
 	xdst->policy_genid = atomic_read(&pols[0]->genid);
diff -druNp --no-dereference linux-libre-3.18.59-gnu/sound/pci/hda/hda_generic.c linux-libre-3.18.60-gnu/sound/pci/hda/hda_generic.c
--- linux-libre-3.18.59-gnu/sound/pci/hda/hda_generic.c	2017-06-29 03:12:34.000000000 -0400
+++ linux-libre-3.18.60-gnu/sound/pci/hda/hda_generic.c	2017-07-05 08:35:29.000000000 -0400
@@ -3079,6 +3079,7 @@ static int check_dyn_adc_switch(struct h
 						spec->input_paths[i][nums]);
 					spec->input_paths[i][nums] =
 						spec->input_paths[i][n];
+					spec->input_paths[i][n] = 0;
 				}
 			}
 			nums++;
