diff -druNp --no-dereference linux-libre-4.10.7-gnu/arch/c6x/kernel/ptrace.c linux-libre-4.10.8-gnu/arch/c6x/kernel/ptrace.c
--- linux-libre-4.10.7-gnu/arch/c6x/kernel/ptrace.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/arch/c6x/kernel/ptrace.c	2017-03-31 04:33:52.000000000 -0400
@@ -69,46 +69,6 @@ static int gpr_get(struct task_struct *t
 				   0, sizeof(*regs));
 }
 
-static int gpr_set(struct task_struct *target,
-		   const struct user_regset *regset,
-		   unsigned int pos, unsigned int count,
-		   const void *kbuf, const void __user *ubuf)
-{
-	int ret;
-	struct pt_regs *regs = task_pt_regs(target);
-
-	/* Don't copyin TSR or CSR */
-	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
-				 &regs,
-				 0, PT_TSR * sizeof(long));
-	if (ret)
-		return ret;
-
-	ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
-					PT_TSR * sizeof(long),
-					(PT_TSR + 1) * sizeof(long));
-	if (ret)
-		return ret;
-
-	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
-				 &regs,
-				 (PT_TSR + 1) * sizeof(long),
-				 PT_CSR * sizeof(long));
-	if (ret)
-		return ret;
-
-	ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
-					PT_CSR * sizeof(long),
-					(PT_CSR + 1) * sizeof(long));
-	if (ret)
-		return ret;
-
-	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
-				 &regs,
-				 (PT_CSR + 1) * sizeof(long), -1);
-	return ret;
-}
-
 enum c6x_regset {
 	REGSET_GPR,
 };
@@ -120,7 +80,6 @@ static const struct user_regset c6x_regs
 		.size = sizeof(u32),
 		.align = sizeof(u32),
 		.get = gpr_get,
-		.set = gpr_set
 	},
 };
 
