diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/arm/boot/dts/gemini-dlink-dir-685.dts linux-libre-5.0-gnu/arch/arm/boot/dts/gemini-dlink-dir-685.dts
--- linux-libre-5.0-rc8-gnu/arch/arm/boot/dts/gemini-dlink-dir-685.dts	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/arm/boot/dts/gemini-dlink-dir-685.dts	2019-03-03 18:21:29.000000000 -0500
@@ -443,7 +443,7 @@
 		};
 
 		display-controller@6a000000 {
-			status = "disabled";
+			status = "okay";
 
 			port@0 {
 				reg = <0>;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/arm/crypto/sha256-armv4.pl linux-libre-5.0-gnu/arch/arm/crypto/sha256-armv4.pl
--- linux-libre-5.0-rc8-gnu/arch/arm/crypto/sha256-armv4.pl	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/arm/crypto/sha256-armv4.pl	2019-03-03 18:21:29.000000000 -0500
@@ -212,10 +212,11 @@ K256:
 .global	sha256_block_data_order
 .type	sha256_block_data_order,%function
 sha256_block_data_order:
+.Lsha256_block_data_order:
 #if __ARM_ARCH__<7
 	sub	r3,pc,#8		@ sha256_block_data_order
 #else
-	adr	r3,sha256_block_data_order
+	adr	r3,.Lsha256_block_data_order
 #endif
 #if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
 	ldr	r12,.LOPENSSL_armcap
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/arm/crypto/sha256-core.S_shipped linux-libre-5.0-gnu/arch/arm/crypto/sha256-core.S_shipped
--- linux-libre-5.0-rc8-gnu/arch/arm/crypto/sha256-core.S_shipped	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/arm/crypto/sha256-core.S_shipped	2019-03-03 18:21:29.000000000 -0500
@@ -93,10 +93,11 @@ K256:
 .global	sha256_block_data_order
 .type	sha256_block_data_order,%function
 sha256_block_data_order:
+.Lsha256_block_data_order:
 #if __ARM_ARCH__<7
 	sub	r3,pc,#8		@ sha256_block_data_order
 #else
-	adr	r3,sha256_block_data_order
+	adr	r3,.Lsha256_block_data_order
 #endif
 #if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
 	ldr	r12,.LOPENSSL_armcap
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/arm/crypto/sha512-armv4.pl linux-libre-5.0-gnu/arch/arm/crypto/sha512-armv4.pl
--- linux-libre-5.0-rc8-gnu/arch/arm/crypto/sha512-armv4.pl	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/arm/crypto/sha512-armv4.pl	2019-03-03 18:21:29.000000000 -0500
@@ -274,10 +274,11 @@ WORD64(0x5fcb6fab,0x3ad6faec, 0x6c44198c
 .global	sha512_block_data_order
 .type	sha512_block_data_order,%function
 sha512_block_data_order:
+.Lsha512_block_data_order:
 #if __ARM_ARCH__<7
 	sub	r3,pc,#8		@ sha512_block_data_order
 #else
-	adr	r3,sha512_block_data_order
+	adr	r3,.Lsha512_block_data_order
 #endif
 #if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
 	ldr	r12,.LOPENSSL_armcap
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/arm/crypto/sha512-core.S_shipped linux-libre-5.0-gnu/arch/arm/crypto/sha512-core.S_shipped
--- linux-libre-5.0-rc8-gnu/arch/arm/crypto/sha512-core.S_shipped	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/arm/crypto/sha512-core.S_shipped	2019-03-03 18:21:29.000000000 -0500
@@ -141,10 +141,11 @@ WORD64(0x5fcb6fab,0x3ad6faec, 0x6c44198c
 .global	sha512_block_data_order
 .type	sha512_block_data_order,%function
 sha512_block_data_order:
+.Lsha512_block_data_order:
 #if __ARM_ARCH__<7
 	sub	r3,pc,#8		@ sha512_block_data_order
 #else
-	adr	r3,sha512_block_data_order
+	adr	r3,.Lsha512_block_data_order
 #endif
 #if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
 	ldr	r12,.LOPENSSL_armcap
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/arm64/boot/dts/qcom/msm8998.dtsi linux-libre-5.0-gnu/arch/arm64/boot/dts/qcom/msm8998.dtsi
--- linux-libre-5.0-rc8-gnu/arch/arm64/boot/dts/qcom/msm8998.dtsi	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/arm64/boot/dts/qcom/msm8998.dtsi	2019-03-03 18:21:29.000000000 -0500
@@ -37,7 +37,7 @@
 		};
 
 		memory@86200000 {
-			reg = <0x0 0x86200000 0x0 0x2600000>;
+			reg = <0x0 0x86200000 0x0 0x2d00000>;
 			no-map;
 		};
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/arm64/crypto/chacha-neon-core.S linux-libre-5.0-gnu/arch/arm64/crypto/chacha-neon-core.S
--- linux-libre-5.0-rc8-gnu/arch/arm64/crypto/chacha-neon-core.S	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/arm64/crypto/chacha-neon-core.S	2019-03-03 18:21:29.000000000 -0500
@@ -158,8 +158,8 @@ ENTRY(hchacha_block_neon)
 	mov		w3, w2
 	bl		chacha_permute
 
-	st1		{v0.16b}, [x1], #16
-	st1		{v3.16b}, [x1]
+	st1		{v0.4s}, [x1], #16
+	st1		{v3.4s}, [x1]
 
 	ldp		x29, x30, [sp], #16
 	ret
@@ -532,6 +532,10 @@ ENTRY(chacha_4block_xor_neon)
 	add		v3.4s, v3.4s, v19.4s
 	  add		a2, a2, w8
 	  add		a3, a3, w9
+CPU_BE(	  rev		a0, a0		)
+CPU_BE(	  rev		a1, a1		)
+CPU_BE(	  rev		a2, a2		)
+CPU_BE(	  rev		a3, a3		)
 
 	ld4r		{v24.4s-v27.4s}, [x0], #16
 	ld4r		{v28.4s-v31.4s}, [x0]
@@ -552,6 +556,10 @@ ENTRY(chacha_4block_xor_neon)
 	add		v7.4s, v7.4s, v23.4s
 	  add		a6, a6, w8
 	  add		a7, a7, w9
+CPU_BE(	  rev		a4, a4		)
+CPU_BE(	  rev		a5, a5		)
+CPU_BE(	  rev		a6, a6		)
+CPU_BE(	  rev		a7, a7		)
 
 	// x8[0-3] += s2[0]
 	// x9[0-3] += s2[1]
@@ -569,6 +577,10 @@ ENTRY(chacha_4block_xor_neon)
 	add		v11.4s, v11.4s, v27.4s
 	  add		a10, a10, w8
 	  add		a11, a11, w9
+CPU_BE(	  rev		a8, a8		)
+CPU_BE(	  rev		a9, a9		)
+CPU_BE(	  rev		a10, a10	)
+CPU_BE(	  rev		a11, a11	)
 
 	// x12[0-3] += s3[0]
 	// x13[0-3] += s3[1]
@@ -586,6 +598,10 @@ ENTRY(chacha_4block_xor_neon)
 	add		v15.4s, v15.4s, v31.4s
 	  add		a14, a14, w8
 	  add		a15, a15, w9
+CPU_BE(	  rev		a12, a12	)
+CPU_BE(	  rev		a13, a13	)
+CPU_BE(	  rev		a14, a14	)
+CPU_BE(	  rev		a15, a15	)
 
 	// interleave 32-bit words in state n, n+1
 	  ldp		w6, w7, [x2], #64
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/mips/bcm63xx/dev-enet.c linux-libre-5.0-gnu/arch/mips/bcm63xx/dev-enet.c
--- linux-libre-5.0-rc8-gnu/arch/mips/bcm63xx/dev-enet.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/mips/bcm63xx/dev-enet.c	2019-03-03 18:21:29.000000000 -0500
@@ -70,6 +70,8 @@ static struct platform_device bcm63xx_en
 
 static int shared_device_registered;
 
+static u64 enet_dmamask = DMA_BIT_MASK(32);
+
 static struct resource enet0_res[] = {
 	{
 		.start		= -1, /* filled at runtime */
@@ -99,6 +101,8 @@ static struct platform_device bcm63xx_en
 	.resource	= enet0_res,
 	.dev		= {
 		.platform_data = &enet0_pd,
+		.dma_mask = &enet_dmamask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
 	},
 };
 
@@ -131,6 +135,8 @@ static struct platform_device bcm63xx_en
 	.resource	= enet1_res,
 	.dev		= {
 		.platform_data = &enet1_pd,
+		.dma_mask = &enet_dmamask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
 	},
 };
 
@@ -157,6 +163,8 @@ static struct platform_device bcm63xx_en
 	.resource	= enetsw_res,
 	.dev		= {
 		.platform_data = &enetsw_pd,
+		.dma_mask = &enet_dmamask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
 	},
 };
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/mips/kernel/cmpxchg.c linux-libre-5.0-gnu/arch/mips/kernel/cmpxchg.c
--- linux-libre-5.0-rc8-gnu/arch/mips/kernel/cmpxchg.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/mips/kernel/cmpxchg.c	2019-03-03 18:21:29.000000000 -0500
@@ -54,10 +54,9 @@ unsigned long __xchg_small(volatile void
 unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old,
 			      unsigned long new, unsigned int size)
 {
-	u32 mask, old32, new32, load32;
+	u32 mask, old32, new32, load32, load;
 	volatile u32 *ptr32;
 	unsigned int shift;
-	u8 load;
 
 	/* Check that ptr is naturally aligned */
 	WARN_ON((unsigned long)ptr & (size - 1));
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/mips/kernel/setup.c linux-libre-5.0-gnu/arch/mips/kernel/setup.c
--- linux-libre-5.0-rc8-gnu/arch/mips/kernel/setup.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/mips/kernel/setup.c	2019-03-03 18:21:29.000000000 -0500
@@ -384,7 +384,8 @@ static void __init bootmem_init(void)
 	init_initrd();
 	reserved_end = (unsigned long) PFN_UP(__pa_symbol(&_end));
 
-	memblock_reserve(PHYS_OFFSET, reserved_end << PAGE_SHIFT);
+	memblock_reserve(PHYS_OFFSET,
+			 (reserved_end << PAGE_SHIFT) - PHYS_OFFSET);
 
 	/*
 	 * max_low_pfn is not a number of pages. The number of pages
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/mips/lantiq/xway/vmmc.c linux-libre-5.0-gnu/arch/mips/lantiq/xway/vmmc.c
--- linux-libre-5.0-rc8-gnu/arch/mips/lantiq/xway/vmmc.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/mips/lantiq/xway/vmmc.c	2019-03-03 18:21:29.000000000 -0500
@@ -31,8 +31,8 @@ static int vmmc_probe(struct platform_de
 	dma_addr_t dma;
 
 	cp1_base =
-		(void *) CPHYSADDR(dma_alloc_coherent(NULL, CP1_SIZE,
-						    &dma, GFP_ATOMIC));
+		(void *) CPHYSADDR(dma_alloc_coherent(&pdev->dev, CP1_SIZE,
+						    &dma, GFP_KERNEL));
 
 	gpio_count = of_gpio_count(pdev->dev.of_node);
 	while (gpio_count > 0) {
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/mips/net/ebpf_jit.c linux-libre-5.0-gnu/arch/mips/net/ebpf_jit.c
--- linux-libre-5.0-rc8-gnu/arch/mips/net/ebpf_jit.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/mips/net/ebpf_jit.c	2019-03-03 18:21:29.000000000 -0500
@@ -1819,7 +1819,7 @@ struct bpf_prog *bpf_int_jit_compile(str
 
 	/* Update the icache */
 	flush_icache_range((unsigned long)ctx.target,
-			   (unsigned long)(ctx.target + ctx.idx * sizeof(u32)));
+			   (unsigned long)&ctx.target[ctx.idx]);
 
 	if (bpf_jit_enable > 1)
 		/* Dump JIT code */
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/x86/include/asm/hyperv-tlfs.h linux-libre-5.0-gnu/arch/x86/include/asm/hyperv-tlfs.h
--- linux-libre-5.0-rc8-gnu/arch/x86/include/asm/hyperv-tlfs.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/x86/include/asm/hyperv-tlfs.h	2019-03-03 18:21:29.000000000 -0500
@@ -841,7 +841,7 @@ union hv_gpa_page_range {
  * count is equal with how many entries of union hv_gpa_page_range can
  * be populated into the input parameter page.
  */
-#define HV_MAX_FLUSH_REP_COUNT (PAGE_SIZE - 2 * sizeof(u64) /	\
+#define HV_MAX_FLUSH_REP_COUNT ((PAGE_SIZE - 2 * sizeof(u64)) /	\
 				sizeof(union hv_gpa_page_range))
 
 struct hv_guest_mapping_flush_list {
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/x86/include/asm/uaccess.h linux-libre-5.0-gnu/arch/x86/include/asm/uaccess.h
--- linux-libre-5.0-rc8-gnu/arch/x86/include/asm/uaccess.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/x86/include/asm/uaccess.h	2019-03-03 18:21:29.000000000 -0500
@@ -284,7 +284,7 @@ do {									\
 		__put_user_goto(x, ptr, "l", "k", "ir", label);		\
 		break;							\
 	case 8:								\
-		__put_user_goto_u64((__typeof__(*ptr))(x), ptr, label);	\
+		__put_user_goto_u64(x, ptr, label);			\
 		break;							\
 	default:							\
 		__put_user_bad();					\
@@ -431,8 +431,10 @@ do {									\
 ({								\
 	__label__ __pu_label;					\
 	int __pu_err = -EFAULT;					\
+	__typeof__(*(ptr)) __pu_val;				\
+	__pu_val = x;						\
 	__uaccess_begin();					\
-	__put_user_size((x), (ptr), (size), __pu_label);	\
+	__put_user_size(__pu_val, (ptr), (size), __pu_label);	\
 	__pu_err = 0;						\
 __pu_label:							\
 	__uaccess_end();					\
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/arch/x86/mm/extable.c linux-libre-5.0-gnu/arch/x86/mm/extable.c
--- linux-libre-5.0-rc8-gnu/arch/x86/mm/extable.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/arch/x86/mm/extable.c	2019-03-03 18:21:29.000000000 -0500
@@ -117,67 +117,11 @@ __visible bool ex_handler_fprestore(cons
 }
 EXPORT_SYMBOL_GPL(ex_handler_fprestore);
 
-/* Helper to check whether a uaccess fault indicates a kernel bug. */
-static bool bogus_uaccess(struct pt_regs *regs, int trapnr,
-			  unsigned long fault_addr)
-{
-	/* This is the normal case: #PF with a fault address in userspace. */
-	if (trapnr == X86_TRAP_PF && fault_addr < TASK_SIZE_MAX)
-		return false;
-
-	/*
-	 * This code can be reached for machine checks, but only if the #MC
-	 * handler has already decided that it looks like a candidate for fixup.
-	 * This e.g. happens when attempting to access userspace memory which
-	 * the CPU can't access because of uncorrectable bad memory.
-	 */
-	if (trapnr == X86_TRAP_MC)
-		return false;
-
-	/*
-	 * There are two remaining exception types we might encounter here:
-	 *  - #PF for faulting accesses to kernel addresses
-	 *  - #GP for faulting accesses to noncanonical addresses
-	 * Complain about anything else.
-	 */
-	if (trapnr != X86_TRAP_PF && trapnr != X86_TRAP_GP) {
-		WARN(1, "unexpected trap %d in uaccess\n", trapnr);
-		return false;
-	}
-
-	/*
-	 * This is a faulting memory access in kernel space, on a kernel
-	 * address, in a usercopy function. This can e.g. be caused by improper
-	 * use of helpers like __put_user and by improper attempts to access
-	 * userspace addresses in KERNEL_DS regions.
-	 * The one (semi-)legitimate exception are probe_kernel_{read,write}(),
-	 * which can be invoked from places like kgdb, /dev/mem (for reading)
-	 * and privileged BPF code (for reading).
-	 * The probe_kernel_*() functions set the kernel_uaccess_faults_ok flag
-	 * to tell us that faulting on kernel addresses, and even noncanonical
-	 * addresses, in a userspace accessor does not necessarily imply a
-	 * kernel bug, root might just be doing weird stuff.
-	 */
-	if (current->kernel_uaccess_faults_ok)
-		return false;
-
-	/* This is bad. Refuse the fixup so that we go into die(). */
-	if (trapnr == X86_TRAP_PF) {
-		pr_emerg("BUG: pagefault on kernel address 0x%lx in non-whitelisted uaccess\n",
-			 fault_addr);
-	} else {
-		pr_emerg("BUG: GPF in non-whitelisted uaccess (non-canonical address?)\n");
-	}
-	return true;
-}
-
 __visible bool ex_handler_uaccess(const struct exception_table_entry *fixup,
 				  struct pt_regs *regs, int trapnr,
 				  unsigned long error_code,
 				  unsigned long fault_addr)
 {
-	if (bogus_uaccess(regs, trapnr, fault_addr))
-		return false;
 	regs->ip = ex_fixup_addr(fixup);
 	return true;
 }
@@ -188,8 +132,6 @@ __visible bool ex_handler_ext(const stru
 			      unsigned long error_code,
 			      unsigned long fault_addr)
 {
-	if (bogus_uaccess(regs, trapnr, fault_addr))
-		return false;
 	/* Special hack for uaccess_err */
 	current->thread.uaccess_err = 1;
 	regs->ip = ex_fixup_addr(fixup);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/crypto/ccree/cc_pm.h linux-libre-5.0-gnu/drivers/crypto/ccree/cc_pm.h
--- linux-libre-5.0-rc8-gnu/drivers/crypto/ccree/cc_pm.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/crypto/ccree/cc_pm.h	2019-03-03 18:21:29.000000000 -0500
@@ -30,7 +30,7 @@ static inline int cc_pm_init(struct cc_d
 	return 0;
 }
 
-static void cc_pm_go(struct cc_drvdata *drvdata) {}
+static inline void cc_pm_go(struct cc_drvdata *drvdata) {}
 
 static inline void cc_pm_fini(struct cc_drvdata *drvdata) {}
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h linux-libre-5.0-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
--- linux-libre-5.0-rc8-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h	2019-03-03 18:21:29.000000000 -0500
@@ -405,6 +405,7 @@ struct amdgpu_crtc {
 	struct amdgpu_flip_work *pflip_works;
 	enum amdgpu_flip_status pflip_status;
 	int deferred_flip_completion;
+	u64 last_flip_vblank;
 	/* pll sharing */
 	struct amdgpu_atom_ss ss;
 	bool ss_enabled;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c linux-libre-5.0-gnu/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
--- linux-libre-5.0-rc8-gnu/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c	2019-02-24 20:39:06.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c	2019-03-03 21:02:16.000000000 -0500
@@ -303,12 +303,11 @@ static void dm_pflip_high_irq(void *inte
 		return;
 	}
 
+	/* Update to correct count(s) if racing with vblank irq */
+	amdgpu_crtc->last_flip_vblank = drm_crtc_accurate_vblank_count(&amdgpu_crtc->base);
 
 	/* wake up userspace */
 	if (amdgpu_crtc->event) {
-		/* Update to correct count(s) if racing with vblank irq */
-		drm_crtc_accurate_vblank_count(&amdgpu_crtc->base);
-
 		drm_crtc_send_vblank_event(&amdgpu_crtc->base, amdgpu_crtc->event);
 
 		/* page flip completed. clean up */
@@ -4828,6 +4827,8 @@ static void amdgpu_dm_commit_planes(stru
 			to_dm_crtc_state(drm_atomic_get_old_crtc_state(state, pcrtc));
 	int planes_count = 0;
 	unsigned long flags;
+	u64 last_flip_vblank;
+	bool vrr_active = acrtc_state->freesync_config.state == VRR_STATE_ACTIVE_VARIABLE;
 
 	/* update planes when needed */
 	for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
@@ -4859,6 +4860,16 @@ static void amdgpu_dm_commit_planes(stru
 			/* In commit tail framework this cannot happen */
 			WARN_ON(1);
 		}
+
+		/* For variable refresh rate mode only:
+		 * Get vblank of last completed flip to avoid > 1 vrr flips per
+		 * video frame by use of throttling, but allow flip programming
+		 * anywhere in the possibly large variable vrr vblank interval
+		 * for fine-grained flip timing control and more opportunity to
+		 * avoid stutter on late submission of amdgpu_dm_do_flip() calls.
+		 */
+		last_flip_vblank = acrtc_attach->last_flip_vblank;
+
 		spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
 
 		if (!pflip_needed || plane->type == DRM_PLANE_TYPE_OVERLAY) {
@@ -4882,10 +4893,18 @@ static void amdgpu_dm_commit_planes(stru
 			if (plane->type == DRM_PLANE_TYPE_PRIMARY)
 				drm_crtc_vblank_get(crtc);
 
+			/* Use old throttling in non-vrr fixed refresh rate mode
+			 * to keep flip scheduling based on target vblank counts
+			 * working in a backwards compatible way, e.g., clients
+			 * using GLX_OML_sync_control extension.
+			 */
+			if (!vrr_active)
+				last_flip_vblank = drm_crtc_vblank_count(crtc);
+
 			amdgpu_dm_do_flip(
 				crtc,
 				fb,
-				(uint32_t)drm_crtc_vblank_count(crtc) + *wait_for_vblank,
+				(uint32_t) last_flip_vblank + *wait_for_vblank,
 				dc_state);
 		}
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/gpu/drm/bochs/bochs_drv.c linux-libre-5.0-gnu/drivers/gpu/drm/bochs/bochs_drv.c
--- linux-libre-5.0-rc8-gnu/drivers/gpu/drm/bochs/bochs_drv.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/gpu/drm/bochs/bochs_drv.c	2019-03-03 18:21:29.000000000 -0500
@@ -154,6 +154,10 @@ static int bochs_pci_probe(struct pci_de
 	if (IS_ERR(dev))
 		return PTR_ERR(dev);
 
+	ret = pci_enable_device(pdev);
+	if (ret)
+		goto err_free_dev;
+
 	dev->pdev = pdev;
 	pci_set_drvdata(pdev, dev);
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/gpu/drm/drm_atomic_helper.c linux-libre-5.0-gnu/drivers/gpu/drm/drm_atomic_helper.c
--- linux-libre-5.0-rc8-gnu/drivers/gpu/drm/drm_atomic_helper.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/gpu/drm/drm_atomic_helper.c	2019-03-03 18:21:29.000000000 -0500
@@ -1602,6 +1602,15 @@ int drm_atomic_helper_async_check(struct
 	    old_plane_state->crtc != new_plane_state->crtc)
 		return -EINVAL;
 
+	/*
+	 * FIXME: Since prepare_fb and cleanup_fb are always called on
+	 * the new_plane_state for async updates we need to block framebuffer
+	 * changes. This prevents use of a fb that's been cleaned up and
+	 * double cleanups from occuring.
+	 */
+	if (old_plane_state->fb != new_plane_state->fb)
+		return -EINVAL;
+
 	funcs = plane->helper_private;
 	if (!funcs->atomic_async_update)
 		return -EINVAL;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/iommu/dmar.c linux-libre-5.0-gnu/drivers/iommu/dmar.c
--- linux-libre-5.0-rc8-gnu/drivers/iommu/dmar.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/iommu/dmar.c	2019-03-03 18:21:29.000000000 -0500
@@ -144,7 +144,7 @@ dmar_alloc_pci_notify_info(struct pci_de
 		for (tmp = dev; tmp; tmp = tmp->bus->self)
 			level++;
 
-	size = sizeof(*info) + level * sizeof(struct acpi_dmar_pci_path);
+	size = sizeof(*info) + level * sizeof(info->path[0]);
 	if (size <= sizeof(dmar_pci_notify_info_buf)) {
 		info = (struct dmar_pci_notify_info *)dmar_pci_notify_info_buf;
 	} else {
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/mmc/core/block.c linux-libre-5.0-gnu/drivers/mmc/core/block.c
--- linux-libre-5.0-rc8-gnu/drivers/mmc/core/block.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/mmc/core/block.c	2019-03-03 18:21:29.000000000 -0500
@@ -2380,12 +2380,6 @@ static struct mmc_blk_data *mmc_blk_allo
 	snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
 		 "mmcblk%u%s", card->host->index, subname ? subname : "");
 
-	if (mmc_card_mmc(card))
-		blk_queue_logical_block_size(md->queue.queue,
-					     card->ext_csd.data_sector_size);
-	else
-		blk_queue_logical_block_size(md->queue.queue, 512);
-
 	set_capacity(md->disk, size);
 
 	if (mmc_host_cmd23(card->host)) {
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/mmc/core/core.c linux-libre-5.0-gnu/drivers/mmc/core/core.c
--- linux-libre-5.0-rc8-gnu/drivers/mmc/core/core.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/mmc/core/core.c	2019-03-03 18:21:29.000000000 -0500
@@ -95,7 +95,7 @@ static void mmc_should_fail_request(stru
 	if (!data)
 		return;
 
-	if (cmd->error || data->error ||
+	if ((cmd && cmd->error) || data->error ||
 	    !should_fail(&host->fail_mmc_request, data->blksz * data->blocks))
 		return;
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/mmc/core/queue.c linux-libre-5.0-gnu/drivers/mmc/core/queue.c
--- linux-libre-5.0-rc8-gnu/drivers/mmc/core/queue.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/mmc/core/queue.c	2019-03-03 18:21:29.000000000 -0500
@@ -355,6 +355,7 @@ static void mmc_setup_queue(struct mmc_q
 {
 	struct mmc_host *host = card->host;
 	u64 limit = BLK_BOUNCE_HIGH;
+	unsigned block_size = 512;
 
 	if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask)
 		limit = (u64)dma_max_pfn(mmc_dev(host)) << PAGE_SHIFT;
@@ -368,7 +369,13 @@ static void mmc_setup_queue(struct mmc_q
 	blk_queue_max_hw_sectors(mq->queue,
 		min(host->max_blk_count, host->max_req_size / 512));
 	blk_queue_max_segments(mq->queue, host->max_segs);
-	blk_queue_max_segment_size(mq->queue, host->max_seg_size);
+
+	if (mmc_card_mmc(card))
+		block_size = card->ext_csd.data_sector_size;
+
+	blk_queue_logical_block_size(mq->queue, block_size);
+	blk_queue_max_segment_size(mq->queue,
+			round_down(host->max_seg_size, block_size));
 
 	INIT_WORK(&mq->recovery_work, mmc_mq_recovery_handler);
 	INIT_WORK(&mq->complete_work, mmc_blk_mq_complete_work);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/mmc/host/cqhci.c linux-libre-5.0-gnu/drivers/mmc/host/cqhci.c
--- linux-libre-5.0-rc8-gnu/drivers/mmc/host/cqhci.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/mmc/host/cqhci.c	2019-03-03 18:21:29.000000000 -0500
@@ -201,7 +201,7 @@ static int cqhci_host_alloc_tdl(struct c
 	cq_host->desc_size = cq_host->slot_sz * cq_host->num_slots;
 
 	cq_host->data_size = cq_host->trans_desc_len * cq_host->mmc->max_segs *
-		(cq_host->num_slots - 1);
+		cq_host->mmc->cqe_qdepth;
 
 	pr_debug("%s: cqhci: desc_size: %zu data_sz: %zu slot-sz: %d\n",
 		 mmc_hostname(cq_host->mmc), cq_host->desc_size, cq_host->data_size,
@@ -217,12 +217,21 @@ static int cqhci_host_alloc_tdl(struct c
 						 cq_host->desc_size,
 						 &cq_host->desc_dma_base,
 						 GFP_KERNEL);
+	if (!cq_host->desc_base)
+		return -ENOMEM;
+
 	cq_host->trans_desc_base = dmam_alloc_coherent(mmc_dev(cq_host->mmc),
 					      cq_host->data_size,
 					      &cq_host->trans_desc_dma_base,
 					      GFP_KERNEL);
-	if (!cq_host->desc_base || !cq_host->trans_desc_base)
+	if (!cq_host->trans_desc_base) {
+		dmam_free_coherent(mmc_dev(cq_host->mmc), cq_host->desc_size,
+				   cq_host->desc_base,
+				   cq_host->desc_dma_base);
+		cq_host->desc_base = NULL;
+		cq_host->desc_dma_base = 0;
 		return -ENOMEM;
+	}
 
 	pr_debug("%s: cqhci: desc-base: 0x%p trans-base: 0x%p\n desc_dma 0x%llx trans_dma: 0x%llx\n",
 		 mmc_hostname(cq_host->mmc), cq_host->desc_base, cq_host->trans_desc_base,
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/mmc/host/mmc_spi.c linux-libre-5.0-gnu/drivers/mmc/host/mmc_spi.c
--- linux-libre-5.0-rc8-gnu/drivers/mmc/host/mmc_spi.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/mmc/host/mmc_spi.c	2019-03-03 18:21:29.000000000 -0500
@@ -1450,6 +1450,7 @@ static int mmc_spi_probe(struct spi_devi
 		mmc->caps &= ~MMC_CAP_NEEDS_POLL;
 		mmc_gpiod_request_cd_irq(mmc);
 	}
+	mmc_detect_change(mmc, 0);
 
 	/* Index 1 is write protect/read only */
 	status = mmc_gpiod_request_ro(mmc, NULL, 1, false, 0, NULL);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/mmc/host/renesas_sdhi_sys_dmac.c linux-libre-5.0-gnu/drivers/mmc/host/renesas_sdhi_sys_dmac.c
--- linux-libre-5.0-rc8-gnu/drivers/mmc/host/renesas_sdhi_sys_dmac.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/mmc/host/renesas_sdhi_sys_dmac.c	2019-03-03 18:21:29.000000000 -0500
@@ -65,6 +65,7 @@ static const struct renesas_sdhi_of_data
 	.scc_offset	= 0x0300,
 	.taps		= rcar_gen2_scc_taps,
 	.taps_num	= ARRAY_SIZE(rcar_gen2_scc_taps),
+	.max_blk_count  = 0xffffffff,
 };
 
 /* Definitions for sampling clocks */
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/mmc/host/sdhci-esdhc-imx.c linux-libre-5.0-gnu/drivers/mmc/host/sdhci-esdhc-imx.c
--- linux-libre-5.0-rc8-gnu/drivers/mmc/host/sdhci-esdhc-imx.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/mmc/host/sdhci-esdhc-imx.c	2019-03-03 18:21:29.000000000 -0500
@@ -1095,11 +1095,12 @@ static void sdhci_esdhc_imx_hwinit(struc
 		writel(readl(host->ioaddr + SDHCI_HOST_CONTROL)
 			| ESDHC_BURST_LEN_EN_INCR,
 			host->ioaddr + SDHCI_HOST_CONTROL);
+
 		/*
-		* erratum ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL
-		* TO1.1, it's harmless for MX6SL
-		*/
-		writel(readl(host->ioaddr + 0x6c) | BIT(7),
+		 * erratum ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL
+		 * TO1.1, it's harmless for MX6SL
+		 */
+		writel(readl(host->ioaddr + 0x6c) & ~BIT(7),
 			host->ioaddr + 0x6c);
 
 		/* disable DLL_CTRL delay line settings */
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/mmc/host/tmio_mmc_core.c linux-libre-5.0-gnu/drivers/mmc/host/tmio_mmc_core.c
--- linux-libre-5.0-rc8-gnu/drivers/mmc/host/tmio_mmc_core.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/mmc/host/tmio_mmc_core.c	2019-03-03 18:21:29.000000000 -0500
@@ -43,6 +43,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/mmc/sdio.h>
 #include <linux/scatterlist.h>
+#include <linux/sizes.h>
 #include <linux/spinlock.h>
 #include <linux/swiotlb.h>
 #include <linux/workqueue.h>
@@ -629,7 +630,7 @@ static bool __tmio_mmc_sdcard_irq(struct
 	return false;
 }
 
-static void __tmio_mmc_sdio_irq(struct tmio_mmc_host *host)
+static bool __tmio_mmc_sdio_irq(struct tmio_mmc_host *host)
 {
 	struct mmc_host *mmc = host->mmc;
 	struct tmio_mmc_data *pdata = host->pdata;
@@ -637,7 +638,7 @@ static void __tmio_mmc_sdio_irq(struct t
 	unsigned int sdio_status;
 
 	if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
-		return;
+		return false;
 
 	status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
 	ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdio_irq_mask;
@@ -650,6 +651,8 @@ static void __tmio_mmc_sdio_irq(struct t
 
 	if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
 		mmc_signal_sdio_irq(mmc);
+
+	return ireg;
 }
 
 irqreturn_t tmio_mmc_irq(int irq, void *devid)
@@ -668,9 +671,10 @@ irqreturn_t tmio_mmc_irq(int irq, void *
 	if (__tmio_mmc_sdcard_irq(host, ireg, status))
 		return IRQ_HANDLED;
 
-	__tmio_mmc_sdio_irq(host);
+	if (__tmio_mmc_sdio_irq(host))
+		return IRQ_HANDLED;
 
-	return IRQ_HANDLED;
+	return IRQ_NONE;
 }
 EXPORT_SYMBOL_GPL(tmio_mmc_irq);
 
@@ -700,7 +704,10 @@ static int tmio_mmc_start_data(struct tm
 
 	/* Set transfer length / blocksize */
 	sd_ctrl_write16(host, CTL_SD_XFER_LEN, data->blksz);
-	sd_ctrl_write16(host, CTL_XFER_BLK_COUNT, data->blocks);
+	if (host->mmc->max_blk_count >= SZ_64K)
+		sd_ctrl_write32(host, CTL_XFER_BLK_COUNT, data->blocks);
+	else
+		sd_ctrl_write16(host, CTL_XFER_BLK_COUNT, data->blocks);
 
 	tmio_mmc_start_dma(host, data);
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/mmc/host/tmio_mmc.h linux-libre-5.0-gnu/drivers/mmc/host/tmio_mmc.h
--- linux-libre-5.0-rc8-gnu/drivers/mmc/host/tmio_mmc.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/mmc/host/tmio_mmc.h	2019-03-03 18:21:29.000000000 -0500
@@ -277,6 +277,11 @@ static inline void sd_ctrl_write32_as_16
 	iowrite16(val >> 16, host->ctl + ((addr + 2) << host->bus_shift));
 }
 
+static inline void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val)
+{
+	iowrite32(val, host->ctl + (addr << host->bus_shift));
+}
+
 static inline void sd_ctrl_write32_rep(struct tmio_mmc_host *host, int addr,
 				       const u32 *buf, int count)
 {
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/dsa/lantiq_gswip.c linux-libre-5.0-gnu/drivers/net/dsa/lantiq_gswip.c
--- linux-libre-5.0-rc8-gnu/drivers/net/dsa/lantiq_gswip.c	2019-02-24 20:59:00.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/dsa/lantiq_gswip.c	2019-03-03 21:21:41.000000000 -0500
@@ -1162,6 +1162,7 @@ static struct platform_driver gswip_driv
 
 module_platform_driver(gswip_driver);
 
+/*(DEBLOBBED)*/
 MODULE_AUTHOR("Hauke Mehrtens <hauke@hauke-m.de>");
 MODULE_DESCRIPTION("Lantiq / Intel GSWIP driver");
 MODULE_LICENSE("GPL v2");
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/dsa/mv88e6xxx/chip.c linux-libre-5.0-gnu/drivers/net/dsa/mv88e6xxx/chip.c
--- linux-libre-5.0-rc8-gnu/drivers/net/dsa/mv88e6xxx/chip.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/dsa/mv88e6xxx/chip.c	2019-03-03 18:21:29.000000000 -0500
@@ -896,7 +896,7 @@ static uint64_t _mv88e6xxx_get_ethtool_s
 	default:
 		return U64_MAX;
 	}
-	value = (((u64)high) << 16) | low;
+	value = (((u64)high) << 32) | low;
 	return value;
 }
 
@@ -3093,7 +3093,7 @@ static const struct mv88e6xxx_ops mv88e6
 	.port_disable_pri_override = mv88e6xxx_port_disable_pri_override,
 	.port_link_state = mv88e6352_port_link_state,
 	.port_get_cmode = mv88e6185_port_get_cmode,
-	.stats_snapshot = mv88e6320_g1_stats_snapshot,
+	.stats_snapshot = mv88e6xxx_g1_stats_snapshot,
 	.stats_set_histogram = mv88e6095_g1_stats_set_histogram,
 	.stats_get_sset_count = mv88e6095_stats_get_sset_count,
 	.stats_get_strings = mv88e6095_stats_get_strings,
@@ -4595,6 +4595,14 @@ static int mv88e6xxx_smi_init(struct mv8
 	return 0;
 }
 
+static void mv88e6xxx_ports_cmode_init(struct mv88e6xxx_chip *chip)
+{
+	int i;
+
+	for (i = 0; i < mv88e6xxx_num_ports(chip); i++)
+		chip->ports[i].cmode = MV88E6XXX_PORT_STS_CMODE_INVALID;
+}
+
 static enum dsa_tag_protocol mv88e6xxx_get_tag_protocol(struct dsa_switch *ds,
 							int port)
 {
@@ -4631,6 +4639,8 @@ static const char *mv88e6xxx_drv_probe(s
 	if (err)
 		goto free;
 
+	mv88e6xxx_ports_cmode_init(chip);
+
 	mutex_lock(&chip->reg_lock);
 	err = mv88e6xxx_switch_reset(chip);
 	mutex_unlock(&chip->reg_lock);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/dsa/mv88e6xxx/port.c linux-libre-5.0-gnu/drivers/net/dsa/mv88e6xxx/port.c
--- linux-libre-5.0-rc8-gnu/drivers/net/dsa/mv88e6xxx/port.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/dsa/mv88e6xxx/port.c	2019-03-03 18:21:29.000000000 -0500
@@ -398,6 +398,10 @@ int mv88e6390x_port_set_cmode(struct mv8
 		cmode = 0;
 	}
 
+	/* cmode doesn't change, nothing to do for us */
+	if (cmode == chip->ports[port].cmode)
+		return 0;
+
 	lane = mv88e6390x_serdes_get_lane(chip, port);
 	if (lane < 0)
 		return lane;
@@ -408,7 +412,7 @@ int mv88e6390x_port_set_cmode(struct mv8
 			return err;
 	}
 
-	err = mv88e6390_serdes_power(chip, port, false);
+	err = mv88e6390x_serdes_power(chip, port, false);
 	if (err)
 		return err;
 
@@ -424,7 +428,7 @@ int mv88e6390x_port_set_cmode(struct mv8
 		if (err)
 			return err;
 
-		err = mv88e6390_serdes_power(chip, port, true);
+		err = mv88e6390x_serdes_power(chip, port, true);
 		if (err)
 			return err;
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/dsa/mv88e6xxx/port.h linux-libre-5.0-gnu/drivers/net/dsa/mv88e6xxx/port.h
--- linux-libre-5.0-rc8-gnu/drivers/net/dsa/mv88e6xxx/port.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/dsa/mv88e6xxx/port.h	2019-03-03 18:21:29.000000000 -0500
@@ -52,6 +52,7 @@
 #define MV88E6185_PORT_STS_CMODE_1000BASE_X	0x0005
 #define MV88E6185_PORT_STS_CMODE_PHY		0x0006
 #define MV88E6185_PORT_STS_CMODE_DISABLED	0x0007
+#define MV88E6XXX_PORT_STS_CMODE_INVALID	0xff
 
 /* Offset 0x01: MAC (or PCS or Physical) Control Register */
 #define MV88E6XXX_PORT_MAC_CTL				0x01
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c linux-libre-5.0-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
--- linux-libre-5.0-rc8-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c	2019-03-03 18:21:29.000000000 -0500
@@ -275,6 +275,9 @@ static int hw_atl_b0_hw_offload_set(stru
 
 static int hw_atl_b0_hw_init_tx_path(struct aq_hw_s *self)
 {
+	/* Tx TC/Queue number config */
+	hw_atl_rpb_tps_tx_tc_mode_set(self, 1U);
+
 	hw_atl_thm_lso_tcp_flag_of_first_pkt_set(self, 0x0FF6U);
 	hw_atl_thm_lso_tcp_flag_of_middle_pkt_set(self, 0x0FF6U);
 	hw_atl_thm_lso_tcp_flag_of_last_pkt_set(self, 0x0F7FU);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c linux-libre-5.0-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c
--- linux-libre-5.0-rc8-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c	2019-03-03 18:21:29.000000000 -0500
@@ -1274,6 +1274,15 @@ void hw_atl_tpb_tx_buff_en_set(struct aq
 			    HW_ATL_TPB_TX_BUF_EN_SHIFT, tx_buff_en);
 }
 
+void hw_atl_rpb_tps_tx_tc_mode_set(struct aq_hw_s *aq_hw,
+				   u32 tx_traf_class_mode)
+{
+	aq_hw_write_reg_bit(aq_hw, HW_ATL_TPB_TX_TC_MODE_ADDR,
+			HW_ATL_TPB_TX_TC_MODE_MSK,
+			HW_ATL_TPB_TX_TC_MODE_SHIFT,
+			tx_traf_class_mode);
+}
+
 void hw_atl_tpb_tx_buff_hi_threshold_per_tc_set(struct aq_hw_s *aq_hw,
 						u32 tx_buff_hi_threshold_per_tc,
 					 u32 buffer)
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h linux-libre-5.0-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h
--- linux-libre-5.0-rc8-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.h	2019-03-03 18:21:29.000000000 -0500
@@ -605,6 +605,10 @@ void hw_atl_thm_lso_tcp_flag_of_middle_p
 
 /* tpb */
 
+/* set TX Traffic Class Mode */
+void hw_atl_rpb_tps_tx_tc_mode_set(struct aq_hw_s *aq_hw,
+				   u32 tx_traf_class_mode);
+
 /* set tx buffer enable */
 void hw_atl_tpb_tx_buff_en_set(struct aq_hw_s *aq_hw, u32 tx_buff_en);
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h linux-libre-5.0-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h
--- linux-libre-5.0-rc8-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h	2019-03-03 18:21:29.000000000 -0500
@@ -1948,6 +1948,19 @@
 /* default value of bitfield tx_buf_en */
 #define HW_ATL_TPB_TX_BUF_EN_DEFAULT 0x0
 
+/* register address for bitfield tx_tc_mode */
+#define HW_ATL_TPB_TX_TC_MODE_ADDR 0x00007900
+/* bitmask for bitfield tx_tc_mode */
+#define HW_ATL_TPB_TX_TC_MODE_MSK 0x00000100
+/* inverted bitmask for bitfield tx_tc_mode */
+#define HW_ATL_TPB_TX_TC_MODE_MSKN 0xFFFFFEFF
+/* lower bit position of bitfield tx_tc_mode */
+#define HW_ATL_TPB_TX_TC_MODE_SHIFT 8
+/* width of bitfield tx_tc_mode */
+#define HW_ATL_TPB_TX_TC_MODE_WIDTH 1
+/* default value of bitfield tx_tc_mode */
+#define HW_ATL_TPB_TX_TC_MODE_DEFAULT 0x0
+
 /* tx tx{b}_hi_thresh[c:0] bitfield definitions
  * preprocessor definitions for the bitfield "tx{b}_hi_thresh[c:0]".
  * parameter: buffer {b} | stride size 0x10 | range [0, 7]
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/ethernet/broadcom/bnxt/bnxt.c linux-libre-5.0-gnu/drivers/net/ethernet/broadcom/bnxt/bnxt.c
--- linux-libre-5.0-rc8-gnu/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2019-03-03 18:21:29.000000000 -0500
@@ -500,6 +500,12 @@ normal_tx:
 	}
 
 	length >>= 9;
+	if (unlikely(length >= ARRAY_SIZE(bnxt_lhint_arr))) {
+		dev_warn_ratelimited(&pdev->dev, "Dropped oversize %d bytes TX packet.\n",
+				     skb->len);
+		i = 0;
+		goto tx_dma_error;
+	}
 	flags |= bnxt_lhint_arr[length];
 	txbd->tx_bd_len_flags_type = cpu_to_le32(flags);
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/ethernet/microchip/enc28j60.c linux-libre-5.0-gnu/drivers/net/ethernet/microchip/enc28j60.c
--- linux-libre-5.0-rc8-gnu/drivers/net/ethernet/microchip/enc28j60.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/ethernet/microchip/enc28j60.c	2019-03-03 18:21:29.000000000 -0500
@@ -1681,5 +1681,5 @@ MODULE_DESCRIPTION(DRV_NAME " ethernet d
 MODULE_AUTHOR("Claudio Lanconelli <lanconelli.claudio@eptar.com>");
 MODULE_LICENSE("GPL");
 module_param_named(debug, debug.msg_enable, int, 0);
-MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., ffff=all)");
+MODULE_PARM_DESC(debug, "Debug verbosity level in amount of bits set (0=none, ..., 31=all)");
 MODULE_ALIAS("spi:" DRV_NAME);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/ethernet/microchip/lan743x_main.c linux-libre-5.0-gnu/drivers/net/ethernet/microchip/lan743x_main.c
--- linux-libre-5.0-rc8-gnu/drivers/net/ethernet/microchip/lan743x_main.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/ethernet/microchip/lan743x_main.c	2019-03-03 18:21:29.000000000 -0500
@@ -1400,7 +1400,8 @@ static int lan743x_tx_frame_start(struct
 }
 
 static void lan743x_tx_frame_add_lso(struct lan743x_tx *tx,
-				     unsigned int frame_length)
+				     unsigned int frame_length,
+				     int nr_frags)
 {
 	/* called only from within lan743x_tx_xmit_frame.
 	 * assuming tx->ring_lock has already been acquired.
@@ -1410,6 +1411,10 @@ static void lan743x_tx_frame_add_lso(str
 
 	/* wrap up previous descriptor */
 	tx->frame_data0 |= TX_DESC_DATA0_EXT_;
+	if (nr_frags <= 0) {
+		tx->frame_data0 |= TX_DESC_DATA0_LS_;
+		tx->frame_data0 |= TX_DESC_DATA0_IOC_;
+	}
 	tx_descriptor = &tx->ring_cpu_ptr[tx->frame_tail];
 	tx_descriptor->data0 = tx->frame_data0;
 
@@ -1514,8 +1519,11 @@ static void lan743x_tx_frame_end(struct
 	u32 tx_tail_flags = 0;
 
 	/* wrap up previous descriptor */
-	tx->frame_data0 |= TX_DESC_DATA0_LS_;
-	tx->frame_data0 |= TX_DESC_DATA0_IOC_;
+	if ((tx->frame_data0 & TX_DESC_DATA0_DTYPE_MASK_) ==
+	    TX_DESC_DATA0_DTYPE_DATA_) {
+		tx->frame_data0 |= TX_DESC_DATA0_LS_;
+		tx->frame_data0 |= TX_DESC_DATA0_IOC_;
+	}
 
 	tx_descriptor = &tx->ring_cpu_ptr[tx->frame_tail];
 	buffer_info = &tx->buffer_info[tx->frame_tail];
@@ -1600,7 +1608,7 @@ static netdev_tx_t lan743x_tx_xmit_frame
 	}
 
 	if (gso)
-		lan743x_tx_frame_add_lso(tx, frame_length);
+		lan743x_tx_frame_add_lso(tx, frame_length, nr_frags);
 
 	if (nr_frags <= 0)
 		goto finish;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/geneve.c linux-libre-5.0-gnu/drivers/net/geneve.c
--- linux-libre-5.0-rc8-gnu/drivers/net/geneve.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/geneve.c	2019-03-03 18:21:29.000000000 -0500
@@ -692,15 +692,20 @@ out:
 static int geneve_open(struct net_device *dev)
 {
 	struct geneve_dev *geneve = netdev_priv(dev);
-	bool ipv6 = !!(geneve->info.mode & IP_TUNNEL_INFO_IPV6);
 	bool metadata = geneve->collect_md;
+	bool ipv4, ipv6;
 	int ret = 0;
 
+	ipv6 = geneve->info.mode & IP_TUNNEL_INFO_IPV6 || metadata;
+	ipv4 = !ipv6 || metadata;
 #if IS_ENABLED(CONFIG_IPV6)
-	if (ipv6 || metadata)
+	if (ipv6) {
 		ret = geneve_sock_add(geneve, true);
+		if (ret < 0 && ret != -EAFNOSUPPORT)
+			ipv4 = false;
+	}
 #endif
-	if (!ret && (!ipv6 || metadata))
+	if (ipv4)
 		ret = geneve_sock_add(geneve, false);
 	if (ret < 0)
 		geneve_sock_release(geneve);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/hyperv/netvsc_drv.c linux-libre-5.0-gnu/drivers/net/hyperv/netvsc_drv.c
--- linux-libre-5.0-rc8-gnu/drivers/net/hyperv/netvsc_drv.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/hyperv/netvsc_drv.c	2019-03-03 18:21:29.000000000 -0500
@@ -744,6 +744,14 @@ void netvsc_linkstatus_callback(struct n
 	schedule_delayed_work(&ndev_ctx->dwork, 0);
 }
 
+static void netvsc_comp_ipcsum(struct sk_buff *skb)
+{
+	struct iphdr *iph = (struct iphdr *)skb->data;
+
+	iph->check = 0;
+	iph->check = ip_fast_csum(iph, iph->ihl);
+}
+
 static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net,
 					     struct netvsc_channel *nvchan)
 {
@@ -770,9 +778,17 @@ static struct sk_buff *netvsc_alloc_recv
 	/* skb is already created with CHECKSUM_NONE */
 	skb_checksum_none_assert(skb);
 
-	/*
-	 * In Linux, the IP checksum is always checked.
-	 * Do L4 checksum offload if enabled and present.
+	/* Incoming packets may have IP header checksum verified by the host.
+	 * They may not have IP header checksum computed after coalescing.
+	 * We compute it here if the flags are set, because on Linux, the IP
+	 * checksum is always checked.
+	 */
+	if (csum_info && csum_info->receive.ip_checksum_value_invalid &&
+	    csum_info->receive.ip_checksum_succeeded &&
+	    skb->protocol == htons(ETH_P_IP))
+		netvsc_comp_ipcsum(skb);
+
+	/* Do L4 checksum offload if enabled and present.
 	 */
 	if (csum_info && (net->features & NETIF_F_RXCSUM)) {
 		if (csum_info->receive.tcp_checksum_succeeded ||
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/phy/dp83867.c linux-libre-5.0-gnu/drivers/net/phy/dp83867.c
--- linux-libre-5.0-rc8-gnu/drivers/net/phy/dp83867.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/phy/dp83867.c	2019-03-03 18:21:29.000000000 -0500
@@ -19,6 +19,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/phy.h>
+#include <linux/delay.h>
 
 #include <dt-bindings/net/ti-dp83867.h>
 
@@ -325,6 +326,8 @@ static int dp83867_phy_reset(struct phy_
 	if (err < 0)
 		return err;
 
+	usleep_range(10, 20);
+
 	return dp83867_config_init(phydev);
 }
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/phy/micrel.c linux-libre-5.0-gnu/drivers/net/phy/micrel.c
--- linux-libre-5.0-rc8-gnu/drivers/net/phy/micrel.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/phy/micrel.c	2019-03-03 18:21:29.000000000 -0500
@@ -344,6 +344,17 @@ static int ksz8041_config_aneg(struct ph
 	return genphy_config_aneg(phydev);
 }
 
+static int ksz8061_config_init(struct phy_device *phydev)
+{
+	int ret;
+
+	ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_DEVID1, 0xB61A);
+	if (ret)
+		return ret;
+
+	return kszphy_config_init(phydev);
+}
+
 static int ksz9021_load_values_from_of(struct phy_device *phydev,
 				       const struct device_node *of_node,
 				       u16 reg,
@@ -1040,7 +1051,7 @@ static struct phy_driver ksphy_driver[]
 	.name		= "Micrel KSZ8061",
 	.phy_id_mask	= MICREL_PHY_ID_MASK,
 	.features	= PHY_BASIC_FEATURES,
-	.config_init	= kszphy_config_init,
+	.config_init	= ksz8061_config_init,
 	.ack_interrupt	= kszphy_ack_interrupt,
 	.config_intr	= kszphy_config_intr,
 	.suspend	= genphy_suspend,
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/phy/phylink.c linux-libre-5.0-gnu/drivers/net/phy/phylink.c
--- linux-libre-5.0-rc8-gnu/drivers/net/phy/phylink.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/phy/phylink.c	2019-03-03 18:21:29.000000000 -0500
@@ -320,6 +320,10 @@ static int phylink_get_mac_state(struct
 	linkmode_zero(state->lp_advertising);
 	state->interface = pl->link_config.interface;
 	state->an_enabled = pl->link_config.an_enabled;
+	state->speed = SPEED_UNKNOWN;
+	state->duplex = DUPLEX_UNKNOWN;
+	state->pause = MLO_PAUSE_NONE;
+	state->an_complete = 0;
 	state->link = 1;
 
 	return pl->ops->mac_link_state(ndev, state);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/tun.c linux-libre-5.0-gnu/drivers/net/tun.c
--- linux-libre-5.0-rc8-gnu/drivers/net/tun.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/tun.c	2019-03-03 18:21:29.000000000 -0500
@@ -2167,9 +2167,9 @@ static void *tun_ring_recv(struct tun_fi
 	}
 
 	add_wait_queue(&tfile->wq.wait, &wait);
-	current->state = TASK_INTERRUPTIBLE;
 
 	while (1) {
+		set_current_state(TASK_INTERRUPTIBLE);
 		ptr = ptr_ring_consume(&tfile->tx_ring);
 		if (ptr)
 			break;
@@ -2185,7 +2185,7 @@ static void *tun_ring_recv(struct tun_fi
 		schedule();
 	}
 
-	current->state = TASK_RUNNING;
+	__set_current_state(TASK_RUNNING);
 	remove_wait_queue(&tfile->wq.wait, &wait);
 
 out:
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/xen-netback/hash.c linux-libre-5.0-gnu/drivers/net/xen-netback/hash.c
--- linux-libre-5.0-rc8-gnu/drivers/net/xen-netback/hash.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/xen-netback/hash.c	2019-03-03 18:21:29.000000000 -0500
@@ -454,6 +454,8 @@ void xenvif_init_hash(struct xenvif *vif
 	if (xenvif_hash_cache_size == 0)
 		return;
 
+	BUG_ON(vif->hash.cache.count);
+
 	spin_lock_init(&vif->hash.cache.lock);
 	INIT_LIST_HEAD(&vif->hash.cache.list);
 }
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/xen-netback/interface.c linux-libre-5.0-gnu/drivers/net/xen-netback/interface.c
--- linux-libre-5.0-rc8-gnu/drivers/net/xen-netback/interface.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/xen-netback/interface.c	2019-03-03 18:21:29.000000000 -0500
@@ -153,6 +153,13 @@ static u16 xenvif_select_queue(struct ne
 {
 	struct xenvif *vif = netdev_priv(dev);
 	unsigned int size = vif->hash.size;
+	unsigned int num_queues;
+
+	/* If queues are not set up internally - always return 0
+	 * as the packet going to be dropped anyway */
+	num_queues = READ_ONCE(vif->num_queues);
+	if (num_queues < 1)
+		return 0;
 
 	if (vif->hash.alg == XEN_NETIF_CTRL_HASH_ALGORITHM_NONE)
 		return fallback(dev, skb, NULL) % dev->real_num_tx_queues;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/net/xen-netback/netback.c linux-libre-5.0-gnu/drivers/net/xen-netback/netback.c
--- linux-libre-5.0-rc8-gnu/drivers/net/xen-netback/netback.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/net/xen-netback/netback.c	2019-03-03 18:21:29.000000000 -0500
@@ -1072,11 +1072,6 @@ static int xenvif_handle_frag_list(struc
 		skb_frag_size_set(&frags[i], len);
 	}
 
-	/* Copied all the bits from the frag list -- free it. */
-	skb_frag_list_init(skb);
-	xenvif_skb_zerocopy_prepare(queue, nskb);
-	kfree_skb(nskb);
-
 	/* Release all the original (foreign) frags. */
 	for (f = 0; f < skb_shinfo(skb)->nr_frags; f++)
 		skb_frag_unref(skb, f);
@@ -1145,6 +1140,8 @@ static int xenvif_tx_submit(struct xenvi
 		xenvif_fill_frags(queue, skb);
 
 		if (unlikely(skb_has_frag_list(skb))) {
+			struct sk_buff *nskb = skb_shinfo(skb)->frag_list;
+			xenvif_skb_zerocopy_prepare(queue, nskb);
 			if (xenvif_handle_frag_list(queue, skb)) {
 				if (net_ratelimit())
 					netdev_err(queue->vif->dev,
@@ -1153,6 +1150,9 @@ static int xenvif_tx_submit(struct xenvi
 				kfree_skb(skb);
 				continue;
 			}
+			/* Copied all the bits from the frag list -- free it. */
+			skb_frag_list_init(skb);
+			kfree_skb(nskb);
 		}
 
 		skb->dev      = queue->vif->dev;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/scsi/3w-9xxx.c linux-libre-5.0-gnu/drivers/scsi/3w-9xxx.c
--- linux-libre-5.0-rc8-gnu/drivers/scsi/3w-9xxx.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/scsi/3w-9xxx.c	2019-03-03 18:21:29.000000000 -0500
@@ -2009,7 +2009,7 @@ static int twa_probe(struct pci_dev *pde
 	struct Scsi_Host *host = NULL;
 	TW_Device_Extension *tw_dev;
 	unsigned long mem_addr, mem_len;
-	int retval = -ENODEV;
+	int retval;
 
 	retval = pci_enable_device(pdev);
 	if (retval) {
@@ -2020,8 +2020,10 @@ static int twa_probe(struct pci_dev *pde
 	pci_set_master(pdev);
 	pci_try_set_mwi(pdev);
 
-	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
+	retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (retval)
+		retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (retval) {
 		TW_PRINTK(host, TW_DRIVER, 0x23, "Failed to set dma mask");
 		retval = -ENODEV;
 		goto out_disable_device;
@@ -2240,8 +2242,10 @@ static int twa_resume(struct pci_dev *pd
 	pci_set_master(pdev);
 	pci_try_set_mwi(pdev);
 
-	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
+	retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (retval)
+		retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (retval) {
 		TW_PRINTK(host, TW_DRIVER, 0x40, "Failed to set dma mask during resume");
 		retval = -ENODEV;
 		goto out_disable_device;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/scsi/3w-sas.c linux-libre-5.0-gnu/drivers/scsi/3w-sas.c
--- linux-libre-5.0-rc8-gnu/drivers/scsi/3w-sas.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/scsi/3w-sas.c	2019-03-03 18:21:29.000000000 -0500
@@ -1573,8 +1573,10 @@ static int twl_probe(struct pci_dev *pde
 	pci_set_master(pdev);
 	pci_try_set_mwi(pdev);
 
-	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
+	retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (retval)
+		retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (retval) {
 		TW_PRINTK(host, TW_DRIVER, 0x18, "Failed to set dma mask");
 		retval = -ENODEV;
 		goto out_disable_device;
@@ -1805,8 +1807,10 @@ static int twl_resume(struct pci_dev *pd
 	pci_set_master(pdev);
 	pci_try_set_mwi(pdev);
 
-	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
+	retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (retval)
+		retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (retval) {
 		TW_PRINTK(host, TW_DRIVER, 0x25, "Failed to set dma mask during resume");
 		retval = -ENODEV;
 		goto out_disable_device;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/scsi/aic94xx/aic94xx_init.c linux-libre-5.0-gnu/drivers/scsi/aic94xx/aic94xx_init.c
--- linux-libre-5.0-rc8-gnu/drivers/scsi/aic94xx/aic94xx_init.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/scsi/aic94xx/aic94xx_init.c	2019-03-03 18:21:29.000000000 -0500
@@ -769,9 +769,11 @@ static int asd_pci_probe(struct pci_dev
 	if (err)
 		goto Err_remove;
 
-	err = -ENODEV;
-	if (dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64)) ||
-	    dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32))) {
+	err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
+	if (err)
+		err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
+	if (err) {
+		err = -ENODEV;
 		asd_printk("no suitable DMA mask for %s\n", pci_name(dev));
 		goto Err_remove;
 	}
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/scsi/bfa/bfad.c linux-libre-5.0-gnu/drivers/scsi/bfa/bfad.c
--- linux-libre-5.0-rc8-gnu/drivers/scsi/bfa/bfad.c	2019-02-24 21:00:53.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/scsi/bfa/bfad.c	2019-03-03 21:23:30.000000000 -0500
@@ -725,7 +725,7 @@ bfad_init_timer(struct bfad_s *bfad)
 int
 bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad)
 {
-	int		rc = -ENODEV;
+	int rc = -ENODEV;
 
 	if (pci_enable_device(pdev)) {
 		printk(KERN_ERR "pci_enable_device fail %p\n", pdev);
@@ -737,8 +737,12 @@ bfad_pci_init(struct pci_dev *pdev, stru
 
 	pci_set_master(pdev);
 
-	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
+	rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (rc)
+		rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+
+	if (rc) {
+		rc = -ENODEV;
 		printk(KERN_ERR "dma_set_mask_and_coherent fail %p\n", pdev);
 		goto out_release_region;
 	}
@@ -1532,6 +1536,7 @@ bfad_pci_slot_reset(struct pci_dev *pdev
 {
 	struct bfad_s *bfad = pci_get_drvdata(pdev);
 	u8 byte;
+	int rc;
 
 	dev_printk(KERN_ERR, &pdev->dev,
 		   "bfad_pci_slot_reset flags: 0x%x\n", bfad->bfad_flags);
@@ -1559,8 +1564,11 @@ bfad_pci_slot_reset(struct pci_dev *pdev
 	pci_save_state(pdev);
 	pci_set_master(pdev);
 
-	if (dma_set_mask_and_coherent(&bfad->pcidev->dev, DMA_BIT_MASK(64)) ||
-	    dma_set_mask_and_coherent(&bfad->pcidev->dev, DMA_BIT_MASK(32)))
+	rc = dma_set_mask_and_coherent(&bfad->pcidev->dev, DMA_BIT_MASK(64));
+	if (rc)
+		rc = dma_set_mask_and_coherent(&bfad->pcidev->dev,
+					       DMA_BIT_MASK(32));
+	if (rc)
 		goto out_disable_device;
 
 	if (restart_bfa(bfad) == -1)
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/scsi/csiostor/csio_init.c linux-libre-5.0-gnu/drivers/scsi/csiostor/csio_init.c
--- linux-libre-5.0-rc8-gnu/drivers/scsi/csiostor/csio_init.c	2019-02-24 21:00:59.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/scsi/csiostor/csio_init.c	2019-03-03 21:23:36.000000000 -0500
@@ -210,8 +210,11 @@ csio_pci_init(struct pci_dev *pdev, int
 	pci_set_master(pdev);
 	pci_try_set_mwi(pdev);
 
-	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
+	rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (rv)
+		rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (rv) {
+		rv = -ENODEV;
 		dev_err(&pdev->dev, "No suitable DMA available.\n");
 		goto err_release_regions;
 	}
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/scsi/hisi_sas/hisi_sas_main.c linux-libre-5.0-gnu/drivers/scsi/hisi_sas/hisi_sas_main.c
--- linux-libre-5.0-rc8-gnu/drivers/scsi/hisi_sas/hisi_sas_main.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/scsi/hisi_sas/hisi_sas_main.c	2019-03-03 18:21:29.000000000 -0500
@@ -2323,6 +2323,7 @@ static struct Scsi_Host *hisi_sas_shost_
 	struct Scsi_Host *shost;
 	struct hisi_hba *hisi_hba;
 	struct device *dev = &pdev->dev;
+	int error;
 
 	shost = scsi_host_alloc(hw->sht, sizeof(*hisi_hba));
 	if (!shost) {
@@ -2343,8 +2344,11 @@ static struct Scsi_Host *hisi_sas_shost_
 	if (hisi_sas_get_fw_info(hisi_hba) < 0)
 		goto err_out;
 
-	if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)) &&
-	    dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32))) {
+	error = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
+	if (error)
+		error = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
+
+	if (error) {
 		dev_err(dev, "No usable DMA addressing method\n");
 		goto err_out;
 	}
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c linux-libre-5.0-gnu/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
--- linux-libre-5.0-rc8-gnu/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c	2019-03-03 18:21:29.000000000 -0500
@@ -2447,10 +2447,12 @@ hisi_sas_v3_probe(struct pci_dev *pdev,
 	if (rc)
 		goto err_out_disable_device;
 
-	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
+	rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (rc)
+		rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (rc) {
 		dev_err(dev, "No usable DMA addressing method\n");
-		rc = -EIO;
+		rc = -ENODEV;
 		goto err_out_regions;
 	}
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/scsi/hptiop.c linux-libre-5.0-gnu/drivers/scsi/hptiop.c
--- linux-libre-5.0-rc8-gnu/drivers/scsi/hptiop.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/scsi/hptiop.c	2019-03-03 18:21:29.000000000 -0500
@@ -1292,6 +1292,7 @@ static int hptiop_probe(struct pci_dev *
 	dma_addr_t start_phy;
 	void *start_virt;
 	u32 offset, i, req_size;
+	int rc;
 
 	dprintk("hptiop_probe(%p)\n", pcidev);
 
@@ -1308,9 +1309,12 @@ static int hptiop_probe(struct pci_dev *
 
 	/* Enable 64bit DMA if possible */
 	iop_ops = (struct hptiop_adapter_ops *)id->driver_data;
-	if (dma_set_mask(&pcidev->dev,
-			 DMA_BIT_MASK(iop_ops->hw_dma_bit_mask)) ||
-	    dma_set_mask(&pcidev->dev, DMA_BIT_MASK(32))) {
+	rc = dma_set_mask(&pcidev->dev,
+			  DMA_BIT_MASK(iop_ops->hw_dma_bit_mask));
+	if (rc)
+		rc = dma_set_mask(&pcidev->dev, DMA_BIT_MASK(32));
+
+	if (rc) {
 		printk(KERN_ERR "hptiop: fail to set dma_mask\n");
 		goto disable_pci_device;
 	}
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/scsi/lpfc/lpfc_init.c linux-libre-5.0-gnu/drivers/scsi/lpfc/lpfc_init.c
--- linux-libre-5.0-rc8-gnu/drivers/scsi/lpfc/lpfc_init.c	2019-02-24 21:00:59.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/scsi/lpfc/lpfc_init.c	2019-03-03 21:23:36.000000000 -0500
@@ -7361,15 +7361,18 @@ lpfc_sli_pci_mem_setup(struct lpfc_hba *
 	unsigned long bar0map_len, bar2map_len;
 	int i, hbq_count;
 	void *ptr;
-	int error = -ENODEV;
+	int error;
 
 	if (!pdev)
-		return error;
+		return -ENODEV;
 
 	/* Set the device DMA mask size */
-	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)))
+	error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (error)
+		error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (error)
 		return error;
+	error = -ENODEV;
 
 	/* Get the bus address of Bar0 and Bar2 and the number of bytes
 	 * required by each mapping.
@@ -9742,11 +9745,13 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba
 	uint32_t if_type;
 
 	if (!pdev)
-		return error;
+		return -ENODEV;
 
 	/* Set the device DMA mask size */
-	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-	    dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)))
+	error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (error)
+		error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (error)
 		return error;
 
 	/*
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/scsi/scsi_lib.c linux-libre-5.0-gnu/drivers/scsi/scsi_lib.c
--- linux-libre-5.0-rc8-gnu/drivers/scsi/scsi_lib.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/scsi/scsi_lib.c	2019-03-03 18:21:29.000000000 -0500
@@ -2598,7 +2598,6 @@ void scsi_device_resume(struct scsi_devi
 	 * device deleted during suspend)
 	 */
 	mutex_lock(&sdev->state_mutex);
-	WARN_ON_ONCE(!sdev->quiesced_by);
 	sdev->quiesced_by = NULL;
 	blk_clear_pm_only(sdev->request_queue);
 	if (sdev->sdev_state == SDEV_QUIESCE)
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/drivers/tee/optee/core.c linux-libre-5.0-gnu/drivers/tee/optee/core.c
--- linux-libre-5.0-rc8-gnu/drivers/tee/optee/core.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/drivers/tee/optee/core.c	2019-03-03 18:21:29.000000000 -0500
@@ -699,8 +699,10 @@ static int __init optee_driver_init(void
 		return -ENODEV;
 
 	np = of_find_matching_node(fw_np, optee_match);
-	if (!np || !of_device_is_available(np))
+	if (!np || !of_device_is_available(np)) {
+		of_node_put(np);
 		return -ENODEV;
+	}
 
 	optee = optee_probe(np);
 	of_node_put(np);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/fs/afs/cell.c linux-libre-5.0-gnu/fs/afs/cell.c
--- linux-libre-5.0-rc8-gnu/fs/afs/cell.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/fs/afs/cell.c	2019-03-03 18:21:29.000000000 -0500
@@ -173,6 +173,7 @@ static struct afs_cell *afs_alloc_cell(s
 
 		rcu_assign_pointer(cell->vl_servers, vllist);
 		cell->dns_expiry = TIME64_MAX;
+		__clear_bit(AFS_CELL_FL_NO_LOOKUP_YET, &cell->flags);
 	} else {
 		cell->dns_expiry = ktime_get_real_seconds();
 	}
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/fs/hugetlbfs/inode.c linux-libre-5.0-gnu/fs/hugetlbfs/inode.c
--- linux-libre-5.0-rc8-gnu/fs/hugetlbfs/inode.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/fs/hugetlbfs/inode.c	2019-03-03 18:21:29.000000000 -0500
@@ -859,6 +859,18 @@ static int hugetlbfs_migrate_page(struct
 	rc = migrate_huge_page_move_mapping(mapping, newpage, page);
 	if (rc != MIGRATEPAGE_SUCCESS)
 		return rc;
+
+	/*
+	 * page_private is subpool pointer in hugetlb pages.  Transfer to
+	 * new page.  PagePrivate is not associated with page_private for
+	 * hugetlb pages and can not be set here as only page_huge_active
+	 * pages can be migrated.
+	 */
+	if (page_private(page)) {
+		set_page_private(newpage, page_private(page));
+		set_page_private(page, 0);
+	}
+
 	if (mode != MIGRATE_SYNC_NO_COPY)
 		migrate_page_copy(newpage, page);
 	else
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/fs/namespace.c linux-libre-5.0-gnu/fs/namespace.c
--- linux-libre-5.0-rc8-gnu/fs/namespace.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/fs/namespace.c	2019-03-03 18:21:29.000000000 -0500
@@ -2698,7 +2698,6 @@ static long exact_copy_from_user(void *t
 	if (!access_ok(from, n))
 		return n;
 
-	current->kernel_uaccess_faults_ok++;
 	while (n) {
 		if (__get_user(c, f)) {
 			memset(t, 0, n);
@@ -2708,7 +2707,6 @@ static long exact_copy_from_user(void *t
 		f++;
 		n--;
 	}
-	current->kernel_uaccess_faults_ok--;
 	return n;
 }
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/fs/orangefs/file.c linux-libre-5.0-gnu/fs/orangefs/file.c
--- linux-libre-5.0-rc8-gnu/fs/orangefs/file.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/fs/orangefs/file.c	2019-03-03 18:21:29.000000000 -0500
@@ -398,8 +398,6 @@ static ssize_t orangefs_file_read_iter(s
 	loff_t pos = iocb->ki_pos;
 	ssize_t rc = 0;
 
-	BUG_ON(iocb->private);
-
 	gossip_debug(GOSSIP_FILE_DEBUG, "orangefs_file_read_iter\n");
 
 	orangefs_stats.reads++;
@@ -416,8 +414,6 @@ static ssize_t orangefs_file_write_iter(
 	loff_t pos;
 	ssize_t rc;
 
-	BUG_ON(iocb->private);
-
 	gossip_debug(GOSSIP_FILE_DEBUG, "orangefs_file_write_iter\n");
 
 	inode_lock(file->f_mapping->host);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/include/linux/netdevice.h linux-libre-5.0-gnu/include/linux/netdevice.h
--- linux-libre-5.0-rc8-gnu/include/linux/netdevice.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/include/linux/netdevice.h	2019-03-03 18:21:29.000000000 -0500
@@ -3861,7 +3861,7 @@ static inline u32 netif_msg_init(int deb
 	if (debug_value == 0)	/* no output */
 		return 0;
 	/* set low N bits */
-	return (1 << debug_value) - 1;
+	return (1U << debug_value) - 1;
 }
 
 static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu)
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/include/linux/sched.h linux-libre-5.0-gnu/include/linux/sched.h
--- linux-libre-5.0-rc8-gnu/include/linux/sched.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/include/linux/sched.h	2019-03-03 18:21:29.000000000 -0500
@@ -739,12 +739,6 @@ struct task_struct {
 	unsigned			use_memdelay:1;
 #endif
 
-	/*
-	 * May usercopy functions fault on kernel addresses?
-	 * This is not just a single bit because this can potentially nest.
-	 */
-	unsigned int			kernel_uaccess_faults_ok;
-
 	unsigned long			atomic_flags; /* Flags requiring atomic access. */
 
 	struct restart_block		restart_block;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/include/net/icmp.h linux-libre-5.0-gnu/include/net/icmp.h
--- linux-libre-5.0-rc8-gnu/include/net/icmp.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/include/net/icmp.h	2019-03-03 18:21:29.000000000 -0500
@@ -22,6 +22,7 @@
 
 #include <net/inet_sock.h>
 #include <net/snmp.h>
+#include <net/ip.h>
 
 struct icmp_err {
   int		errno;
@@ -39,7 +40,13 @@ struct net_proto_family;
 struct sk_buff;
 struct net;
 
-void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
+void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
+		 const struct ip_options *opt);
+static inline void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
+{
+	__icmp_send(skb_in, type, code, info, &IPCB(skb_in)->opt);
+}
+
 int icmp_rcv(struct sk_buff *skb);
 int icmp_err(struct sk_buff *skb, u32 info);
 int icmp_init(void);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/include/net/ip.h linux-libre-5.0-gnu/include/net/ip.h
--- linux-libre-5.0-rc8-gnu/include/net/ip.h	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/include/net/ip.h	2019-03-03 18:21:29.000000000 -0500
@@ -667,6 +667,8 @@ static inline int ip_options_echo(struct
 }
 
 void ip_options_fragment(struct sk_buff *skb);
+int __ip_options_compile(struct net *net, struct ip_options *opt,
+			 struct sk_buff *skb, __be32 *info);
 int ip_options_compile(struct net *net, struct ip_options *opt,
 		       struct sk_buff *skb);
 int ip_options_get(struct net *net, struct ip_options_rcu **optp,
@@ -716,7 +718,7 @@ extern int sysctl_icmp_msgs_burst;
 int ip_misc_proc_init(void);
 #endif
 
-int rtm_getroute_parse_ip_proto(struct nlattr *attr, u8 *ip_proto,
+int rtm_getroute_parse_ip_proto(struct nlattr *attr, u8 *ip_proto, u8 family,
 				struct netlink_ext_ack *extack);
 
 #endif	/* _IP_H */
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/kernel/bpf/syscall.c linux-libre-5.0-gnu/kernel/bpf/syscall.c
--- linux-libre-5.0-rc8-gnu/kernel/bpf/syscall.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/kernel/bpf/syscall.c	2019-03-03 18:21:29.000000000 -0500
@@ -559,12 +559,12 @@ static int map_create(union bpf_attr *at
 	err = bpf_map_new_fd(map, f_flags);
 	if (err < 0) {
 		/* failed to allocate fd.
-		 * bpf_map_put() is needed because the above
+		 * bpf_map_put_with_uref() is needed because the above
 		 * bpf_map_alloc_id() has published the map
 		 * to the userspace and the userspace may
 		 * have refcnt-ed it through BPF_MAP_GET_FD_BY_ID.
 		 */
-		bpf_map_put(map);
+		bpf_map_put_with_uref(map);
 		return err;
 	}
 
@@ -1986,7 +1986,7 @@ static int bpf_map_get_fd_by_id(const un
 
 	fd = bpf_map_new_fd(map, f_flags);
 	if (fd < 0)
-		bpf_map_put(map);
+		bpf_map_put_with_uref(map);
 
 	return fd;
 }
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/kernel/bpf/verifier.c linux-libre-5.0-gnu/kernel/bpf/verifier.c
--- linux-libre-5.0-rc8-gnu/kernel/bpf/verifier.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/kernel/bpf/verifier.c	2019-03-03 18:21:29.000000000 -0500
@@ -6920,7 +6920,8 @@ static int fixup_bpf_calls(struct bpf_ve
 			u32 off_reg;
 
 			aux = &env->insn_aux_data[i + delta];
-			if (!aux->alu_state)
+			if (!aux->alu_state ||
+			    aux->alu_state == BPF_ALU_NON_POINTER)
 				continue;
 
 			isneg = aux->alu_state & BPF_ALU_NEG_VALUE;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/lib/Kconfig.kasan linux-libre-5.0-gnu/lib/Kconfig.kasan
--- linux-libre-5.0-rc8-gnu/lib/Kconfig.kasan	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/lib/Kconfig.kasan	2019-03-03 18:21:29.000000000 -0500
@@ -113,6 +113,28 @@ config KASAN_INLINE
 
 endchoice
 
+config KASAN_STACK_ENABLE
+	bool "Enable stack instrumentation (unsafe)" if CC_IS_CLANG && !COMPILE_TEST
+	default !(CLANG_VERSION < 90000)
+	depends on KASAN
+	help
+	  The LLVM stack address sanitizer has a know problem that
+	  causes excessive stack usage in a lot of functions, see
+	  https://bugs.llvm.org/show_bug.cgi?id=38809
+	  Disabling asan-stack makes it safe to run kernels build
+	  with clang-8 with KASAN enabled, though it loses some of
+	  the functionality.
+	  This feature is always disabled when compile-testing with clang-8
+	  or earlier to avoid cluttering the output in stack overflow
+	  warnings, but clang-8 users can still enable it for builds without
+	  CONFIG_COMPILE_TEST.  On gcc and later clang versions it is
+	  assumed to always be safe to use and enabled by default.
+
+config KASAN_STACK
+	int
+	default 1 if KASAN_STACK_ENABLE || CC_IS_GCC
+	default 0
+
 config KASAN_S390_4_LEVEL_PAGING
 	bool "KASan: use 4-level paging"
 	depends on KASAN && S390
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/Makefile linux-libre-5.0-gnu/Makefile
--- linux-libre-5.0-rc8-gnu/Makefile	2019-02-24 20:36:05.000000000 -0500
+++ linux-libre-5.0-gnu/Makefile	2019-03-03 20:59:12.000000000 -0500
@@ -2,7 +2,7 @@
 VERSION = 5
 PATCHLEVEL = 0
 SUBLEVEL = 0
-EXTRAVERSION = -rc8-gnu
+EXTRAVERSION = -gnu
 NAME = Shy Crocodile
 
 # *DOCUMENTATION*
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/mm/hugetlb.c linux-libre-5.0-gnu/mm/hugetlb.c
--- linux-libre-5.0-rc8-gnu/mm/hugetlb.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/mm/hugetlb.c	2019-03-03 18:21:29.000000000 -0500
@@ -3624,7 +3624,6 @@ retry_avoidcopy:
 	copy_user_huge_page(new_page, old_page, address, vma,
 			    pages_per_huge_page(h));
 	__SetPageUptodate(new_page);
-	set_page_huge_active(new_page);
 
 	mmu_notifier_range_init(&range, mm, haddr, haddr + huge_page_size(h));
 	mmu_notifier_invalidate_range_start(&range);
@@ -3645,6 +3644,7 @@ retry_avoidcopy:
 				make_huge_pte(vma, new_page, 1));
 		page_remove_rmap(old_page, true);
 		hugepage_add_new_anon_rmap(new_page, vma, haddr);
+		set_page_huge_active(new_page);
 		/* Make the old page be freed below */
 		new_page = old_page;
 	}
@@ -3729,6 +3729,7 @@ static vm_fault_t hugetlb_no_page(struct
 	pte_t new_pte;
 	spinlock_t *ptl;
 	unsigned long haddr = address & huge_page_mask(h);
+	bool new_page = false;
 
 	/*
 	 * Currently, we are forced to kill the process in the event the
@@ -3790,7 +3791,7 @@ retry:
 		}
 		clear_huge_page(page, address, pages_per_huge_page(h));
 		__SetPageUptodate(page);
-		set_page_huge_active(page);
+		new_page = true;
 
 		if (vma->vm_flags & VM_MAYSHARE) {
 			int err = huge_add_to_page_cache(page, mapping, idx);
@@ -3861,6 +3862,15 @@ retry:
 	}
 
 	spin_unlock(ptl);
+
+	/*
+	 * Only make newly allocated pages active.  Existing pages found
+	 * in the pagecache could be !page_huge_active() if they have been
+	 * isolated for migration.
+	 */
+	if (new_page)
+		set_page_huge_active(page);
+
 	unlock_page(page);
 out:
 	return ret;
@@ -4095,7 +4105,6 @@ int hugetlb_mcopy_atomic_pte(struct mm_s
 	 * the set_pte_at() write.
 	 */
 	__SetPageUptodate(page);
-	set_page_huge_active(page);
 
 	mapping = dst_vma->vm_file->f_mapping;
 	idx = vma_hugecache_offset(h, dst_vma, dst_addr);
@@ -4163,6 +4172,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_s
 	update_mmu_cache(dst_vma, dst_addr, dst_pte);
 
 	spin_unlock(ptl);
+	set_page_huge_active(page);
 	if (vm_shared)
 		unlock_page(page);
 	ret = 0;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/mm/maccess.c linux-libre-5.0-gnu/mm/maccess.c
--- linux-libre-5.0-rc8-gnu/mm/maccess.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/mm/maccess.c	2019-03-03 18:21:29.000000000 -0500
@@ -30,10 +30,8 @@ long __probe_kernel_read(void *dst, cons
 
 	set_fs(KERNEL_DS);
 	pagefault_disable();
-	current->kernel_uaccess_faults_ok++;
 	ret = __copy_from_user_inatomic(dst,
 			(__force const void __user *)src, size);
-	current->kernel_uaccess_faults_ok--;
 	pagefault_enable();
 	set_fs(old_fs);
 
@@ -60,9 +58,7 @@ long __probe_kernel_write(void *dst, con
 
 	set_fs(KERNEL_DS);
 	pagefault_disable();
-	current->kernel_uaccess_faults_ok++;
 	ret = __copy_to_user_inatomic((__force void __user *)dst, src, size);
-	current->kernel_uaccess_faults_ok--;
 	pagefault_enable();
 	set_fs(old_fs);
 
@@ -98,13 +94,11 @@ long strncpy_from_unsafe(char *dst, cons
 
 	set_fs(KERNEL_DS);
 	pagefault_disable();
-	current->kernel_uaccess_faults_ok++;
 
 	do {
 		ret = __get_user(*dst++, (const char __user __force *)src++);
 	} while (dst[-1] && ret == 0 && src - unsafe_addr < count);
 
-	current->kernel_uaccess_faults_ok--;
 	dst[-1] = '\0';
 	pagefault_enable();
 	set_fs(old_fs);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/mm/migrate.c linux-libre-5.0-gnu/mm/migrate.c
--- linux-libre-5.0-rc8-gnu/mm/migrate.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/mm/migrate.c	2019-03-03 18:21:29.000000000 -0500
@@ -1315,6 +1315,16 @@ static int unmap_and_move_huge_page(new_
 		lock_page(hpage);
 	}
 
+	/*
+	 * Check for pages which are in the process of being freed.  Without
+	 * page_mapping() set, hugetlbfs specific move page routine will not
+	 * be called and we could leak usage counts for subpools.
+	 */
+	if (page_private(hpage) && !page_mapping(hpage)) {
+		rc = -EBUSY;
+		goto out_unlock;
+	}
+
 	if (PageAnon(hpage))
 		anon_vma = page_get_anon_vma(hpage);
 
@@ -1345,6 +1355,7 @@ put_anon:
 		put_new_page = NULL;
 	}
 
+out_unlock:
 	unlock_page(hpage);
 out:
 	if (rc != -EAGAIN)
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/mm/mmap.c linux-libre-5.0-gnu/mm/mmap.c
--- linux-libre-5.0-rc8-gnu/mm/mmap.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/mm/mmap.c	2019-03-03 18:21:29.000000000 -0500
@@ -2426,12 +2426,11 @@ int expand_downwards(struct vm_area_stru
 {
 	struct mm_struct *mm = vma->vm_mm;
 	struct vm_area_struct *prev;
-	int error;
+	int error = 0;
 
 	address &= PAGE_MASK;
-	error = security_mmap_addr(address);
-	if (error)
-		return error;
+	if (address < mmap_min_addr)
+		return -EPERM;
 
 	/* Enforce stack_guard_gap */
 	prev = vma->vm_prev;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/mm/shmem.c linux-libre-5.0-gnu/mm/shmem.c
--- linux-libre-5.0-rc8-gnu/mm/shmem.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/mm/shmem.c	2019-03-03 18:21:29.000000000 -0500
@@ -2848,7 +2848,7 @@ static int shmem_create(struct inode *di
 static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
 {
 	struct inode *inode = d_inode(old_dentry);
-	int ret;
+	int ret = 0;
 
 	/*
 	 * No ordinary (disk based) filesystem counts links as inodes;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/dsa/dsa2.c linux-libre-5.0-gnu/net/dsa/dsa2.c
--- linux-libre-5.0-rc8-gnu/net/dsa/dsa2.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/dsa/dsa2.c	2019-03-03 18:21:29.000000000 -0500
@@ -612,8 +612,8 @@ static int dsa_switch_parse_ports_of(str
 {
 	struct device_node *ports, *port;
 	struct dsa_port *dp;
+	int err = 0;
 	u32 reg;
-	int err;
 
 	ports = of_get_child_by_name(dn, "ports");
 	if (!ports) {
@@ -624,19 +624,23 @@ static int dsa_switch_parse_ports_of(str
 	for_each_available_child_of_node(ports, port) {
 		err = of_property_read_u32(port, "reg", &reg);
 		if (err)
-			return err;
+			goto out_put_node;
 
-		if (reg >= ds->num_ports)
-			return -EINVAL;
+		if (reg >= ds->num_ports) {
+			err = -EINVAL;
+			goto out_put_node;
+		}
 
 		dp = &ds->ports[reg];
 
 		err = dsa_port_parse_of(dp, port);
 		if (err)
-			return err;
+			goto out_put_node;
 	}
 
-	return 0;
+out_put_node:
+	of_node_put(ports);
+	return err;
 }
 
 static int dsa_switch_parse_member_of(struct dsa_switch *ds,
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/dsa/port.c linux-libre-5.0-gnu/net/dsa/port.c
--- linux-libre-5.0-rc8-gnu/net/dsa/port.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/dsa/port.c	2019-03-03 18:21:29.000000000 -0500
@@ -292,6 +292,7 @@ static struct phy_device *dsa_port_get_p
 		return ERR_PTR(-EPROBE_DEFER);
 	}
 
+	of_node_put(phy_dn);
 	return phydev;
 }
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/ipv4/cipso_ipv4.c linux-libre-5.0-gnu/net/ipv4/cipso_ipv4.c
--- linux-libre-5.0-rc8-gnu/net/ipv4/cipso_ipv4.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/ipv4/cipso_ipv4.c	2019-03-03 18:21:29.000000000 -0500
@@ -667,7 +667,8 @@ static int cipso_v4_map_lvl_valid(const
 	case CIPSO_V4_MAP_PASS:
 		return 0;
 	case CIPSO_V4_MAP_TRANS:
-		if (doi_def->map.std->lvl.cipso[level] < CIPSO_V4_INV_LVL)
+		if ((level < doi_def->map.std->lvl.cipso_size) &&
+		    (doi_def->map.std->lvl.cipso[level] < CIPSO_V4_INV_LVL))
 			return 0;
 		break;
 	}
@@ -1735,13 +1736,26 @@ validate_return:
  */
 void cipso_v4_error(struct sk_buff *skb, int error, u32 gateway)
 {
+	unsigned char optbuf[sizeof(struct ip_options) + 40];
+	struct ip_options *opt = (struct ip_options *)optbuf;
+
 	if (ip_hdr(skb)->protocol == IPPROTO_ICMP || error != -EACCES)
 		return;
 
+	/*
+	 * We might be called above the IP layer,
+	 * so we can not use icmp_send and IPCB here.
+	 */
+
+	memset(opt, 0, sizeof(struct ip_options));
+	opt->optlen = ip_hdr(skb)->ihl*4 - sizeof(struct iphdr);
+	if (__ip_options_compile(dev_net(skb->dev), opt, skb, NULL))
+		return;
+
 	if (gateway)
-		icmp_send(skb, ICMP_DEST_UNREACH, ICMP_NET_ANO, 0);
+		__icmp_send(skb, ICMP_DEST_UNREACH, ICMP_NET_ANO, 0, opt);
 	else
-		icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_ANO, 0);
+		__icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_ANO, 0, opt);
 }
 
 /**
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/ipv4/fib_frontend.c linux-libre-5.0-gnu/net/ipv4/fib_frontend.c
--- linux-libre-5.0-rc8-gnu/net/ipv4/fib_frontend.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/ipv4/fib_frontend.c	2019-03-03 18:21:29.000000000 -0500
@@ -710,6 +710,10 @@ static int rtm_to_fib_config(struct net
 		case RTA_GATEWAY:
 			cfg->fc_gw = nla_get_be32(attr);
 			break;
+		case RTA_VIA:
+			NL_SET_ERR_MSG(extack, "IPv4 does not support RTA_VIA attribute");
+			err = -EINVAL;
+			goto errout;
 		case RTA_PRIORITY:
 			cfg->fc_priority = nla_get_u32(attr);
 			break;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/ipv4/icmp.c linux-libre-5.0-gnu/net/ipv4/icmp.c
--- linux-libre-5.0-rc8-gnu/net/ipv4/icmp.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/ipv4/icmp.c	2019-03-03 18:21:29.000000000 -0500
@@ -570,7 +570,8 @@ relookup_failed:
  *			MUST reply to only the first fragment.
  */
 
-void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
+void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
+		 const struct ip_options *opt)
 {
 	struct iphdr *iph;
 	int room;
@@ -691,7 +692,7 @@ void icmp_send(struct sk_buff *skb_in, i
 					  iph->tos;
 	mark = IP4_REPLY_MARK(net, skb_in->mark);
 
-	if (ip_options_echo(net, &icmp_param.replyopts.opt.opt, skb_in))
+	if (__ip_options_echo(net, &icmp_param.replyopts.opt.opt, skb_in, opt))
 		goto out_unlock;
 
 
@@ -742,7 +743,7 @@ out_bh_enable:
 	local_bh_enable();
 out:;
 }
-EXPORT_SYMBOL(icmp_send);
+EXPORT_SYMBOL(__icmp_send);
 
 
 static void icmp_socket_deliver(struct sk_buff *skb, u32 info)
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/ipv4/ip_input.c linux-libre-5.0-gnu/net/ipv4/ip_input.c
--- linux-libre-5.0-rc8-gnu/net/ipv4/ip_input.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/ipv4/ip_input.c	2019-03-03 18:21:29.000000000 -0500
@@ -307,11 +307,10 @@ drop:
 }
 
 static int ip_rcv_finish_core(struct net *net, struct sock *sk,
-			      struct sk_buff *skb)
+			      struct sk_buff *skb, struct net_device *dev)
 {
 	const struct iphdr *iph = ip_hdr(skb);
 	int (*edemux)(struct sk_buff *skb);
-	struct net_device *dev = skb->dev;
 	struct rtable *rt;
 	int err;
 
@@ -400,6 +399,7 @@ drop_error:
 
 static int ip_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
 {
+	struct net_device *dev = skb->dev;
 	int ret;
 
 	/* if ingress device is enslaved to an L3 master device pass the
@@ -409,7 +409,7 @@ static int ip_rcv_finish(struct net *net
 	if (!skb)
 		return NET_RX_SUCCESS;
 
-	ret = ip_rcv_finish_core(net, sk, skb);
+	ret = ip_rcv_finish_core(net, sk, skb, dev);
 	if (ret != NET_RX_DROP)
 		ret = dst_input(skb);
 	return ret;
@@ -545,6 +545,7 @@ static void ip_list_rcv_finish(struct ne
 
 	INIT_LIST_HEAD(&sublist);
 	list_for_each_entry_safe(skb, next, head, list) {
+		struct net_device *dev = skb->dev;
 		struct dst_entry *dst;
 
 		skb_list_del_init(skb);
@@ -554,7 +555,7 @@ static void ip_list_rcv_finish(struct ne
 		skb = l3mdev_ip_rcv(skb);
 		if (!skb)
 			continue;
-		if (ip_rcv_finish_core(net, sk, skb) == NET_RX_DROP)
+		if (ip_rcv_finish_core(net, sk, skb, dev) == NET_RX_DROP)
 			continue;
 
 		dst = skb_dst(skb);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/ipv4/ip_options.c linux-libre-5.0-gnu/net/ipv4/ip_options.c
--- linux-libre-5.0-rc8-gnu/net/ipv4/ip_options.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/ipv4/ip_options.c	2019-03-03 18:21:29.000000000 -0500
@@ -251,8 +251,9 @@ static void spec_dst_fill(__be32 *spec_d
  * If opt == NULL, then skb->data should point to IP header.
  */
 
-int ip_options_compile(struct net *net,
-		       struct ip_options *opt, struct sk_buff *skb)
+int __ip_options_compile(struct net *net,
+			 struct ip_options *opt, struct sk_buff *skb,
+			 __be32 *info)
 {
 	__be32 spec_dst = htonl(INADDR_ANY);
 	unsigned char *pp_ptr = NULL;
@@ -468,11 +469,22 @@ eol:
 		return 0;
 
 error:
-	if (skb) {
-		icmp_send(skb, ICMP_PARAMETERPROB, 0, htonl((pp_ptr-iph)<<24));
-	}
+	if (info)
+		*info = htonl((pp_ptr-iph)<<24);
 	return -EINVAL;
 }
+
+int ip_options_compile(struct net *net,
+		       struct ip_options *opt, struct sk_buff *skb)
+{
+	int ret;
+	__be32 info;
+
+	ret = __ip_options_compile(net, opt, skb, &info);
+	if (ret != 0 && skb)
+		icmp_send(skb, ICMP_PARAMETERPROB, 0, info);
+	return ret;
+}
 EXPORT_SYMBOL(ip_options_compile);
 
 /*
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/ipv4/netlink.c linux-libre-5.0-gnu/net/ipv4/netlink.c
--- linux-libre-5.0-rc8-gnu/net/ipv4/netlink.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/ipv4/netlink.c	2019-03-03 18:21:29.000000000 -0500
@@ -3,9 +3,10 @@
 #include <linux/types.h>
 #include <net/net_namespace.h>
 #include <net/netlink.h>
+#include <linux/in6.h>
 #include <net/ip.h>
 
-int rtm_getroute_parse_ip_proto(struct nlattr *attr, u8 *ip_proto,
+int rtm_getroute_parse_ip_proto(struct nlattr *attr, u8 *ip_proto, u8 family,
 				struct netlink_ext_ack *extack)
 {
 	*ip_proto = nla_get_u8(attr);
@@ -13,11 +14,19 @@ int rtm_getroute_parse_ip_proto(struct n
 	switch (*ip_proto) {
 	case IPPROTO_TCP:
 	case IPPROTO_UDP:
+		return 0;
 	case IPPROTO_ICMP:
+		if (family != AF_INET)
+			break;
 		return 0;
-	default:
-		NL_SET_ERR_MSG(extack, "Unsupported ip proto");
-		return -EOPNOTSUPP;
+#if IS_ENABLED(CONFIG_IPV6)
+	case IPPROTO_ICMPV6:
+		if (family != AF_INET6)
+			break;
+		return 0;
+#endif
 	}
+	NL_SET_ERR_MSG(extack, "Unsupported ip proto");
+	return -EOPNOTSUPP;
 }
 EXPORT_SYMBOL_GPL(rtm_getroute_parse_ip_proto);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/ipv4/route.c linux-libre-5.0-gnu/net/ipv4/route.c
--- linux-libre-5.0-rc8-gnu/net/ipv4/route.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/ipv4/route.c	2019-03-03 18:21:29.000000000 -0500
@@ -2803,7 +2803,7 @@ static int inet_rtm_getroute(struct sk_b
 
 	if (tb[RTA_IP_PROTO]) {
 		err = rtm_getroute_parse_ip_proto(tb[RTA_IP_PROTO],
-						  &ip_proto, extack);
+						  &ip_proto, AF_INET, extack);
 		if (err)
 			return err;
 	}
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/ipv6/route.c linux-libre-5.0-gnu/net/ipv6/route.c
--- linux-libre-5.0-rc8-gnu/net/ipv6/route.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/ipv6/route.c	2019-03-03 18:21:29.000000000 -0500
@@ -4182,6 +4182,10 @@ static int rtm_to_fib6_config(struct sk_
 		cfg->fc_gateway = nla_get_in6_addr(tb[RTA_GATEWAY]);
 		cfg->fc_flags |= RTF_GATEWAY;
 	}
+	if (tb[RTA_VIA]) {
+		NL_SET_ERR_MSG(extack, "IPv6 does not support RTA_VIA attribute");
+		goto errout;
+	}
 
 	if (tb[RTA_DST]) {
 		int plen = (rtm->rtm_dst_len + 7) >> 3;
@@ -4889,7 +4893,8 @@ static int inet6_rtm_getroute(struct sk_
 
 	if (tb[RTA_IP_PROTO]) {
 		err = rtm_getroute_parse_ip_proto(tb[RTA_IP_PROTO],
-						  &fl6.flowi6_proto, extack);
+						  &fl6.flowi6_proto, AF_INET6,
+						  extack);
 		if (err)
 			goto errout;
 	}
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/ipv6/sit.c linux-libre-5.0-gnu/net/ipv6/sit.c
--- linux-libre-5.0-rc8-gnu/net/ipv6/sit.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/ipv6/sit.c	2019-03-03 18:21:29.000000000 -0500
@@ -1873,6 +1873,7 @@ static int __net_init sit_init_net(struc
 
 err_reg_dev:
 	ipip6_dev_free(sitn->fb_tunnel_dev);
+	free_netdev(sitn->fb_tunnel_dev);
 err_alloc_dev:
 	return err;
 }
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/mpls/af_mpls.c linux-libre-5.0-gnu/net/mpls/af_mpls.c
--- linux-libre-5.0-rc8-gnu/net/mpls/af_mpls.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/mpls/af_mpls.c	2019-03-03 18:21:29.000000000 -0500
@@ -1838,6 +1838,9 @@ static int rtm_to_route_config(struct sk
 				goto errout;
 			break;
 		}
+		case RTA_GATEWAY:
+			NL_SET_ERR_MSG(extack, "MPLS does not support RTA_GATEWAY attribute");
+			goto errout;
 		case RTA_VIA:
 		{
 			if (nla_get_via(nla, &cfg->rc_via_alen,
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/netlabel/netlabel_kapi.c linux-libre-5.0-gnu/net/netlabel/netlabel_kapi.c
--- linux-libre-5.0-rc8-gnu/net/netlabel/netlabel_kapi.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/netlabel/netlabel_kapi.c	2019-03-03 18:21:29.000000000 -0500
@@ -903,7 +903,8 @@ int netlbl_bitmap_walk(const unsigned ch
 		    (state == 0 && (byte & bitmask) == 0))
 			return bit_spot;
 
-		bit_spot++;
+		if (++bit_spot >= bitmap_len)
+			return -1;
 		bitmask >>= 1;
 		if (bitmask == 0) {
 			byte = bitmap[++byte_offset];
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/nfc/llcp_commands.c linux-libre-5.0-gnu/net/nfc/llcp_commands.c
--- linux-libre-5.0-rc8-gnu/net/nfc/llcp_commands.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/nfc/llcp_commands.c	2019-03-03 18:21:29.000000000 -0500
@@ -419,6 +419,10 @@ int nfc_llcp_send_connect(struct nfc_llc
 						      sock->service_name,
 						      sock->service_name_len,
 						      &service_name_tlv_length);
+		if (!service_name_tlv) {
+			err = -ENOMEM;
+			goto error_tlv;
+		}
 		size += service_name_tlv_length;
 	}
 
@@ -429,9 +433,17 @@ int nfc_llcp_send_connect(struct nfc_llc
 
 	miux_tlv = nfc_llcp_build_tlv(LLCP_TLV_MIUX, (u8 *)&miux, 0,
 				      &miux_tlv_length);
+	if (!miux_tlv) {
+		err = -ENOMEM;
+		goto error_tlv;
+	}
 	size += miux_tlv_length;
 
 	rw_tlv = nfc_llcp_build_tlv(LLCP_TLV_RW, &rw, 0, &rw_tlv_length);
+	if (!rw_tlv) {
+		err = -ENOMEM;
+		goto error_tlv;
+	}
 	size += rw_tlv_length;
 
 	pr_debug("SKB size %d SN length %zu\n", size, sock->service_name_len);
@@ -484,9 +496,17 @@ int nfc_llcp_send_cc(struct nfc_llcp_soc
 
 	miux_tlv = nfc_llcp_build_tlv(LLCP_TLV_MIUX, (u8 *)&miux, 0,
 				      &miux_tlv_length);
+	if (!miux_tlv) {
+		err = -ENOMEM;
+		goto error_tlv;
+	}
 	size += miux_tlv_length;
 
 	rw_tlv = nfc_llcp_build_tlv(LLCP_TLV_RW, &rw, 0, &rw_tlv_length);
+	if (!rw_tlv) {
+		err = -ENOMEM;
+		goto error_tlv;
+	}
 	size += rw_tlv_length;
 
 	skb = llcp_allocate_pdu(sock, LLCP_PDU_CC, size);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/nfc/llcp_core.c linux-libre-5.0-gnu/net/nfc/llcp_core.c
--- linux-libre-5.0-rc8-gnu/net/nfc/llcp_core.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/nfc/llcp_core.c	2019-03-03 18:21:29.000000000 -0500
@@ -532,10 +532,10 @@ static u8 nfc_llcp_reserve_sdp_ssap(stru
 
 static int nfc_llcp_build_gb(struct nfc_llcp_local *local)
 {
-	u8 *gb_cur, *version_tlv, version, version_length;
-	u8 *lto_tlv, lto_length;
-	u8 *wks_tlv, wks_length;
-	u8 *miux_tlv, miux_length;
+	u8 *gb_cur, version, version_length;
+	u8 lto_length, wks_length, miux_length;
+	u8 *version_tlv = NULL, *lto_tlv = NULL,
+	   *wks_tlv = NULL, *miux_tlv = NULL;
 	__be16 wks = cpu_to_be16(local->local_wks);
 	u8 gb_len = 0;
 	int ret = 0;
@@ -543,17 +543,33 @@ static int nfc_llcp_build_gb(struct nfc_
 	version = LLCP_VERSION_11;
 	version_tlv = nfc_llcp_build_tlv(LLCP_TLV_VERSION, &version,
 					 1, &version_length);
+	if (!version_tlv) {
+		ret = -ENOMEM;
+		goto out;
+	}
 	gb_len += version_length;
 
 	lto_tlv = nfc_llcp_build_tlv(LLCP_TLV_LTO, &local->lto, 1, &lto_length);
+	if (!lto_tlv) {
+		ret = -ENOMEM;
+		goto out;
+	}
 	gb_len += lto_length;
 
 	pr_debug("Local wks 0x%lx\n", local->local_wks);
 	wks_tlv = nfc_llcp_build_tlv(LLCP_TLV_WKS, (u8 *)&wks, 2, &wks_length);
+	if (!wks_tlv) {
+		ret = -ENOMEM;
+		goto out;
+	}
 	gb_len += wks_length;
 
 	miux_tlv = nfc_llcp_build_tlv(LLCP_TLV_MIUX, (u8 *)&local->miux, 0,
 				      &miux_length);
+	if (!miux_tlv) {
+		ret = -ENOMEM;
+		goto out;
+	}
 	gb_len += miux_length;
 
 	gb_len += ARRAY_SIZE(llcp_magic);
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/sched/act_ipt.c linux-libre-5.0-gnu/net/sched/act_ipt.c
--- linux-libre-5.0-rc8-gnu/net/sched/act_ipt.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/sched/act_ipt.c	2019-03-03 18:21:29.000000000 -0500
@@ -199,8 +199,7 @@ err3:
 err2:
 	kfree(tname);
 err1:
-	if (ret == ACT_P_CREATED)
-		tcf_idr_release(*a, bind);
+	tcf_idr_release(*a, bind);
 	return err;
 }
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/sched/act_skbedit.c linux-libre-5.0-gnu/net/sched/act_skbedit.c
--- linux-libre-5.0-rc8-gnu/net/sched/act_skbedit.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/sched/act_skbedit.c	2019-03-03 18:21:29.000000000 -0500
@@ -189,8 +189,7 @@ static int tcf_skbedit_init(struct net *
 
 	params_new = kzalloc(sizeof(*params_new), GFP_KERNEL);
 	if (unlikely(!params_new)) {
-		if (ret == ACT_P_CREATED)
-			tcf_idr_release(*a, bind);
+		tcf_idr_release(*a, bind);
 		return -ENOMEM;
 	}
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/sched/act_tunnel_key.c linux-libre-5.0-gnu/net/sched/act_tunnel_key.c
--- linux-libre-5.0-rc8-gnu/net/sched/act_tunnel_key.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/sched/act_tunnel_key.c	2019-03-03 18:21:29.000000000 -0500
@@ -377,7 +377,8 @@ static int tunnel_key_init(struct net *n
 	return ret;
 
 release_tun_meta:
-	dst_release(&metadata->dst);
+	if (metadata)
+		dst_release(&metadata->dst);
 
 err_out:
 	if (exists)
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/sched/sch_netem.c linux-libre-5.0-gnu/net/sched/sch_netem.c
--- linux-libre-5.0-rc8-gnu/net/sched/sch_netem.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/sched/sch_netem.c	2019-03-03 18:21:29.000000000 -0500
@@ -447,6 +447,7 @@ static int netem_enqueue(struct sk_buff
 	int nb = 0;
 	int count = 1;
 	int rc = NET_XMIT_SUCCESS;
+	int rc_drop = NET_XMIT_DROP;
 
 	/* Do not fool qdisc_drop_all() */
 	skb->prev = NULL;
@@ -486,6 +487,7 @@ static int netem_enqueue(struct sk_buff
 		q->duplicate = 0;
 		rootq->enqueue(skb2, rootq, to_free);
 		q->duplicate = dupsave;
+		rc_drop = NET_XMIT_SUCCESS;
 	}
 
 	/*
@@ -498,7 +500,7 @@ static int netem_enqueue(struct sk_buff
 		if (skb_is_gso(skb)) {
 			segs = netem_segment(skb, sch, to_free);
 			if (!segs)
-				return NET_XMIT_DROP;
+				return rc_drop;
 		} else {
 			segs = skb;
 		}
@@ -521,8 +523,10 @@ static int netem_enqueue(struct sk_buff
 			1<<(prandom_u32() % 8);
 	}
 
-	if (unlikely(sch->q.qlen >= sch->limit))
-		return qdisc_drop_all(skb, sch, to_free);
+	if (unlikely(sch->q.qlen >= sch->limit)) {
+		qdisc_drop_all(skb, sch, to_free);
+		return rc_drop;
+	}
 
 	qdisc_qstats_backlog_inc(sch, skb);
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/sctp/chunk.c linux-libre-5.0-gnu/net/sctp/chunk.c
--- linux-libre-5.0-rc8-gnu/net/sctp/chunk.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/sctp/chunk.c	2019-03-03 18:21:29.000000000 -0500
@@ -192,7 +192,7 @@ struct sctp_datamsg *sctp_datamsg_from_u
 	if (unlikely(!max_data)) {
 		max_data = sctp_min_frag_point(sctp_sk(asoc->base.sk),
 					       sctp_datachk_len(&asoc->stream));
-		pr_warn_ratelimited("%s: asoc:%p frag_point is zero, forcing max_data to default minimum (%Zu)",
+		pr_warn_ratelimited("%s: asoc:%p frag_point is zero, forcing max_data to default minimum (%zu)",
 				    __func__, asoc, max_data);
 	}
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/socket.c linux-libre-5.0-gnu/net/socket.c
--- linux-libre-5.0-rc8-gnu/net/socket.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/socket.c	2019-03-03 18:21:29.000000000 -0500
@@ -577,6 +577,7 @@ static void __sock_release(struct socket
 		if (inode)
 			inode_lock(inode);
 		sock->ops->release(sock);
+		sock->sk = NULL;
 		if (inode)
 			inode_unlock(inode);
 		sock->ops = NULL;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/net/tipc/socket.c linux-libre-5.0-gnu/net/tipc/socket.c
--- linux-libre-5.0-rc8-gnu/net/tipc/socket.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/net/tipc/socket.c	2019-03-03 18:21:29.000000000 -0500
@@ -379,11 +379,13 @@ static int tipc_sk_sock_err(struct socke
 
 #define tipc_wait_for_cond(sock_, timeo_, condition_)			       \
 ({                                                                             \
+	DEFINE_WAIT_FUNC(wait_, woken_wake_function);                          \
 	struct sock *sk_;						       \
 	int rc_;							       \
 									       \
 	while ((rc_ = !(condition_))) {					       \
-		DEFINE_WAIT_FUNC(wait_, woken_wake_function);	               \
+		/* coupled with smp_wmb() in tipc_sk_proto_rcv() */            \
+		smp_rmb();                                                     \
 		sk_ = (sock_)->sk;					       \
 		rc_ = tipc_sk_sock_err((sock_), timeo_);		       \
 		if (rc_)						       \
@@ -1983,6 +1985,8 @@ static void tipc_sk_proto_rcv(struct soc
 		return;
 	case SOCK_WAKEUP:
 		tipc_dest_del(&tsk->cong_links, msg_orignode(hdr), 0);
+		/* coupled with smp_rmb() in tipc_wait_for_cond() */
+		smp_wmb();
 		tsk->cong_link_cnt--;
 		wakeup = true;
 		break;
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/scripts/Makefile.kasan linux-libre-5.0-gnu/scripts/Makefile.kasan
--- linux-libre-5.0-rc8-gnu/scripts/Makefile.kasan	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/scripts/Makefile.kasan	2019-03-03 18:21:29.000000000 -0500
@@ -26,7 +26,7 @@ else
 	CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \
 	 $(call cc-param,asan-globals=1) \
 	 $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \
-	 $(call cc-param,asan-stack=1) \
+	 $(call cc-param,asan-stack=$(CONFIG_KASAN_STACK)) \
 	 $(call cc-param,asan-use-after-scope=1) \
 	 $(call cc-param,asan-instrument-allocas=1)
 endif
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/tools/testing/selftests/net/pmtu.sh linux-libre-5.0-gnu/tools/testing/selftests/net/pmtu.sh
--- linux-libre-5.0-rc8-gnu/tools/testing/selftests/net/pmtu.sh	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/tools/testing/selftests/net/pmtu.sh	2019-03-03 18:21:29.000000000 -0500
@@ -103,6 +103,15 @@
 #	and check that configured MTU is used on link creation and changes, and
 #	that MTU is properly calculated instead when MTU is not configured from
 #	userspace
+#
+# - cleanup_ipv4_exception
+#	Similar to pmtu_ipv4_vxlan4_exception, but explicitly generate PMTU
+#	exceptions on multiple CPUs and check that the veth device tear-down
+# 	happens in a timely manner
+#
+# - cleanup_ipv6_exception
+#	Same as above, but use IPv6 transport from A to B
+
 
 # Kselftest framework requirement - SKIP code is 4.
 ksft_skip=4
@@ -135,7 +144,9 @@ tests="
 	pmtu_vti6_default_mtu		vti6: default MTU assignment
 	pmtu_vti4_link_add_mtu		vti4: MTU setting on link creation
 	pmtu_vti6_link_add_mtu		vti6: MTU setting on link creation
-	pmtu_vti6_link_change_mtu	vti6: MTU changes on link changes"
+	pmtu_vti6_link_change_mtu	vti6: MTU changes on link changes
+	cleanup_ipv4_exception		ipv4: cleanup of cached exceptions
+	cleanup_ipv6_exception		ipv6: cleanup of cached exceptions"
 
 NS_A="ns-$(mktemp -u XXXXXX)"
 NS_B="ns-$(mktemp -u XXXXXX)"
@@ -263,8 +274,6 @@ setup_fou_or_gue() {
 
 	${ns_a} ip link set ${encap}_a up
 	${ns_b} ip link set ${encap}_b up
-
-	sleep 1
 }
 
 setup_fou44() {
@@ -302,6 +311,10 @@ setup_gue66() {
 setup_namespaces() {
 	for n in ${NS_A} ${NS_B} ${NS_R1} ${NS_R2}; do
 		ip netns add ${n} || return 1
+
+		# Disable DAD, so that we don't have to wait to use the
+		# configured IPv6 addresses
+		ip netns exec ${n} sysctl -q net/ipv6/conf/default/accept_dad=0
 	done
 }
 
@@ -337,8 +350,6 @@ setup_vti() {
 
 	${ns_a} ip link set vti${proto}_a up
 	${ns_b} ip link set vti${proto}_b up
-
-	sleep 1
 }
 
 setup_vti4() {
@@ -375,8 +386,6 @@ setup_vxlan_or_geneve() {
 
 	${ns_a} ip link set ${type}_a up
 	${ns_b} ip link set ${type}_b up
-
-	sleep 1
 }
 
 setup_geneve4() {
@@ -588,8 +597,8 @@ test_pmtu_ipvX() {
 	mtu "${ns_b}"  veth_B-R2 1500
 
 	# Create route exceptions
-	${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s 1800 ${dst1} > /dev/null
-	${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s 1800 ${dst2} > /dev/null
+	${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1800 ${dst1} > /dev/null
+	${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1800 ${dst2} > /dev/null
 
 	# Check that exceptions have been created with the correct PMTU
 	pmtu_1="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst1})"
@@ -621,7 +630,7 @@ test_pmtu_ipvX() {
 	# Decrease remote MTU on path via R2, get new exception
 	mtu "${ns_r2}" veth_R2-B 400
 	mtu "${ns_b}"  veth_B-R2 400
-	${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s 1400 ${dst2} > /dev/null
+	${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1400 ${dst2} > /dev/null
 	pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
 	check_pmtu_value "lock 552" "${pmtu_2}" "exceeding MTU, with MTU < min_pmtu" || return 1
 
@@ -638,7 +647,7 @@ test_pmtu_ipvX() {
 	check_pmtu_value "1500" "${pmtu_2}" "increasing local MTU" || return 1
 
 	# Get new exception
-	${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s 1400 ${dst2} > /dev/null
+	${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s 1400 ${dst2} > /dev/null
 	pmtu_2="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst2})"
 	check_pmtu_value "lock 552" "${pmtu_2}" "exceeding MTU, with MTU < min_pmtu" || return 1
 }
@@ -687,7 +696,7 @@ test_pmtu_ipvX_over_vxlanY_or_geneveY_ex
 
 	mtu "${ns_a}" ${type}_a $((${ll_mtu} + 1000))
 	mtu "${ns_b}" ${type}_b $((${ll_mtu} + 1000))
-	${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s $((${ll_mtu} + 500)) ${dst} > /dev/null
+	${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s $((${ll_mtu} + 500)) ${dst} > /dev/null
 
 	# Check that exception was created
 	pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst})"
@@ -767,7 +776,7 @@ test_pmtu_ipvX_over_fouY_or_gueY() {
 
 	mtu "${ns_a}" ${encap}_a $((${ll_mtu} + 1000))
 	mtu "${ns_b}" ${encap}_b $((${ll_mtu} + 1000))
-	${ns_a} ${ping} -q -M want -i 0.1 -w 2 -s $((${ll_mtu} + 500)) ${dst} > /dev/null
+	${ns_a} ${ping} -q -M want -i 0.1 -w 1 -s $((${ll_mtu} + 500)) ${dst} > /dev/null
 
 	# Check that exception was created
 	pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${dst})"
@@ -825,13 +834,13 @@ test_pmtu_vti4_exception() {
 
 	# Send DF packet without exceeding link layer MTU, check that no
 	# exception is created
-	${ns_a} ping -q -M want -i 0.1 -w 2 -s ${ping_payload} ${tunnel4_b_addr} > /dev/null
+	${ns_a} ping -q -M want -i 0.1 -w 1 -s ${ping_payload} ${tunnel4_b_addr} > /dev/null
 	pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel4_b_addr})"
 	check_pmtu_value "" "${pmtu}" "sending packet smaller than PMTU (IP payload length ${esp_payload_rfc4106})" || return 1
 
 	# Now exceed link layer MTU by one byte, check that exception is created
 	# with the right PMTU value
-	${ns_a} ping -q -M want -i 0.1 -w 2 -s $((ping_payload + 1)) ${tunnel4_b_addr} > /dev/null
+	${ns_a} ping -q -M want -i 0.1 -w 1 -s $((ping_payload + 1)) ${tunnel4_b_addr} > /dev/null
 	pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel4_b_addr})"
 	check_pmtu_value "${esp_payload_rfc4106}" "${pmtu}" "exceeding PMTU (IP payload length $((esp_payload_rfc4106 + 1)))"
 }
@@ -847,7 +856,7 @@ test_pmtu_vti6_exception() {
 	mtu "${ns_b}" veth_b 4000
 	mtu "${ns_a}" vti6_a 5000
 	mtu "${ns_b}" vti6_b 5000
-	${ns_a} ${ping6} -q -i 0.1 -w 2 -s 60000 ${tunnel6_b_addr} > /dev/null
+	${ns_a} ${ping6} -q -i 0.1 -w 1 -s 60000 ${tunnel6_b_addr} > /dev/null
 
 	# Check that exception was created
 	pmtu="$(route_get_dst_pmtu_from_exception "${ns_a}" ${tunnel6_b_addr})"
@@ -1008,6 +1017,61 @@ test_pmtu_vti6_link_change_mtu() {
 	return ${fail}
 }
 
+check_command() {
+	cmd=${1}
+
+	if ! which ${cmd} > /dev/null 2>&1; then
+		err "  missing required command: '${cmd}'"
+		return 1
+	fi
+	return 0
+}
+
+test_cleanup_vxlanX_exception() {
+	outer="${1}"
+	encap="vxlan"
+	ll_mtu=4000
+
+	check_command taskset || return 2
+	cpu_list=$(grep -m 2 processor /proc/cpuinfo | cut -d ' ' -f 2)
+
+	setup namespaces routing ${encap}${outer} || return 2
+	trace "${ns_a}" ${encap}_a   "${ns_b}"  ${encap}_b \
+	      "${ns_a}" veth_A-R1    "${ns_r1}" veth_R1-A \
+	      "${ns_b}" veth_B-R1    "${ns_r1}" veth_R1-B
+
+	# Create route exception by exceeding link layer MTU
+	mtu "${ns_a}"  veth_A-R1 $((${ll_mtu} + 1000))
+	mtu "${ns_r1}" veth_R1-A $((${ll_mtu} + 1000))
+	mtu "${ns_b}"  veth_B-R1 ${ll_mtu}
+	mtu "${ns_r1}" veth_R1-B ${ll_mtu}
+
+	mtu "${ns_a}" ${encap}_a $((${ll_mtu} + 1000))
+	mtu "${ns_b}" ${encap}_b $((${ll_mtu} + 1000))
+
+	# Fill exception cache for multiple CPUs (2)
+	# we can always use inner IPv4 for that
+	for cpu in ${cpu_list}; do
+		taskset --cpu-list ${cpu} ${ns_a} ping -q -M want -i 0.1 -w 1 -s $((${ll_mtu} + 500)) ${tunnel4_b_addr} > /dev/null
+	done
+
+	${ns_a} ip link del dev veth_A-R1 &
+	iplink_pid=$!
+	sleep 1
+	if [ "$(cat /proc/${iplink_pid}/cmdline 2>/dev/null | tr -d '\0')" = "iplinkdeldevveth_A-R1" ]; then
+		err "  can't delete veth device in a timely manner, PMTU dst likely leaked"
+		return 1
+	fi
+}
+
+test_cleanup_ipv6_exception() {
+	test_cleanup_vxlanX_exception 6
+}
+
+test_cleanup_ipv4_exception() {
+	test_cleanup_vxlanX_exception 4
+}
+
 usage() {
 	echo
 	echo "$0 [OPTIONS] [TEST]..."
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/tools/testing/selftests/net/udpgro.sh linux-libre-5.0-gnu/tools/testing/selftests/net/udpgro.sh
--- linux-libre-5.0-rc8-gnu/tools/testing/selftests/net/udpgro.sh	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/tools/testing/selftests/net/udpgro.sh	2019-03-03 18:21:29.000000000 -0500
@@ -37,7 +37,7 @@ run_one() {
 
 	cfg_veth
 
-	ip netns exec "${PEER_NS}" ./udpgso_bench_rx ${rx_args} && \
+	ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 1000 -R 10 ${rx_args} && \
 		echo "ok" || \
 		echo "failed" &
 
@@ -81,7 +81,7 @@ run_one_nat() {
 	# will land on the 'plain' one
 	ip netns exec "${PEER_NS}" ./udpgso_bench_rx -G ${family} -b ${addr1} -n 0 &
 	pid=$!
-	ip netns exec "${PEER_NS}" ./udpgso_bench_rx ${family} -b ${addr2%/*} ${rx_args} && \
+	ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 1000 -R 10 ${family} -b ${addr2%/*} ${rx_args} && \
 		echo "ok" || \
 		echo "failed"&
 
@@ -99,8 +99,8 @@ run_one_2sock() {
 
 	cfg_veth
 
-	ip netns exec "${PEER_NS}" ./udpgso_bench_rx ${rx_args} -p 12345 &
-	ip netns exec "${PEER_NS}" ./udpgso_bench_rx ${rx_args} && \
+	ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 1000 -R 10 ${rx_args} -p 12345 &
+	ip netns exec "${PEER_NS}" ./udpgso_bench_rx -C 2000 -R 10 ${rx_args} && \
 		echo "ok" || \
 		echo "failed" &
 
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/tools/testing/selftests/net/udpgso_bench_rx.c linux-libre-5.0-gnu/tools/testing/selftests/net/udpgso_bench_rx.c
--- linux-libre-5.0-rc8-gnu/tools/testing/selftests/net/udpgso_bench_rx.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/tools/testing/selftests/net/udpgso_bench_rx.c	2019-03-03 18:21:29.000000000 -0500
@@ -45,6 +45,8 @@ static int  cfg_alen 		= sizeof(struct s
 static int  cfg_expected_pkt_nr;
 static int  cfg_expected_pkt_len;
 static int  cfg_expected_gso_size;
+static int  cfg_connect_timeout_ms;
+static int  cfg_rcv_timeout_ms;
 static struct sockaddr_storage cfg_bind_addr;
 
 static bool interrupted;
@@ -87,7 +89,7 @@ static unsigned long gettimeofday_ms(voi
 	return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
 }
 
-static void do_poll(int fd)
+static void do_poll(int fd, int timeout_ms)
 {
 	struct pollfd pfd;
 	int ret;
@@ -102,8 +104,16 @@ static void do_poll(int fd)
 			break;
 		if (ret == -1)
 			error(1, errno, "poll");
-		if (ret == 0)
-			continue;
+		if (ret == 0) {
+			if (!timeout_ms)
+				continue;
+
+			timeout_ms -= 10;
+			if (timeout_ms <= 0) {
+				interrupted = true;
+				break;
+			}
+		}
 		if (pfd.revents != POLLIN)
 			error(1, errno, "poll: 0x%x expected 0x%x\n",
 					pfd.revents, POLLIN);
@@ -134,7 +144,7 @@ static int do_socket(bool do_tcp)
 		if (listen(accept_fd, 1))
 			error(1, errno, "listen");
 
-		do_poll(accept_fd);
+		do_poll(accept_fd, cfg_connect_timeout_ms);
 		if (interrupted)
 			exit(0);
 
@@ -273,7 +283,9 @@ static void do_flush_udp(int fd)
 
 static void usage(const char *filepath)
 {
-	error(1, 0, "Usage: %s [-Grtv] [-b addr] [-p port] [-l pktlen] [-n packetnr] [-S gsosize]", filepath);
+	error(1, 0, "Usage: %s [-C connect_timeout] [-Grtv] [-b addr] [-p port]"
+	      " [-l pktlen] [-n packetnr] [-R rcv_timeout] [-S gsosize]",
+	      filepath);
 }
 
 static void parse_opts(int argc, char **argv)
@@ -282,7 +294,7 @@ static void parse_opts(int argc, char **
 
 	/* bind to any by default */
 	setup_sockaddr(PF_INET6, "::", &cfg_bind_addr);
-	while ((c = getopt(argc, argv, "4b:Gl:n:p:rS:tv")) != -1) {
+	while ((c = getopt(argc, argv, "4b:C:Gl:n:p:rR:S:tv")) != -1) {
 		switch (c) {
 		case '4':
 			cfg_family = PF_INET;
@@ -292,6 +304,9 @@ static void parse_opts(int argc, char **
 		case 'b':
 			setup_sockaddr(cfg_family, optarg, &cfg_bind_addr);
 			break;
+		case 'C':
+			cfg_connect_timeout_ms = strtoul(optarg, NULL, 0);
+			break;
 		case 'G':
 			cfg_gro_segment = true;
 			break;
@@ -307,6 +322,9 @@ static void parse_opts(int argc, char **
 		case 'r':
 			cfg_read_all = true;
 			break;
+		case 'R':
+			cfg_rcv_timeout_ms = strtoul(optarg, NULL, 0);
+			break;
 		case 'S':
 			cfg_expected_gso_size = strtol(optarg, NULL, 0);
 			break;
@@ -329,8 +347,9 @@ static void parse_opts(int argc, char **
 
 static void do_recv(void)
 {
+	int timeout_ms = cfg_tcp ? cfg_rcv_timeout_ms : cfg_connect_timeout_ms;
 	unsigned long tnow, treport;
-	int fd, loop = 0;
+	int fd;
 
 	fd = do_socket(cfg_tcp);
 
@@ -342,12 +361,7 @@ static void do_recv(void)
 
 	treport = gettimeofday_ms() + 1000;
 	do {
-		/* force termination after the second poll(); this cope both
-		 * with sender slower than receiver and missing packet errors
-		 */
-		if (cfg_expected_pkt_nr && loop++)
-			interrupted = true;
-		do_poll(fd);
+		do_poll(fd, timeout_ms);
 
 		if (cfg_tcp)
 			do_flush_tcp(fd);
@@ -365,6 +379,8 @@ static void do_recv(void)
 			treport = tnow + 1000;
 		}
 
+		timeout_ms = cfg_rcv_timeout_ms;
+
 	} while (!interrupted);
 
 	if (cfg_expected_pkt_nr && (packets != cfg_expected_pkt_nr))
diff -druNp --no-dereference linux-libre-5.0-rc8-gnu/virt/kvm/kvm_main.c linux-libre-5.0-gnu/virt/kvm/kvm_main.c
--- linux-libre-5.0-rc8-gnu/virt/kvm/kvm_main.c	2019-02-24 19:46:45.000000000 -0500
+++ linux-libre-5.0-gnu/virt/kvm/kvm_main.c	2019-03-03 18:21:29.000000000 -0500
@@ -4044,7 +4044,7 @@ static void kvm_uevent_notify_change(uns
 	}
 	add_uevent_var(env, "PID=%d", kvm->userspace_pid);
 
-	if (kvm->debugfs_dentry) {
+	if (!IS_ERR_OR_NULL(kvm->debugfs_dentry)) {
 		char *tmp, *p = kmalloc(PATH_MAX, GFP_KERNEL);
 
 		if (p) {
