diff -druNp --no-dereference linux-libre-3.18.35-gnu/arch/arm/kernel/ptrace.c linux-libre-3.18.36-gnu/arch/arm/kernel/ptrace.c
--- linux-libre-3.18.35-gnu/arch/arm/kernel/ptrace.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/arch/arm/kernel/ptrace.c	2016-06-23 00:02:29.000000000 -0400
@@ -733,8 +733,8 @@ static int vfp_set(struct task_struct *t
 	if (ret)
 		return ret;
 
-	vfp_flush_hwstate(thread);
 	thread->vfpstate.hard = new_vfp;
+	vfp_flush_hwstate(thread);
 
 	return 0;
 }
diff -druNp --no-dereference linux-libre-3.18.35-gnu/arch/parisc/kernel/unaligned.c linux-libre-3.18.36-gnu/arch/parisc/kernel/unaligned.c
--- linux-libre-3.18.35-gnu/arch/parisc/kernel/unaligned.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/arch/parisc/kernel/unaligned.c	2016-06-23 00:02:29.000000000 -0400
@@ -666,7 +666,7 @@ void handle_unaligned(struct pt_regs *re
 		break;
 	}
 
-	if (modify && R1(regs->iir))
+	if (ret == 0 && modify && R1(regs->iir))
 		regs->gr[R1(regs->iir)] = newbase;
 
 