diff -druNp --no-dereference linux-libre-4.10.7-gnu/arch/h8300/kernel/ptrace.c linux-libre-4.10.8-gnu/arch/h8300/kernel/ptrace.c
--- linux-libre-4.10.7-gnu/arch/h8300/kernel/ptrace.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/arch/h8300/kernel/ptrace.c	2017-03-31 04:33:52.000000000 -0400
@@ -95,7 +95,8 @@ static int regs_get(struct task_struct *
 	long *reg = (long *)&regs;
 
 	/* build user regs in buffer */
-	for (r = 0; r < ARRAY_SIZE(register_offset); r++)
+	BUILD_BUG_ON(sizeof(regs) % sizeof(long) != 0);
+	for (r = 0; r < sizeof(regs) / sizeof(long); r++)
 		*reg++ = h8300_get_reg(target, r);
 
 	return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
@@ -113,7 +114,8 @@ static int regs_set(struct task_struct *
 	long *reg;
 
 	/* build user regs in buffer */
-	for (reg = (long *)&regs, r = 0; r < ARRAY_SIZE(register_offset); r++)
+	BUILD_BUG_ON(sizeof(regs) % sizeof(long) != 0);
+	for (reg = (long *)&regs, r = 0; r < sizeof(regs) / sizeof(long); r++)
 		*reg++ = h8300_get_reg(target, r);
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
@@ -122,7 +124,7 @@ static int regs_set(struct task_struct *
 		return ret;
 
 	/* write back to pt_regs */
-	for (reg = (long *)&regs, r = 0; r < ARRAY_SIZE(register_offset); r++)
+	for (reg = (long *)&regs, r = 0; r < sizeof(regs) / sizeof(long); r++)
 		h8300_put_reg(target, r, *reg++);
 	return 0;
 }
diff -druNp --no-dereference linux-libre-4.10.7-gnu/arch/metag/kernel/ptrace.c linux-libre-4.10.8-gnu/arch/metag/kernel/ptrace.c
--- linux-libre-4.10.7-gnu/arch/metag/kernel/ptrace.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/arch/metag/kernel/ptrace.c	2017-03-31 04:33:52.000000000 -0400
@@ -24,6 +24,16 @@
  * user_regset definitions.
  */
 
+static unsigned long user_txstatus(const struct pt_regs *regs)
+{
+	unsigned long data = (unsigned long)regs->ctx.Flags;
+
+	if (regs->ctx.SaveMask & TBICTX_CBUF_BIT)
+		data |= USER_GP_REGS_STATUS_CATCH_BIT;
+
+	return data;
+}
+
 int metag_gp_regs_copyout(const struct pt_regs *regs,
 			  unsigned int pos, unsigned int count,
 			  void *kbuf, void __user *ubuf)
@@ -62,9 +72,7 @@ int metag_gp_regs_copyout(const struct p
 	if (ret)
 		goto out;
 	/* TXSTATUS */
-	data = (unsigned long)regs->ctx.Flags;
-	if (regs->ctx.SaveMask & TBICTX_CBUF_BIT)
-		data |= USER_GP_REGS_STATUS_CATCH_BIT;
+	data = user_txstatus(regs);
 	ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
 				  &data, 4*25, 4*26);
 	if (ret)
@@ -119,6 +127,7 @@ int metag_gp_regs_copyin(struct pt_regs
 	if (ret)
 		goto out;
 	/* TXSTATUS */
+	data = user_txstatus(regs);
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 &data, 4*25, 4*26);
 	if (ret)
@@ -244,6 +253,8 @@ int metag_rp_state_copyin(struct pt_regs
 	unsigned long long *ptr;
 	int ret, i;
 
+	if (count < 4*13)
+		return -EINVAL;
 	/* Read the entire pipeline before making any changes */
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 				 &rp, 0, 4*13);
@@ -303,7 +314,7 @@ static int metag_tls_set(struct task_str
 			const void *kbuf, const void __user *ubuf)
 {
 	int ret;
-	void __user *tls;
+	void __user *tls = target->thread.tls_ptr;
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &tls, 0, -1);
 	if (ret)
diff -druNp --no-dereference linux-libre-4.10.7-gnu/arch/mips/kernel/ptrace.c linux-libre-4.10.8-gnu/arch/mips/kernel/ptrace.c
--- linux-libre-4.10.7-gnu/arch/mips/kernel/ptrace.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/arch/mips/kernel/ptrace.c	2017-03-31 04:33:52.000000000 -0400
@@ -485,7 +485,8 @@ static int fpr_set(struct task_struct *t
 					  &target->thread.fpu,
 					  0, sizeof(elf_fpregset_t));
 
-	for (i = 0; i < NUM_FPU_REGS; i++) {
+	BUILD_BUG_ON(sizeof(fpr_val) != sizeof(elf_fpreg_t));
+	for (i = 0; i < NUM_FPU_REGS && count >= sizeof(elf_fpreg_t); i++) {
 		err = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 					 &fpr_val, i * sizeof(elf_fpreg_t),
 					 (i + 1) * sizeof(elf_fpreg_t));
diff -druNp --no-dereference linux-libre-4.10.7-gnu/arch/sparc/kernel/ptrace_64.c linux-libre-4.10.8-gnu/arch/sparc/kernel/ptrace_64.c
--- linux-libre-4.10.7-gnu/arch/sparc/kernel/ptrace_64.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/arch/sparc/kernel/ptrace_64.c	2017-03-31 04:33:52.000000000 -0400
@@ -350,7 +350,7 @@ static int genregs64_set(struct task_str
 	}
 
 	if (!ret) {
-		unsigned long y;
+		unsigned long y = regs->y;
 
 		ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 					 &y,
diff -druNp --no-dereference linux-libre-4.10.7-gnu/arch/x86/include/asm/kvm_page_track.h linux-libre-4.10.8-gnu/arch/x86/include/asm/kvm_page_track.h
--- linux-libre-4.10.7-gnu/arch/x86/include/asm/kvm_page_track.h	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/arch/x86/include/asm/kvm_page_track.h	2017-03-31 04:33:52.000000000 -0400
@@ -46,6 +46,7 @@ struct kvm_page_track_notifier_node {
 };
 
 void kvm_page_track_init(struct kvm *kvm);
+void kvm_page_track_cleanup(struct kvm *kvm);
 
 void kvm_page_track_free_memslot(struct kvm_memory_slot *free,
 				 struct kvm_memory_slot *dont);
diff -druNp --no-dereference linux-libre-4.10.7-gnu/arch/x86/kvm/page_track.c linux-libre-4.10.8-gnu/arch/x86/kvm/page_track.c
--- linux-libre-4.10.7-gnu/arch/x86/kvm/page_track.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/arch/x86/kvm/page_track.c	2017-03-31 04:33:52.000000000 -0400
@@ -158,6 +158,14 @@ bool kvm_page_track_is_active(struct kvm
 	return !!ACCESS_ONCE(slot->arch.gfn_track[mode][index]);
 }
 
+void kvm_page_track_cleanup(struct kvm *kvm)
+{
+	struct kvm_page_track_notifier_head *head;
+
+	head = &kvm->arch.track_notifier_head;
+	cleanup_srcu_struct(&head->track_srcu);
+}
+
 void kvm_page_track_init(struct kvm *kvm)
 {
 	struct kvm_page_track_notifier_head *head;
diff -druNp --no-dereference linux-libre-4.10.7-gnu/arch/x86/kvm/vmx.c linux-libre-4.10.8-gnu/arch/x86/kvm/vmx.c
--- linux-libre-4.10.7-gnu/arch/x86/kvm/vmx.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/arch/x86/kvm/vmx.c	2017-03-31 04:33:52.000000000 -0400
@@ -2811,7 +2811,6 @@ static void nested_vmx_setup_ctls_msrs(s
 		SECONDARY_EXEC_RDTSCP |
 		SECONDARY_EXEC_DESC |
 		SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
-		SECONDARY_EXEC_ENABLE_VPID |
 		SECONDARY_EXEC_APIC_REGISTER_VIRT |
 		SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
 		SECONDARY_EXEC_WBINVD_EXITING |
@@ -2839,10 +2838,12 @@ static void nested_vmx_setup_ctls_msrs(s
 	 * though it is treated as global context.  The alternative is
 	 * not failing the single-context invvpid, and it is worse.
 	 */
-	if (enable_vpid)
+	if (enable_vpid) {
+		vmx->nested.nested_vmx_secondary_ctls_high |=
+			SECONDARY_EXEC_ENABLE_VPID;
 		vmx->nested.nested_vmx_vpid_caps = VMX_VPID_INVVPID_BIT |
 			VMX_VPID_EXTENT_SUPPORTED_MASK;
-	else
+	} else
 		vmx->nested.nested_vmx_vpid_caps = 0;
 
 	if (enable_unrestricted_guest)
diff -druNp --no-dereference linux-libre-4.10.7-gnu/arch/x86/kvm/x86.c linux-libre-4.10.8-gnu/arch/x86/kvm/x86.c
--- linux-libre-4.10.7-gnu/arch/x86/kvm/x86.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/arch/x86/kvm/x86.c	2017-03-31 04:33:52.000000000 -0400
@@ -8052,6 +8052,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm
 	kvm_free_vcpus(kvm);
 	kvfree(rcu_dereference_check(kvm->arch.apic_map, 1));
 	kvm_mmu_uninit_vm(kvm);
+	kvm_page_track_cleanup(kvm);
 }
 
 void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *free,
diff -druNp --no-dereference linux-libre-4.10.7-gnu/drivers/pinctrl/qcom/pinctrl-msm.c linux-libre-4.10.8-gnu/drivers/pinctrl/qcom/pinctrl-msm.c
--- linux-libre-4.10.7-gnu/drivers/pinctrl/qcom/pinctrl-msm.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/drivers/pinctrl/qcom/pinctrl-msm.c	2017-03-31 04:33:52.000000000 -0400
@@ -594,10 +594,6 @@ static void msm_gpio_irq_unmask(struct i
 
 	spin_lock_irqsave(&pctrl->lock, flags);
 
-	val = readl(pctrl->regs + g->intr_status_reg);
-	val &= ~BIT(g->intr_status_bit);
-	writel(val, pctrl->regs + g->intr_status_reg);
-
 	val = readl(pctrl->regs + g->intr_cfg_reg);
 	val |= BIT(g->intr_enable_bit);
 	writel(val, pctrl->regs + g->intr_cfg_reg);
diff -druNp --no-dereference linux-libre-4.10.7-gnu/drivers/scsi/qla2xxx/qla_attr.c linux-libre-4.10.8-gnu/drivers/scsi/qla2xxx/qla_attr.c
--- linux-libre-4.10.7-gnu/drivers/scsi/qla2xxx/qla_attr.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/drivers/scsi/qla2xxx/qla_attr.c	2017-03-31 04:33:52.000000000 -0400
@@ -2154,8 +2154,6 @@ qla24xx_vport_delete(struct fc_vport *fc
 		    "Timer for the VP[%d] has stopped\n", vha->vp_idx);
 	}
 
-	BUG_ON(atomic_read(&vha->vref_count));
-
 	qla2x00_free_fcports(vha);
 
 	mutex_lock(&ha->vport_lock);
@@ -2163,7 +2161,7 @@ qla24xx_vport_delete(struct fc_vport *fc
 	clear_bit(vha->vp_idx, ha->vp_idx_map);
 	mutex_unlock(&ha->vport_lock);
 
-	if (vha->qpair->vp_idx == vha->vp_idx) {
+	if (vha->qpair && vha->qpair->vp_idx == vha->vp_idx) {
 		if (qla2xxx_delete_qpair(vha, vha->qpair) != QLA_SUCCESS)
 			ql_log(ql_log_warn, vha, 0x7087,
 			    "Queue Pair delete failed.\n");
diff -druNp --no-dereference linux-libre-4.10.7-gnu/drivers/scsi/qla2xxx/qla_def.h linux-libre-4.10.8-gnu/drivers/scsi/qla2xxx/qla_def.h
--- linux-libre-4.10.7-gnu/drivers/scsi/qla2xxx/qla_def.h	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/drivers/scsi/qla2xxx/qla_def.h	2017-03-31 04:33:52.000000000 -0400
@@ -3788,6 +3788,7 @@ typedef struct scsi_qla_host {
 	struct qla8044_reset_template reset_tmplt;
 	struct qla_tgt_counters tgt_counters;
 	uint16_t	bbcr;
+	wait_queue_head_t vref_waitq;
 } scsi_qla_host_t;
 
 struct qla27xx_image_status {
@@ -3843,14 +3844,17 @@ struct qla2_sgx {
 	mb();						\
 	if (__vha->flags.delete_progress) {		\
 		atomic_dec(&__vha->vref_count);		\
+		wake_up(&__vha->vref_waitq);		\
 		__bail = 1;				\
 	} else {					\
 		__bail = 0;				\
 	}						\
 } while (0)
 
-#define QLA_VHA_MARK_NOT_BUSY(__vha)			\
+#define QLA_VHA_MARK_NOT_BUSY(__vha) do {		\
 	atomic_dec(&__vha->vref_count);			\
+	wake_up(&__vha->vref_waitq);			\
+} while (0)						\
 
 #define QLA_QPAIR_MARK_BUSY(__qpair, __bail) do {	\
 	atomic_inc(&__qpair->ref_count);		\
diff -druNp --no-dereference linux-libre-4.10.7-gnu/drivers/scsi/qla2xxx/qla_init.c linux-libre-4.10.8-gnu/drivers/scsi/qla2xxx/qla_init.c
--- linux-libre-4.10.7-gnu/drivers/scsi/qla2xxx/qla_init.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/drivers/scsi/qla2xxx/qla_init.c	2017-03-31 04:33:52.000000000 -0400
@@ -4352,6 +4352,7 @@ qla2x00_update_fcports(scsi_qla_host_t *
 			}
 		}
 		atomic_dec(&vha->vref_count);
+		wake_up(&vha->vref_waitq);
 	}
 	spin_unlock_irqrestore(&ha->vport_slock, flags);
 }
diff -druNp --no-dereference linux-libre-4.10.7-gnu/drivers/scsi/qla2xxx/qla_mid.c linux-libre-4.10.8-gnu/drivers/scsi/qla2xxx/qla_mid.c
--- linux-libre-4.10.7-gnu/drivers/scsi/qla2xxx/qla_mid.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/drivers/scsi/qla2xxx/qla_mid.c	2017-03-31 04:33:52.000000000 -0400
@@ -74,13 +74,14 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t
 	 * ensures no active vp_list traversal while the vport is removed
 	 * from the queue)
 	 */
-	spin_lock_irqsave(&ha->vport_slock, flags);
-	while (atomic_read(&vha->vref_count)) {
-		spin_unlock_irqrestore(&ha->vport_slock, flags);
-
-		msleep(500);
+	wait_event_timeout(vha->vref_waitq, atomic_read(&vha->vref_count),
+	    10*HZ);
 
-		spin_lock_irqsave(&ha->vport_slock, flags);
+	spin_lock_irqsave(&ha->vport_slock, flags);
+	if (atomic_read(&vha->vref_count)) {
+		ql_dbg(ql_dbg_vport, vha, 0xfffa,
+		    "vha->vref_count=%u timeout\n", vha->vref_count.counter);
+		vha->vref_count = (atomic_t)ATOMIC_INIT(0);
 	}
 	list_del(&vha->list);
 	qlt_update_vp_map(vha, RESET_VP_IDX);
@@ -269,6 +270,7 @@ qla2x00_alert_all_vps(struct rsp_que *rs
 
 			spin_lock_irqsave(&ha->vport_slock, flags);
 			atomic_dec(&vha->vref_count);
+			wake_up(&vha->vref_waitq);
 		}
 		i++;
 	}
diff -druNp --no-dereference linux-libre-4.10.7-gnu/drivers/scsi/qla2xxx/qla_os.c linux-libre-4.10.8-gnu/drivers/scsi/qla2xxx/qla_os.c
--- linux-libre-4.10.7-gnu/drivers/scsi/qla2xxx/qla_os.c	2017-03-30 12:42:55.000000000 -0400
+++ linux-libre-4.10.8-gnu/drivers/scsi/qla2xxx/qla_os.c	2017-03-31 12:16:28.000000000 -0400
@@ -4215,6 +4215,7 @@ struct scsi_qla_host *qla2x00_create_hos
 
 	spin_lock_init(&vha->work_lock);
 	spin_lock_init(&vha->cmd_list_lock);
+	init_waitqueue_head(&vha->vref_waitq);
 
 	sprintf(vha->host_str, "%s_%ld", QLA2XXX_DRIVER_NAME, vha->host_no);
 	ql_dbg(ql_dbg_init, vha, 0x0041,
diff -druNp --no-dereference linux-libre-4.10.7-gnu/drivers/usb/musb/musb_core.c linux-libre-4.10.8-gnu/drivers/usb/musb/musb_core.c
--- linux-libre-4.10.7-gnu/drivers/usb/musb/musb_core.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/drivers/usb/musb/musb_core.c	2017-03-31 04:33:52.000000000 -0400
@@ -2497,8 +2497,8 @@ static int musb_remove(struct platform_d
 	pm_runtime_get_sync(musb->controller);
 	musb_host_cleanup(musb);
 	musb_gadget_cleanup(musb);
-	spin_lock_irqsave(&musb->lock, flags);
 	musb_platform_disable(musb);
+	spin_lock_irqsave(&musb->lock, flags);
 	musb_generic_disable(musb);
 	spin_unlock_irqrestore(&musb->lock, flags);
 	musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
diff -druNp --no-dereference linux-libre-4.10.7-gnu/drivers/virtio/virtio_balloon.c linux-libre-4.10.8-gnu/drivers/virtio/virtio_balloon.c
--- linux-libre-4.10.7-gnu/drivers/virtio/virtio_balloon.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/drivers/virtio/virtio_balloon.c	2017-03-31 04:33:52.000000000 -0400
@@ -427,6 +427,8 @@ static int init_vqs(struct virtio_balloo
 		 * Prime this virtqueue with one buffer so the hypervisor can
 		 * use it to signal us later (it can't be broken yet!).
 		 */
+		update_balloon_stats(vb);
+
 		sg_init_one(&sg, vb->stats, sizeof vb->stats);
 		if (virtqueue_add_outbuf(vb->stats_vq, &sg, 1, vb, GFP_KERNEL)
 		    < 0)
diff -druNp --no-dereference linux-libre-4.10.7-gnu/kernel/sched/deadline.c linux-libre-4.10.8-gnu/kernel/sched/deadline.c
--- linux-libre-4.10.7-gnu/kernel/sched/deadline.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/kernel/sched/deadline.c	2017-03-31 04:33:52.000000000 -0400
@@ -1729,12 +1729,11 @@ static void switched_to_dl(struct rq *rq
 #ifdef CONFIG_SMP
 		if (tsk_nr_cpus_allowed(p) > 1 && rq->dl.overloaded)
 			queue_push_tasks(rq);
-#else
+#endif
 		if (dl_task(rq->curr))
 			check_preempt_curr_dl(rq, p, 0);
 		else
 			resched_curr(rq);
-#endif
 	}
 }
 
diff -druNp --no-dereference linux-libre-4.10.7-gnu/kernel/sched/rt.c linux-libre-4.10.8-gnu/kernel/sched/rt.c
--- linux-libre-4.10.7-gnu/kernel/sched/rt.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/kernel/sched/rt.c	2017-03-31 04:33:52.000000000 -0400
@@ -2198,10 +2198,9 @@ static void switched_to_rt(struct rq *rq
 #ifdef CONFIG_SMP
 		if (tsk_nr_cpus_allowed(p) > 1 && rq->rt.overloaded)
 			queue_push_tasks(rq);
-#else
+#endif /* CONFIG_SMP */
 		if (p->prio < rq->curr->prio)
 			resched_curr(rq);
-#endif /* CONFIG_SMP */
 	}
 }
 
diff -druNp --no-dereference linux-libre-4.10.7-gnu/Makefile linux-libre-4.10.8-gnu/Makefile
--- linux-libre-4.10.7-gnu/Makefile	2017-03-30 12:09:41.000000000 -0400
+++ linux-libre-4.10.8-gnu/Makefile	2017-03-31 11:39:18.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 10
-SUBLEVEL = 7
+SUBLEVEL = 8
 EXTRAVERSION = -gnu
 NAME = Fearless Coyote
 
diff -druNp --no-dereference linux-libre-4.10.7-gnu/net/xfrm/xfrm_policy.c linux-libre-4.10.8-gnu/net/xfrm/xfrm_policy.c
--- linux-libre-4.10.7-gnu/net/xfrm/xfrm_policy.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/net/xfrm/xfrm_policy.c	2017-03-31 04:33:52.000000000 -0400
@@ -3062,6 +3062,11 @@ static int __net_init xfrm_net_init(stru
 {
 	int rv;
 
+	/* Initialize the per-net locks here */
+	spin_lock_init(&net->xfrm.xfrm_state_lock);
+	spin_lock_init(&net->xfrm.xfrm_policy_lock);
+	mutex_init(&net->xfrm.xfrm_cfg_mutex);
+
 	rv = xfrm_statistics_init(net);
 	if (rv < 0)
 		goto out_statistics;
@@ -3078,11 +3083,6 @@ static int __net_init xfrm_net_init(stru
 	if (rv < 0)
 		goto out;
 
-	/* Initialize the per-net locks here */
-	spin_lock_init(&net->xfrm.xfrm_state_lock);
-	spin_lock_init(&net->xfrm.xfrm_policy_lock);
-	mutex_init(&net->xfrm.xfrm_cfg_mutex);
-
 	return 0;
 
 out:
diff -druNp --no-dereference linux-libre-4.10.7-gnu/net/xfrm/xfrm_user.c linux-libre-4.10.8-gnu/net/xfrm/xfrm_user.c
--- linux-libre-4.10.7-gnu/net/xfrm/xfrm_user.c	2017-03-30 03:44:36.000000000 -0400
+++ linux-libre-4.10.8-gnu/net/xfrm/xfrm_user.c	2017-03-31 04:33:52.000000000 -0400
@@ -412,7 +412,14 @@ static inline int xfrm_replay_verify_len
 	up = nla_data(rp);
 	ulen = xfrm_replay_state_esn_len(up);
 
-	if (nla_len(rp) < ulen || xfrm_replay_state_esn_len(replay_esn) != ulen)
+	/* Check the overall length and the internal bitmap length to avoid
+	 * potential overflow. */
+	if (nla_len(rp) < ulen ||
+	    xfrm_replay_state_esn_len(replay_esn) != ulen ||
+	    replay_esn->bmp_len != up->bmp_len)
+		return -EINVAL;
+
+	if (up->replay_window > up->bmp_len * sizeof(__u32) * 8)
 		return -EINVAL;
 
 	return 0;