@@ -677,6 +677,14 @@ void handle_unaligned(struct pt_regs *re
 
 	if (ret)
 	{
+		/*
+		 * The unaligned handler failed.
+		 * If we were called by __get_user() or __put_user() jump
+		 * to it's exception fixup handler instead of crashing.
+		 */
+		if (!user_mode(regs) && fixup_exception(regs))
+			return;
+
 		printk(KERN_CRIT "Unaligned handler failed, ret = %d\n", ret);
 		die_if_kernel("Unaligned data reference", regs, 28);
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/arch/powerpc/include/asm/reg.h linux-libre-3.18.36-gnu/arch/powerpc/include/asm/reg.h
--- linux-libre-3.18.35-gnu/arch/powerpc/include/asm/reg.h	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/arch/powerpc/include/asm/reg.h	2016-06-23 00:02:29.000000000 -0400
@@ -703,7 +703,7 @@
 #define   MMCR0_FCWAIT	0x00000002UL /* freeze counter in WAIT state */
 #define   MMCR0_FCHV	0x00000001UL /* freeze conditions in hypervisor mode */
 #define SPRN_MMCR1	798
-#define SPRN_MMCR2	769
+#define SPRN_MMCR2	785
 #define SPRN_MMCRA	0x312
 #define   MMCRA_SDSYNC	0x80000000UL /* SDAR synced with SIAR */
 #define   MMCRA_SDAR_DCACHE_MISS 0x40000000UL
@@ -739,13 +739,13 @@
 #define SPRN_PMC6	792
 #define SPRN_PMC7	793
 #define SPRN_PMC8	794
-#define SPRN_SIAR	780
-#define SPRN_SDAR	781
 #define SPRN_SIER	784
 #define   SIER_SIPR		0x2000000	/* Sampled MSR_PR */
 #define   SIER_SIHV		0x1000000	/* Sampled MSR_HV */
 #define   SIER_SIAR_VALID	0x0400000	/* SIAR contents valid */
 #define   SIER_SDAR_VALID	0x0200000	/* SDAR contents valid */
+#define SPRN_SIAR	796
+#define SPRN_SDAR	797
 #define SPRN_TACR	888
 #define SPRN_TCSCR	889
 #define SPRN_CSIGR	890
diff -druNp --no-dereference linux-libre-3.18.35-gnu/arch/powerpc/platforms/pseries/eeh_pseries.c linux-libre-3.18.36-gnu/arch/powerpc/platforms/pseries/eeh_pseries.c
--- linux-libre-3.18.35-gnu/arch/powerpc/platforms/pseries/eeh_pseries.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/arch/powerpc/platforms/pseries/eeh_pseries.c	2016-06-23 00:02:29.000000000 -0400
@@ -642,29 +642,50 @@ static int pseries_eeh_configure_bridge(
 {
 	int config_addr;
 	int ret;
+	/* Waiting 0.2s maximum before skipping configuration */
+	int max_wait = 200;
 
 	/* Figure out the PE address */
 	config_addr = pe->config_addr;
 	if (pe->addr)
 		config_addr = pe->addr;
 
-	/* Use new configure-pe function, if supported */
-	if (ibm_configure_pe != RTAS_UNKNOWN_SERVICE) {
-		ret = rtas_call(ibm_configure_pe, 3, 1, NULL,
-				config_addr, BUID_HI(pe->phb->buid),
-				BUID_LO(pe->phb->buid));
-	} else if (ibm_configure_bridge != RTAS_UNKNOWN_SERVICE) {
-		ret = rtas_call(ibm_configure_bridge, 3, 1, NULL,
-				config_addr, BUID_HI(pe->phb->buid),
-				BUID_LO(pe->phb->buid));
-	} else {
-		return -EFAULT;
-	}
+	while (max_wait > 0) {
+		/* Use new configure-pe function, if supported */
+		if (ibm_configure_pe != RTAS_UNKNOWN_SERVICE) {
+			ret = rtas_call(ibm_configure_pe, 3, 1, NULL,
+					config_addr, BUID_HI(pe->phb->buid),
+					BUID_LO(pe->phb->buid));
+		} else if (ibm_configure_bridge != RTAS_UNKNOWN_SERVICE) {
+			ret = rtas_call(ibm_configure_bridge, 3, 1, NULL,
+					config_addr, BUID_HI(pe->phb->buid),
+					BUID_LO(pe->phb->buid));
+		} else {
+			return -EFAULT;
+		}
 
-	if (ret)
-		pr_warn("%s: Unable to configure bridge PHB#%d-PE#%x (%d)\n",
-			__func__, pe->phb->global_number, pe->addr, ret);
+		if (!ret)
+			return ret;
 
+		/*
+		 * If RTAS returns a delay value that's above 100ms, cut it
+		 * down to 100ms in case firmware made a mistake.  For more
+		 * on how these delay values work see rtas_busy_delay_time
+		 */
+		if (ret > RTAS_EXTENDED_DELAY_MIN+2 &&
+		    ret <= RTAS_EXTENDED_DELAY_MAX)
+			ret = RTAS_EXTENDED_DELAY_MIN+2;
+
+		max_wait -= rtas_busy_delay_time(ret);
+
+		if (max_wait < 0)
+			break;
+
+		rtas_busy_delay(ret);
+	}
+
+	pr_warn("%s: Unable to configure bridge PHB#%d-PE#%x (%d)\n",
+		__func__, pe->phb->global_number, pe->addr, ret);
 	return ret;
 }
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/arch/x86/boot/Makefile linux-libre-3.18.36-gnu/arch/x86/boot/Makefile
--- linux-libre-3.18.35-gnu/arch/x86/boot/Makefile	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/arch/x86/boot/Makefile	2016-06-23 00:02:29.000000000 -0400
@@ -160,6 +160,9 @@ isoimage: $(obj)/bzImage
 	for i in lib lib64 share end ; do \
 		if [ -f /usr/$$i/syslinux/isolinux.bin ] ; then \
 			cp /usr/$$i/syslinux/isolinux.bin $(obj)/isoimage ; \
+			if [ -f /usr/$$i/syslinux/ldlinux.c32 ]; then \
+				cp /usr/$$i/syslinux/ldlinux.c32 $(obj)/isoimage ; \
+			fi ; \
 			break ; \
 		fi ; \
 		if [ $$i = end ] ; then exit 1 ; fi ; \
diff -druNp --no-dereference linux-libre-3.18.35-gnu/arch/x86/kvm/x86.c linux-libre-3.18.36-gnu/arch/x86/kvm/x86.c
--- linux-libre-3.18.35-gnu/arch/x86/kvm/x86.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/arch/x86/kvm/x86.c	2016-06-23 00:02:29.000000000 -0400
@@ -3111,6 +3111,11 @@ static int kvm_vcpu_ioctl_x86_set_debugr
 	if (dbgregs->flags)
 		return -EINVAL;
 
+	if (dbgregs->dr6 & ~0xffffffffull)
+		return -EINVAL;
+	if (dbgregs->dr7 & ~0xffffffffull)
+		return -EINVAL;
+
 	memcpy(vcpu->arch.db, dbgregs->db, sizeof(vcpu->arch.db));
 	vcpu->arch.dr6 = dbgregs->dr6;
 	kvm_update_dr6(vcpu);
diff -druNp --no-dereference linux-libre-3.18.35-gnu/crypto/asymmetric_keys/Kconfig linux-libre-3.18.36-gnu/crypto/asymmetric_keys/Kconfig
--- linux-libre-3.18.35-gnu/crypto/asymmetric_keys/Kconfig	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/crypto/asymmetric_keys/Kconfig	2016-06-23 00:02:29.000000000 -0400
@@ -14,6 +14,7 @@ config ASYMMETRIC_PUBLIC_KEY_SUBTYPE
 	select MPILIB
 	select PUBLIC_KEY_ALGO_RSA
 	select CRYPTO_HASH_INFO
+	select CRYPTO_AKCIPHER
 	help
 	  This option provides support for asymmetric public key type handling.
 	  If signature generation and/or verification are to be used,
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/cpufreq/intel_pstate.c linux-libre-3.18.36-gnu/drivers/cpufreq/intel_pstate.c
--- linux-libre-3.18.35-gnu/drivers/cpufreq/intel_pstate.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/cpufreq/intel_pstate.c	2016-06-23 00:02:29.000000000 -0400
@@ -847,8 +847,11 @@ static int intel_pstate_cpu_init(struct
 
 	/* cpuinfo and default policy values */
 	policy->cpuinfo.min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling;
-	policy->cpuinfo.max_freq =
-		cpu->pstate.turbo_pstate * cpu->pstate.scaling;
+	update_turbo_state();
+	policy->cpuinfo.max_freq = limits.turbo_disabled ?
+			cpu->pstate.max_pstate : cpu->pstate.turbo_pstate;
+	policy->cpuinfo.max_freq *= cpu->pstate.scaling;
+
 	policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
 	cpumask_set_cpu(policy->cpu, policy->cpus);
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/crypto/ccp/ccp-crypto-aes-xts.c linux-libre-3.18.36-gnu/drivers/crypto/ccp/ccp-crypto-aes-xts.c
--- linux-libre-3.18.35-gnu/drivers/crypto/ccp/ccp-crypto-aes-xts.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/crypto/ccp/ccp-crypto-aes-xts.c	2016-06-23 00:02:29.000000000 -0400
@@ -123,6 +123,7 @@ static int ccp_aes_xts_crypt(struct ablk
 	struct ccp_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
 	struct ccp_aes_req_ctx *rctx = ablkcipher_request_ctx(req);
 	unsigned int unit;
+	u32 unit_size;
 	int ret;
 
 	if (!ctx->u.aes.key_len)
@@ -134,11 +135,17 @@ static int ccp_aes_xts_crypt(struct ablk
 	if (!req->info)
 		return -EINVAL;
 
-	for (unit = 0; unit < ARRAY_SIZE(unit_size_map); unit++)
-		if (!(req->nbytes & (unit_size_map[unit].size - 1)))
-			break;
+	unit_size = CCP_XTS_AES_UNIT_SIZE__LAST;
+	if (req->nbytes <= unit_size_map[0].size) {
+		for (unit = 0; unit < ARRAY_SIZE(unit_size_map); unit++) {
+			if (!(req->nbytes & (unit_size_map[unit].size - 1))) {
+				unit_size = unit_size_map[unit].value;
+				break;
+			}
+		}
+	}
 
-	if ((unit_size_map[unit].value == CCP_XTS_AES_UNIT_SIZE__LAST) ||
+	if ((unit_size == CCP_XTS_AES_UNIT_SIZE__LAST) ||
 	    (ctx->u.aes.key_len != AES_KEYSIZE_128)) {
 		/* Use the fallback to process the request for any
 		 * unsupported unit sizes or key sizes
@@ -159,7 +166,7 @@ static int ccp_aes_xts_crypt(struct ablk
 	rctx->cmd.engine = CCP_ENGINE_XTS_AES_128;
 	rctx->cmd.u.xts.action = (encrypt) ? CCP_AES_ACTION_ENCRYPT
 					   : CCP_AES_ACTION_DECRYPT;
-	rctx->cmd.u.xts.unit_size = unit_size_map[unit].value;
+	rctx->cmd.u.xts.unit_size = unit_size;
 	rctx->cmd.u.xts.key = &ctx->u.aes.key_sg;
 	rctx->cmd.u.xts.key_len = ctx->u.aes.key_len;
 	rctx->cmd.u.xts.iv = &rctx->iv_sg;
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpio/gpio-bcm-kona.c linux-libre-3.18.36-gnu/drivers/gpio/gpio-bcm-kona.c
--- linux-libre-3.18.35-gnu/drivers/gpio/gpio-bcm-kona.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpio/gpio-bcm-kona.c	2016-06-23 00:02:29.000000000 -0400
@@ -549,11 +549,11 @@ static void bcm_kona_gpio_reset(struct b
 	/* disable interrupts and clear status */
 	for (i = 0; i < kona_gpio->num_bank; i++) {
 		/* Unlock the entire bank first */
-		bcm_kona_gpio_write_lock_regs(kona_gpio, i, UNLOCK_CODE);
+		bcm_kona_gpio_write_lock_regs(reg_base, i, UNLOCK_CODE);
 		writel(0xffffffff, reg_base + GPIO_INT_MASK(i));
 		writel(0xffffffff, reg_base + GPIO_INT_STATUS(i));
 		/* Now re-lock the bank */
-		bcm_kona_gpio_write_lock_regs(kona_gpio, i, LOCK_CODE);
+		bcm_kona_gpio_write_lock_regs(reg_base, i, LOCK_CODE);
 	}
 }
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpio/gpiolib.c linux-libre-3.18.36-gnu/drivers/gpio/gpiolib.c
--- linux-libre-3.18.35-gnu/drivers/gpio/gpiolib.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpio/gpiolib.c	2016-06-23 00:02:29.000000000 -0400
@@ -356,7 +356,7 @@ struct gpio_chip *gpiochip_find(void *da
 
 	spin_lock_irqsave(&gpio_lock, flags);
 	list_for_each_entry(chip, &gpio_chips, list)
-		if (match(chip, data))
+		if (chip && match(chip, data))
 			break;
 
 	/* No match? */
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/ast/ast_fb.c linux-libre-3.18.36-gnu/drivers/gpu/drm/ast/ast_fb.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/ast/ast_fb.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/ast/ast_fb.c	2016-06-23 00:02:29.000000000 -0400
@@ -335,18 +335,27 @@ int ast_fbdev_init(struct drm_device *de
 
 	ret = drm_fb_helper_init(dev, &afbdev->helper,
 				 1, 1);
-	if (ret) {
-		kfree(afbdev);
-		return ret;
-	}
+	if (ret)
+		goto free;
 
-	drm_fb_helper_single_add_all_connectors(&afbdev->helper);
+	ret = drm_fb_helper_single_add_all_connectors(&afbdev->helper);
+	if (ret)
+		goto fini;
 
 	/* disable all the possible outputs/crtcs before entering KMS mode */
 	drm_helper_disable_unused_functions(dev);
 
-	drm_fb_helper_initial_config(&afbdev->helper, 32);
+	ret = drm_fb_helper_initial_config(&afbdev->helper, 32);
+	if (ret)
+		goto fini;
+
 	return 0;
+
+fini:
+	drm_fb_helper_fini(&afbdev->helper);
+free:
+	kfree(afbdev);
+	return ret;
 }
 
 void ast_fbdev_fini(struct drm_device *dev)
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/bochs/bochs_fbdev.c linux-libre-3.18.36-gnu/drivers/gpu/drm/bochs/bochs_fbdev.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/bochs/bochs_fbdev.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/bochs/bochs_fbdev.c	2016-06-23 00:02:29.000000000 -0400
@@ -197,12 +197,22 @@ int bochs_fbdev_init(struct bochs_device
 	if (ret)
 		return ret;
 
-	drm_fb_helper_single_add_all_connectors(&bochs->fb.helper);
+	ret = drm_fb_helper_single_add_all_connectors(&bochs->fb.helper);
+	if (ret)
+		goto fini;
+
 	drm_helper_disable_unused_functions(bochs->dev);
-	drm_fb_helper_initial_config(&bochs->fb.helper, 32);
+
+	ret = drm_fb_helper_initial_config(&bochs->fb.helper, 32);
+	if (ret)
+		goto fini;
 
 	bochs->fb.initialized = true;
 	return 0;
+
+fini:
+	drm_fb_helper_fini(&bochs->fb.helper);
+	return ret;
 }
 
 void bochs_fbdev_fini(struct bochs_device *bochs)
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/cirrus/cirrus_fbdev.c linux-libre-3.18.36-gnu/drivers/gpu/drm/cirrus/cirrus_fbdev.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/cirrus/cirrus_fbdev.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/cirrus/cirrus_fbdev.c	2016-06-23 00:02:29.000000000 -0400
@@ -314,17 +314,17 @@ int cirrus_fbdev_init(struct cirrus_devi
 
 	ret = drm_fb_helper_init(cdev->dev, &gfbdev->helper,
 				 cdev->num_crtc, CIRRUSFB_CONN_LIMIT);
-	if (ret) {
-		kfree(gfbdev);
+	if (ret)
+		return ret;
+
+	ret = drm_fb_helper_single_add_all_connectors(&gfbdev->helper);
+	if (ret)
 		return ret;
-	}
-	drm_fb_helper_single_add_all_connectors(&gfbdev->helper);
 
 	/* disable all the possible outputs/crtcs before entering KMS mode */
 	drm_helper_disable_unused_functions(cdev->dev);
-	drm_fb_helper_initial_config(&gfbdev->helper, bpp_sel);
 
-	return 0;
+	return drm_fb_helper_initial_config(&gfbdev->helper, bpp_sel);
 }
 
 void cirrus_fbdev_fini(struct cirrus_device *cdev)
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/drm_fb_helper.c linux-libre-3.18.36-gnu/drivers/gpu/drm/drm_fb_helper.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/drm_fb_helper.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/drm_fb_helper.c	2016-06-23 00:02:29.000000000 -0400
@@ -1637,7 +1637,7 @@ out:
  * RETURNS:
  * Zero if everything went ok, nonzero otherwise.
  */
-bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel)
+int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel)
 {
 	struct drm_device *dev = fb_helper->dev;
 	int count = 0;
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/gma500/framebuffer.c linux-libre-3.18.36-gnu/drivers/gpu/drm/gma500/framebuffer.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/gma500/framebuffer.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/gma500/framebuffer.c	2016-06-23 00:02:29.000000000 -0400
@@ -593,6 +593,7 @@ int psb_fbdev_init(struct drm_device *de
 {
 	struct psb_fbdev *fbdev;
 	struct drm_psb_private *dev_priv = dev->dev_private;
+	int ret;
 
 	fbdev = kzalloc(sizeof(struct psb_fbdev), GFP_KERNEL);
 	if (!fbdev) {
@@ -604,16 +605,29 @@ int psb_fbdev_init(struct drm_device *de
 
 	drm_fb_helper_prepare(dev, &fbdev->psb_fb_helper, &psb_fb_helper_funcs);
 
-	drm_fb_helper_init(dev, &fbdev->psb_fb_helper, dev_priv->ops->crtcs,
-							INTELFB_CONN_LIMIT);
+	ret = drm_fb_helper_init(dev, &fbdev->psb_fb_helper,
+				 dev_priv->ops->crtcs, INTELFB_CONN_LIMIT);
+	if (ret)
+		goto free;
 
-	drm_fb_helper_single_add_all_connectors(&fbdev->psb_fb_helper);
+	ret = drm_fb_helper_single_add_all_connectors(&fbdev->psb_fb_helper);
+	if (ret)
+		goto fini;
 
 	/* disable all the possible outputs/crtcs before entering KMS mode */
 	drm_helper_disable_unused_functions(dev);
 
-	drm_fb_helper_initial_config(&fbdev->psb_fb_helper, 32);
+	ret = drm_fb_helper_initial_config(&fbdev->psb_fb_helper, 32);
+	if (ret)
+		goto fini;
+
 	return 0;
+
+fini:
+	drm_fb_helper_fini(&fbdev->psb_fb_helper);
+free:
+	kfree(fbdev);
+	return ret;
 }
 
 static void psb_fbdev_fini(struct drm_device *dev)
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/mgag200/mgag200_fb.c linux-libre-3.18.36-gnu/drivers/gpu/drm/mgag200/mgag200_fb.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/mgag200/mgag200_fb.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/mgag200/mgag200_fb.c	2016-06-23 00:02:29.000000000 -0400
@@ -303,14 +303,22 @@ int mgag200_fbdev_init(struct mga_device
 	if (ret)
 		return ret;
 
-	drm_fb_helper_single_add_all_connectors(&mfbdev->helper);
+	ret = drm_fb_helper_single_add_all_connectors(&mfbdev->helper);
+	if (ret)
+		goto fini;
 
 	/* disable all the possible outputs/crtcs before entering KMS mode */
 	drm_helper_disable_unused_functions(mdev->dev);
 
-	drm_fb_helper_initial_config(&mfbdev->helper, bpp_sel);
+	ret = drm_fb_helper_initial_config(&mfbdev->helper, bpp_sel);
+	if (ret)
+		goto fini;
 
 	return 0;
+
+fini:
+	drm_fb_helper_fini(&mfbdev->helper);
+	return ret;
 }
 
 void mgag200_fbdev_fini(struct mga_device *mdev)
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/msm/msm_fbdev.c linux-libre-3.18.36-gnu/drivers/gpu/drm/msm/msm_fbdev.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/msm/msm_fbdev.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/msm/msm_fbdev.c	2016-06-23 00:02:29.000000000 -0400
@@ -245,17 +245,23 @@ struct drm_fb_helper *msm_fbdev_init(str
 		goto fail;
 	}
 
-	drm_fb_helper_single_add_all_connectors(helper);
+	ret = drm_fb_helper_single_add_all_connectors(helper);
+	if (ret)
+		goto fini;
 
 	/* disable all the possible outputs/crtcs before entering KMS mode */
 	drm_helper_disable_unused_functions(dev);
 
-	drm_fb_helper_initial_config(helper, 32);
+	ret = drm_fb_helper_initial_config(helper, 32);
+	if (ret)
+		goto fini;
 
 	priv->fbdev = helper;
 
 	return helper;
 
+fini:
+	drm_fb_helper_fini(helper);
 fail:
 	kfree(fbdev);
 	return NULL;
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/nouveau/nouveau_fbcon.c linux-libre-3.18.36-gnu/drivers/gpu/drm/nouveau/nouveau_fbcon.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/nouveau/nouveau_fbcon.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/nouveau/nouveau_fbcon.c	2016-06-23 00:02:29.000000000 -0400
@@ -546,12 +546,12 @@ nouveau_fbcon_init(struct drm_device *de
 
 	ret = drm_fb_helper_init(dev, &fbcon->helper,
 				 dev->mode_config.num_crtc, 4);
-	if (ret) {
-		kfree(fbcon);
-		return ret;
-	}
+	if (ret)
+		goto free;
 
-	drm_fb_helper_single_add_all_connectors(&fbcon->helper);
+	ret = drm_fb_helper_single_add_all_connectors(&fbcon->helper);
+	if (ret)
+		goto fini;
 
 	if (drm->device.info.ram_size <= 32 * 1024 * 1024)
 		preferred_bpp = 8;
@@ -564,8 +564,18 @@ nouveau_fbcon_init(struct drm_device *de
 	/* disable all the possible outputs/crtcs before entering KMS mode */
 	drm_helper_disable_unused_functions(dev);
 
-	drm_fb_helper_initial_config(&fbcon->helper, preferred_bpp);
+	ret = drm_fb_helper_initial_config(&fbcon->helper, preferred_bpp);
+	if (ret)
+		goto fini;
+
+	fbcon->helper.fbdev->pixmap.buf_align = 4;
 	return 0;
+
+fini:
+	drm_fb_helper_fini(&fbcon->helper);
+free:
+	kfree(fbcon);
+	return ret;
 }
 
 void
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/nouveau/nv04_fbcon.c linux-libre-3.18.36-gnu/drivers/gpu/drm/nouveau/nv04_fbcon.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/nouveau/nv04_fbcon.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/nouveau/nv04_fbcon.c	2016-06-23 00:02:29.000000000 -0400
@@ -82,7 +82,6 @@ nv04_fbcon_imageblit(struct fb_info *inf
 	uint32_t fg;
 	uint32_t bg;
 	uint32_t dsize;
-	uint32_t width;
 	uint32_t *data = (uint32_t *)image->data;
 	int ret;
 
@@ -93,9 +92,6 @@ nv04_fbcon_imageblit(struct fb_info *inf
 	if (ret)
 		return ret;
 
-	width = ALIGN(image->width, 8);
-	dsize = ALIGN(width * image->height, 32) >> 5;
-
 	if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
 	    info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
 		fg = ((uint32_t *) info->pseudo_palette)[image->fg_color];
@@ -111,10 +107,11 @@ nv04_fbcon_imageblit(struct fb_info *inf
 			 ((image->dx + image->width) & 0xffff));
 	OUT_RING(chan, bg);
 	OUT_RING(chan, fg);
-	OUT_RING(chan, (image->height << 16) | width);
+	OUT_RING(chan, (image->height << 16) | image->width);
 	OUT_RING(chan, (image->height << 16) | image->width);
 	OUT_RING(chan, (image->dy << 16) | (image->dx & 0xffff));
 
+	dsize = ALIGN(image->width * image->height, 32) >> 5;
 	while (dsize) {
 		int iter_len = dsize > 128 ? 128 : dsize;
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/nouveau/nv50_fbcon.c linux-libre-3.18.36-gnu/drivers/gpu/drm/nouveau/nv50_fbcon.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/nouveau/nv50_fbcon.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/nouveau/nv50_fbcon.c	2016-06-23 00:02:29.000000000 -0400
@@ -95,7 +95,7 @@ nv50_fbcon_imageblit(struct fb_info *inf
 	struct nouveau_fbdev *nfbdev = info->par;
 	struct nouveau_drm *drm = nouveau_drm(nfbdev->dev);
 	struct nouveau_channel *chan = drm->channel;
-	uint32_t width, dwords, *data = (uint32_t *)image->data;
+	uint32_t dwords, *data = (uint32_t *)image->data;
 	uint32_t mask = ~(~0 >> (32 - info->var.bits_per_pixel));
 	uint32_t *palette = info->pseudo_palette;
 	int ret;
@@ -107,9 +107,6 @@ nv50_fbcon_imageblit(struct fb_info *inf
 	if (ret)
 		return ret;
 
-	width = ALIGN(image->width, 32);
-	dwords = (width * image->height) >> 5;
-
 	BEGIN_NV04(chan, NvSub2D, 0x0814, 2);
 	if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
 	    info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
@@ -128,6 +125,7 @@ nv50_fbcon_imageblit(struct fb_info *inf
 	OUT_RING(chan, 0);
 	OUT_RING(chan, image->dy);
 
+	dwords = ALIGN(image->width * image->height, 32) >> 5;
 	while (dwords) {
 		int push = dwords > 2047 ? 2047 : dwords;
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/nouveau/nvc0_fbcon.c linux-libre-3.18.36-gnu/drivers/gpu/drm/nouveau/nvc0_fbcon.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/nouveau/nvc0_fbcon.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/nouveau/nvc0_fbcon.c	2016-06-23 00:02:29.000000000 -0400
@@ -95,7 +95,7 @@ nvc0_fbcon_imageblit(struct fb_info *inf
 	struct nouveau_fbdev *nfbdev = info->par;
 	struct nouveau_drm *drm = nouveau_drm(nfbdev->dev);
 	struct nouveau_channel *chan = drm->channel;
-	uint32_t width, dwords, *data = (uint32_t *)image->data;
+	uint32_t dwords, *data = (uint32_t *)image->data;
 	uint32_t mask = ~(~0 >> (32 - info->var.bits_per_pixel));
 	uint32_t *palette = info->pseudo_palette;
 	int ret;
@@ -107,9 +107,6 @@ nvc0_fbcon_imageblit(struct fb_info *inf
 	if (ret)
 		return ret;
 
-	width = ALIGN(image->width, 32);
-	dwords = (width * image->height) >> 5;
-
 	BEGIN_NVC0(chan, NvSub2D, 0x0814, 2);
 	if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
 	    info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
@@ -128,6 +125,7 @@ nvc0_fbcon_imageblit(struct fb_info *inf
 	OUT_RING  (chan, 0);
 	OUT_RING  (chan, image->dy);
 
+	dwords = ALIGN(image->width * image->height, 32) >> 5;
 	while (dwords) {
 		int push = dwords > 2047 ? 2047 : dwords;
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/omapdrm/omap_fbdev.c linux-libre-3.18.36-gnu/drivers/gpu/drm/omapdrm/omap_fbdev.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/omapdrm/omap_fbdev.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/omapdrm/omap_fbdev.c	2016-06-23 00:02:29.000000000 -0400
@@ -334,17 +334,23 @@ struct drm_fb_helper *omap_fbdev_init(st
 		goto fail;
 	}
 
-	drm_fb_helper_single_add_all_connectors(helper);
+	ret = drm_fb_helper_single_add_all_connectors(helper);
+	if (ret)
+		goto fini;
 
 	/* disable all the possible outputs/crtcs before entering KMS mode */
 	drm_helper_disable_unused_functions(dev);
 
-	drm_fb_helper_initial_config(helper, 32);
+	ret = drm_fb_helper_initial_config(helper, 32);
+	if (ret)
+		goto fini;
 
 	priv->fbdev = helper;
 
 	return helper;
 
+fini:
+	drm_fb_helper_fini(helper);
 fail:
 	kfree(fbdev);
 	return NULL;
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/qxl/qxl_fb.c linux-libre-3.18.36-gnu/drivers/gpu/drm/qxl/qxl_fb.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/qxl/qxl_fb.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/qxl/qxl_fb.c	2016-06-23 00:02:29.000000000 -0400
@@ -686,14 +686,24 @@ int qxl_fbdev_init(struct qxl_device *qd
 	ret = drm_fb_helper_init(qdev->ddev, &qfbdev->helper,
 				 qxl_num_crtc /* num_crtc - QXL supports just 1 */,
 				 QXLFB_CONN_LIMIT);
-	if (ret) {
-		kfree(qfbdev);
-		return ret;
-	}
+	if (ret)
+		goto free;
+
+	ret = drm_fb_helper_single_add_all_connectors(&qfbdev->helper);
+	if (ret)
+		goto fini;
+
+	ret = drm_fb_helper_initial_config(&qfbdev->helper, bpp_sel);
+	if (ret)
+		goto fini;
 
-	drm_fb_helper_single_add_all_connectors(&qfbdev->helper);
-	drm_fb_helper_initial_config(&qfbdev->helper, bpp_sel);
 	return 0;
+
+fini:
+	drm_fb_helper_fini(&qfbdev->helper);
+free:
+	kfree(qfbdev);
+	return ret;
 }
 
 void qxl_fbdev_fini(struct qxl_device *qdev)
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/radeon/radeon_fb.c linux-libre-3.18.36-gnu/drivers/gpu/drm/radeon/radeon_fb.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/radeon/radeon_fb.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/radeon/radeon_fb.c	2016-06-23 00:02:29.000000000 -0400
@@ -365,18 +365,27 @@ int radeon_fbdev_init(struct radeon_devi
 	ret = drm_fb_helper_init(rdev->ddev, &rfbdev->helper,
 				 rdev->num_crtc,
 				 RADEONFB_CONN_LIMIT);
-	if (ret) {
-		kfree(rfbdev);
-		return ret;
-	}
+	if (ret)
+		goto free;
 
-	drm_fb_helper_single_add_all_connectors(&rfbdev->helper);
+	ret = drm_fb_helper_single_add_all_connectors(&rfbdev->helper);
+	if (ret)
+		goto fini;
 
 	/* disable all the possible outputs/crtcs before entering KMS mode */
 	drm_helper_disable_unused_functions(rdev->ddev);
 
-	drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel);
+	ret = drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel);
+	if (ret)
+		goto fini;
+
 	return 0;
+
+fini:
+	drm_fb_helper_fini(&rfbdev->helper);
+free:
+	kfree(rfbdev);
+	return ret;
 }
 
 void radeon_fbdev_fini(struct radeon_device *rdev)
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/gpu/drm/udl/udl_fb.c linux-libre-3.18.36-gnu/drivers/gpu/drm/udl/udl_fb.c
--- linux-libre-3.18.35-gnu/drivers/gpu/drm/udl/udl_fb.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/gpu/drm/udl/udl_fb.c	2016-06-23 00:02:29.000000000 -0400
@@ -589,19 +589,27 @@ int udl_fbdev_init(struct drm_device *de
 
 	ret = drm_fb_helper_init(dev, &ufbdev->helper,
 				 1, 1);
-	if (ret) {
-		kfree(ufbdev);
-		return ret;
-
-	}
+	if (ret)
+		goto free;
 
-	drm_fb_helper_single_add_all_connectors(&ufbdev->helper);
+	ret = drm_fb_helper_single_add_all_connectors(&ufbdev->helper);
+	if (ret)
+		goto fini;
 
 	/* disable all the possible outputs/crtcs before entering KMS mode */
 	drm_helper_disable_unused_functions(dev);
 
-	drm_fb_helper_initial_config(&ufbdev->helper, bpp_sel);
+	ret = drm_fb_helper_initial_config(&ufbdev->helper, bpp_sel);
+	if (ret)
+		goto fini;
+
 	return 0;
+
+fini:
+	drm_fb_helper_fini(&ufbdev->helper);
+free:
+	kfree(ufbdev);
+	return ret;
 }
 
 void udl_fbdev_cleanup(struct drm_device *dev)
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/irqchip/irq-gic-v3.c linux-libre-3.18.36-gnu/drivers/irqchip/irq-gic-v3.c
--- linux-libre-3.18.35-gnu/drivers/irqchip/irq-gic-v3.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/irqchip/irq-gic-v3.c	2016-06-23 00:02:29.000000000 -0400
@@ -474,15 +474,19 @@ out:
 	return tlist;
 }
 
+#define MPIDR_TO_SGI_AFFINITY(cluster_id, level) \
+	(MPIDR_AFFINITY_LEVEL(cluster_id, level) \
+		<< ICC_SGI1R_AFFINITY_## level ##_SHIFT)
+
 static void gic_send_sgi(u64 cluster_id, u16 tlist, unsigned int irq)
 {
 	u64 val;
 
-	val = (MPIDR_AFFINITY_LEVEL(cluster_id, 3) << 48	|
-	       MPIDR_AFFINITY_LEVEL(cluster_id, 2) << 32	|
-	       irq << 24			    		|
-	       MPIDR_AFFINITY_LEVEL(cluster_id, 1) << 16	|
-	       tlist);
+	val = (MPIDR_TO_SGI_AFFINITY(cluster_id, 3)	|
+	       MPIDR_TO_SGI_AFFINITY(cluster_id, 2)	|
+	       irq << ICC_SGI1R_SGI_ID_SHIFT		|
+	       MPIDR_TO_SGI_AFFINITY(cluster_id, 1)	|
+	       tlist << ICC_SGI1R_TARGET_LIST_SHIFT);
 
 	pr_debug("CPU%d: ICC_SGI1R_EL1 %llx\n", smp_processor_id(), val);
 	gic_write_sgi1r(val);
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/net/wireless/mac80211_hwsim.c linux-libre-3.18.36-gnu/drivers/net/wireless/mac80211_hwsim.c
--- linux-libre-3.18.35-gnu/drivers/net/wireless/mac80211_hwsim.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/net/wireless/mac80211_hwsim.c	2016-06-23 00:02:29.000000000 -0400
@@ -2277,6 +2277,7 @@ static int hwsim_tx_info_frame_received_
 	if (!info->attrs[HWSIM_ATTR_ADDR_TRANSMITTER] ||
 	    !info->attrs[HWSIM_ATTR_FLAGS] ||
 	    !info->attrs[HWSIM_ATTR_COOKIE] ||
+	    !info->attrs[HWSIM_ATTR_SIGNAL] ||
 	    !info->attrs[HWSIM_ATTR_TX_INFO])
 		goto out;
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/of/irq.c linux-libre-3.18.36-gnu/drivers/of/irq.c
--- linux-libre-3.18.35-gnu/drivers/of/irq.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/of/irq.c	2016-06-23 00:02:29.000000000 -0400
@@ -385,13 +385,13 @@ int of_irq_to_resource(struct device_nod
 EXPORT_SYMBOL_GPL(of_irq_to_resource);
 
 /**
- * of_irq_get - Decode a node's IRQ and return it as a Linux irq number
+ * of_irq_get - Decode a node's IRQ and return it as a Linux IRQ number
  * @dev: pointer to device tree node
- * @index: zero-based index of the irq
- *
- * Returns Linux irq number on success, or -EPROBE_DEFER if the irq domain
- * is not yet created.
+ * @index: zero-based index of the IRQ
  *
+ * Returns Linux IRQ number on success, or 0 on the IRQ mapping failure, or
+ * -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case
+ * of any other failure.
  */
 int of_irq_get(struct device_node *dev, int index)
 {
@@ -411,12 +411,13 @@ int of_irq_get(struct device_node *dev,
 }
 
 /**
- * of_irq_get_byname - Decode a node's IRQ and return it as a Linux irq number
+ * of_irq_get_byname - Decode a node's IRQ and return it as a Linux IRQ number
  * @dev: pointer to device tree node
- * @name: irq name
+ * @name: IRQ name
  *
- * Returns Linux irq number on success, or -EPROBE_DEFER if the irq domain
- * is not yet created, or error code in case of any other failure.
+ * Returns Linux IRQ number on success, or 0 on the IRQ mapping failure, or
+ * -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case
+ * of any other failure.
  */
 int of_irq_get_byname(struct device_node *dev, const char *name)
 {
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/scsi/scsi_devinfo.c linux-libre-3.18.36-gnu/drivers/scsi/scsi_devinfo.c
--- linux-libre-3.18.35-gnu/drivers/scsi/scsi_devinfo.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/scsi/scsi_devinfo.c	2016-06-23 00:02:29.000000000 -0400
@@ -227,6 +227,7 @@ static struct {
 	{"PIONEER", "CD-ROM DRM-624X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
 	{"Promise", "VTrak E610f", NULL, BLIST_SPARSELUN | BLIST_NO_RSOC},
 	{"Promise", "", NULL, BLIST_SPARSELUN},
+	{"QEMU", "QEMU CD-ROM", NULL, BLIST_SKIP_VPD_PAGES},
 	{"QNAP", "iSCSI Storage", NULL, BLIST_MAX_1024},
 	{"QUANTUM", "XP34301", "1071", BLIST_NOTQ},
 	{"REGAL", "CDC-4X", NULL, BLIST_MAX5LUN | BLIST_SINGLELUN},
diff -druNp --no-dereference linux-libre-3.18.35-gnu/drivers/scsi/scsi_lib.c linux-libre-3.18.36-gnu/drivers/scsi/scsi_lib.c
--- linux-libre-3.18.35-gnu/drivers/scsi/scsi_lib.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/drivers/scsi/scsi_lib.c	2016-06-23 00:02:29.000000000 -0400
@@ -919,9 +919,12 @@ void scsi_io_completion(struct scsi_cmnd
 	}
 
 	/*
-	 * If we finished all bytes in the request we are done now.
+	 * special case: failed zero length commands always need to
+	 * drop down into the retry code. Otherwise, if we finished
+	 * all bytes in the request we are done now.
 	 */
-	if (!scsi_end_request(req, error, good_bytes, 0))
+	if (!(blk_rq_bytes(req) == 0 && error) &&
+	    !scsi_end_request(req, error, good_bytes, 0))
 		return;
 
 	/*
diff -druNp --no-dereference linux-libre-3.18.35-gnu/fs/dcache.c linux-libre-3.18.36-gnu/fs/dcache.c
--- linux-libre-3.18.35-gnu/fs/dcache.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/fs/dcache.c	2016-06-23 00:02:29.000000000 -0400
@@ -1481,7 +1481,7 @@ struct dentry *d_alloc(struct dentry * p
 	struct dentry *dentry = __d_alloc(parent->d_sb, name);
 	if (!dentry)
 		return NULL;
-
+	dentry->d_flags |= DCACHE_RCUACCESS;
 	spin_lock(&parent->d_lock);
 	/*
 	 * don't need child lock because it is not subject
@@ -2313,7 +2313,6 @@ static void __d_rehash(struct dentry * e
 {
 	BUG_ON(!d_unhashed(entry));
 	hlist_bl_lock(b);
-	entry->d_flags |= DCACHE_RCUACCESS;
 	hlist_bl_add_head_rcu(&entry->d_hash, b);
 	hlist_bl_unlock(b);
 }
@@ -2532,6 +2531,7 @@ static void __d_move(struct dentry *dent
 	/* ... and switch them in the tree */
 	if (IS_ROOT(dentry)) {
 		/* splicing a tree */
+		dentry->d_flags |= DCACHE_RCUACCESS;
 		dentry->d_parent = target->d_parent;
 		target->d_parent = target;
 		list_del_init(&target->d_child);
diff -druNp --no-dereference linux-libre-3.18.35-gnu/fs/ecryptfs/kthread.c linux-libre-3.18.36-gnu/fs/ecryptfs/kthread.c
--- linux-libre-3.18.35-gnu/fs/ecryptfs/kthread.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/fs/ecryptfs/kthread.c	2016-06-23 00:02:29.000000000 -0400
@@ -25,6 +25,7 @@
 #include <linux/slab.h>
 #include <linux/wait.h>
 #include <linux/mount.h>
+#include <linux/file.h>
 #include "ecryptfs_kernel.h"
 
 struct ecryptfs_open_req {
@@ -147,7 +148,7 @@ int ecryptfs_privileged_open(struct file
 	flags |= IS_RDONLY(lower_dentry->d_inode) ? O_RDONLY : O_RDWR;
 	(*lower_file) = dentry_open(&req.path, flags, cred);
 	if (!IS_ERR(*lower_file))
-		goto out;
+		goto have_file;
 	if ((flags & O_ACCMODE) == O_RDONLY) {
 		rc = PTR_ERR((*lower_file));
 		goto out;
@@ -165,8 +166,16 @@ int ecryptfs_privileged_open(struct file
 	mutex_unlock(&ecryptfs_kthread_ctl.mux);
 	wake_up(&ecryptfs_kthread_ctl.wait);
 	wait_for_completion(&req.done);
-	if (IS_ERR(*lower_file))
+	if (IS_ERR(*lower_file)) {
 		rc = PTR_ERR(*lower_file);
+		goto out;
+	}
+have_file:
+	if ((*lower_file)->f_op->mmap == NULL) {
+		fput(*lower_file);
+		*lower_file = NULL;
+		rc = -EMEDIUMTYPE;
+	}
 out:
 	return rc;
 }
diff -druNp --no-dereference linux-libre-3.18.35-gnu/fs/namespace.c linux-libre-3.18.36-gnu/fs/namespace.c
--- linux-libre-3.18.35-gnu/fs/namespace.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/fs/namespace.c	2016-06-23 00:02:29.000000000 -0400
@@ -2331,8 +2331,10 @@ static int do_new_mount(struct path *pat
 			mnt_flags |= MNT_NODEV | MNT_LOCK_NODEV;
 		}
 		if (type->fs_flags & FS_USERNS_VISIBLE) {
-			if (!fs_fully_visible(type, &mnt_flags))
+			if (!fs_fully_visible(type, &mnt_flags)) {
+				put_filesystem(type);
 				return -EPERM;
+			}
 		}
 	}
 
@@ -3173,7 +3175,7 @@ static bool fs_fully_visible(struct file
 		list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) {
 			struct inode *inode = child->mnt_mountpoint->d_inode;
 			/* Only worry about locked mounts */
-			if (!(mnt->mnt.mnt_flags & MNT_LOCKED))
+			if (!(child->mnt.mnt_flags & MNT_LOCKED))
 				continue;
 			if (!S_ISDIR(inode->i_mode))
 				goto next;
diff -druNp --no-dereference linux-libre-3.18.35-gnu/fs/proc/root.c linux-libre-3.18.36-gnu/fs/proc/root.c
--- linux-libre-3.18.35-gnu/fs/proc/root.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/fs/proc/root.c	2016-06-23 00:02:29.000000000 -0400
@@ -121,6 +121,13 @@ static struct dentry *proc_mount(struct
 	if (IS_ERR(sb))
 		return ERR_CAST(sb);
 
+	/*
+	 * procfs isn't actually a stacking filesystem; however, there is
+	 * too much magic going on inside it to permit stacking things on
+	 * top of it
+	 */
+	sb->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;
+
 	if (!proc_parse_options(options, ns)) {
 		deactivate_locked_super(sb);
 		return ERR_PTR(-EINVAL);
diff -druNp --no-dereference linux-libre-3.18.35-gnu/include/drm/drm_fb_helper.h linux-libre-3.18.36-gnu/include/drm/drm_fb_helper.h
--- linux-libre-3.18.35-gnu/include/drm/drm_fb_helper.h	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/include/drm/drm_fb_helper.h	2016-06-23 00:02:29.000000000 -0400
@@ -119,7 +119,7 @@ void drm_fb_helper_fill_fix(struct fb_in
 int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
 
 int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);
-bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);
+int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);
 int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper);
 int drm_fb_helper_debug_enter(struct fb_info *info);
 int drm_fb_helper_debug_leave(struct fb_info *info);
diff -druNp --no-dereference linux-libre-3.18.35-gnu/include/linux/irqchip/arm-gic-v3.h linux-libre-3.18.36-gnu/include/linux/irqchip/arm-gic-v3.h
--- linux-libre-3.18.35-gnu/include/linux/irqchip/arm-gic-v3.h	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/include/linux/irqchip/arm-gic-v3.h	2016-06-23 00:02:29.000000000 -0400
@@ -142,6 +142,18 @@
 #define ICC_SRE_EL2_SRE			(1 << 0)
 #define ICC_SRE_EL2_ENABLE		(1 << 3)
 
+#define ICC_SGI1R_TARGET_LIST_SHIFT	0
+#define ICC_SGI1R_TARGET_LIST_MASK	(0xffff << ICC_SGI1R_TARGET_LIST_SHIFT)
+#define ICC_SGI1R_AFFINITY_1_SHIFT	16
+#define ICC_SGI1R_AFFINITY_1_MASK	(0xff << ICC_SGI1R_AFFINITY_1_SHIFT)
+#define ICC_SGI1R_SGI_ID_SHIFT		24
+#define ICC_SGI1R_SGI_ID_MASK		(0xfULL << ICC_SGI1R_SGI_ID_SHIFT)
+#define ICC_SGI1R_AFFINITY_2_SHIFT	32
+#define ICC_SGI1R_AFFINITY_2_MASK	(0xffULL << ICC_SGI1R_AFFINITY_1_SHIFT)
+#define ICC_SGI1R_IRQ_ROUTING_MODE_BIT	40
+#define ICC_SGI1R_AFFINITY_3_SHIFT	48
+#define ICC_SGI1R_AFFINITY_3_MASK	(0xffULL << ICC_SGI1R_AFFINITY_1_SHIFT)
+
 /*
  * System register definitions
  */
diff -druNp --no-dereference linux-libre-3.18.35-gnu/kernel/locking/mutex.c linux-libre-3.18.36-gnu/kernel/locking/mutex.c
--- linux-libre-3.18.35-gnu/kernel/locking/mutex.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/kernel/locking/mutex.c	2016-06-23 00:02:29.000000000 -0400
@@ -471,9 +471,6 @@ __mutex_lock_check_stamp(struct mutex *l
 	if (!hold_ctx)
 		return 0;
 
-	if (unlikely(ctx == hold_ctx))
-		return -EALREADY;
-
 	if (ctx->stamp - hold_ctx->stamp <= LONG_MAX &&
 	    (ctx->stamp != hold_ctx->stamp || ctx > hold_ctx)) {
 #ifdef CONFIG_DEBUG_MUTEXES
@@ -499,6 +496,12 @@ __mutex_lock_common(struct mutex *lock,
 	unsigned long flags;
 	int ret;
 
+	if (use_ww_ctx) {
+		struct ww_mutex *ww = container_of(lock, struct ww_mutex, base);
+		if (unlikely(ww_ctx == READ_ONCE(ww->ctx)))
+			return -EALREADY;
+	}
+
 	preempt_disable();
 	mutex_acquire_nest(&lock->dep_map, subclass, 0, nest_lock, ip);
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/Makefile linux-libre-3.18.36-gnu/Makefile
--- linux-libre-3.18.35-gnu/Makefile	2016-06-08 03:07:55.000000000 -0400
+++ linux-libre-3.18.36-gnu/Makefile	2016-06-24 10:11:22.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 18
-SUBLEVEL = 35
+SUBLEVEL = 36
 EXTRAVERSION =-gnu
 NAME = Diseased Newt
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/net/mac80211/mesh.c linux-libre-3.18.36-gnu/net/mac80211/mesh.c
--- linux-libre-3.18.35-gnu/net/mac80211/mesh.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/net/mac80211/mesh.c	2016-06-23 00:02:29.000000000 -0400
@@ -161,6 +161,10 @@ void mesh_sta_cleanup(struct sta_info *s
 		del_timer_sync(&sta->plink_timer);
 	}
 
+	/* make sure no readers can access nexthop sta from here on */
+	mesh_path_flush_by_nexthop(sta);
+	synchronize_net();
+
 	if (changed)
 		ieee80211_mbss_info_change_notify(sdata, changed);
 }
diff -druNp --no-dereference linux-libre-3.18.35-gnu/net/wireless/wext-core.c linux-libre-3.18.36-gnu/net/wireless/wext-core.c
--- linux-libre-3.18.35-gnu/net/wireless/wext-core.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/net/wireless/wext-core.c	2016-06-23 00:02:29.000000000 -0400
@@ -955,8 +955,29 @@ static int wireless_process_ioctl(struct
 			return private(dev, iwr, cmd, info, handler);
 	}
 	/* Old driver API : call driver ioctl handler */
-	if (dev->netdev_ops->ndo_do_ioctl)
-		return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
+	if (dev->netdev_ops->ndo_do_ioctl) {
+#ifdef CONFIG_COMPAT
+		if (info->flags & IW_REQUEST_FLAG_COMPAT) {
+			int ret = 0;
+			struct iwreq iwr_lcl;
+			struct compat_iw_point *iwp_compat = (void *) &iwr->u.data;
+
+			memcpy(&iwr_lcl, iwr, sizeof(struct iwreq));
+			iwr_lcl.u.data.pointer = compat_ptr(iwp_compat->pointer);
+			iwr_lcl.u.data.length = iwp_compat->length;
+			iwr_lcl.u.data.flags = iwp_compat->flags;
+
+			ret = dev->netdev_ops->ndo_do_ioctl(dev, (void *) &iwr_lcl, cmd);
+
+			iwp_compat->pointer = ptr_to_compat(iwr_lcl.u.data.pointer);
+			iwp_compat->length = iwr_lcl.u.data.length;
+			iwp_compat->flags = iwr_lcl.u.data.flags;
+
+			return ret;
+		} else
+#endif
+			return dev->netdev_ops->ndo_do_ioctl(dev, ifr, cmd);
+	}
 	return -EOPNOTSUPP;
 }
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/scripts/mod/file2alias.c linux-libre-3.18.36-gnu/scripts/mod/file2alias.c
--- linux-libre-3.18.35-gnu/scripts/mod/file2alias.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/scripts/mod/file2alias.c	2016-06-23 00:02:29.000000000 -0400
@@ -653,7 +653,7 @@ static int do_of_entry (const char *file
 	len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*",
 		      (*type)[0] ? *type : "*");
 
-	if (compatible[0])
+	if ((*compatible)[0])
 		sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "",
 			*compatible);
 
diff -druNp --no-dereference linux-libre-3.18.35-gnu/sound/pci/hda/patch_realtek.c linux-libre-3.18.36-gnu/sound/pci/hda/patch_realtek.c
--- linux-libre-3.18.35-gnu/sound/pci/hda/patch_realtek.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/sound/pci/hda/patch_realtek.c	2016-06-23 00:02:29.000000000 -0400
@@ -5641,6 +5641,10 @@ static const struct snd_hda_pin_quirk al
 		{0x17, 0x40000000},
 		{0x1d, 0x40700001},
 		{0x21, 0x02211040}),
+	SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell Inspiron 5565", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
+		{0x12, 0x90a60180},
+		{0x14, 0x90170120},
+		{0x21, 0x02211030}),
 	SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
 		ALC256_STANDARD_PINS,
 		{0x13, 0x40000000}),
diff -druNp --no-dereference linux-libre-3.18.35-gnu/virt/kvm/irqchip.c linux-libre-3.18.36-gnu/virt/kvm/irqchip.c
--- linux-libre-3.18.35-gnu/virt/kvm/irqchip.c	2016-06-06 19:16:46.000000000 -0400
+++ linux-libre-3.18.36-gnu/virt/kvm/irqchip.c	2016-06-23 00:02:29.000000000 -0400
@@ -51,7 +51,7 @@ int kvm_irq_map_gsi(struct kvm *kvm,
 
 	irq_rt = srcu_dereference_check(kvm->irq_routing, &kvm->irq_srcu,
 					lockdep_is_held(&kvm->irq_lock));
-	if (gsi < irq_rt->nr_rt_entries) {
+	if (irq_rt && gsi < irq_rt->nr_rt_entries) {
 		hlist_for_each_entry(e, &irq_rt->map[gsi], link) {
 			entries[n] = *e;
 			++n;
