diff -druNp --no-dereference linux-libre-4.9.223-gnu/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts linux-libre-4.9.224-gnu/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts
--- linux-libre-4.9.223-gnu/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts	2020-05-20 02:15:44.000000000 -0400
@@ -81,8 +81,8 @@
 	imx27-phycard-s-rdk {
 		pinctrl_i2c1: i2c1grp {
 			fsl,pins = <
-				MX27_PAD_I2C2_SDA__I2C2_SDA 0x0
-				MX27_PAD_I2C2_SCL__I2C2_SCL 0x0
+				MX27_PAD_I2C_DATA__I2C_DATA 0x0
+				MX27_PAD_I2C_CLK__I2C_CLK 0x0
 			>;
 		};
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/arch/arm/boot/dts/r8a73a4.dtsi linux-libre-4.9.224-gnu/arch/arm/boot/dts/r8a73a4.dtsi
--- linux-libre-4.9.223-gnu/arch/arm/boot/dts/r8a73a4.dtsi	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/arch/arm/boot/dts/r8a73a4.dtsi	2020-05-20 02:15:44.000000000 -0400
@@ -135,7 +135,14 @@
 	cmt1: timer@e6130000 {
 		compatible = "renesas,cmt-48-r8a73a4", "renesas,cmt-48-gen2";
 		reg = <0 0xe6130000 0 0x1004>;
-		interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
+		interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
+			     <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
 		clocks = <&mstp3_clks R8A73A4_CLK_CMT1>;
 		clock-names = "fck";
 		power-domains = <&pd_c5>;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/arch/arm/boot/dts/r8a7740.dtsi linux-libre-4.9.224-gnu/arch/arm/boot/dts/r8a7740.dtsi
--- linux-libre-4.9.223-gnu/arch/arm/boot/dts/r8a7740.dtsi	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/arch/arm/boot/dts/r8a7740.dtsi	2020-05-20 02:15:44.000000000 -0400
@@ -467,7 +467,7 @@
 		cpg_clocks: cpg_clocks@e6150000 {
 			compatible = "renesas,r8a7740-cpg-clocks";
 			reg = <0xe6150000 0x10000>;
-			clocks = <&extal1_clk>, <&extalr_clk>;
+			clocks = <&extal1_clk>, <&extal2_clk>, <&extalr_clk>;
 			#clock-cells = <1>;
 			clock-output-names = "system", "pllc0", "pllc1",
 					     "pllc2", "r",
diff -druNp --no-dereference linux-libre-4.9.223-gnu/arch/x86/include/asm/stackprotector.h linux-libre-4.9.224-gnu/arch/x86/include/asm/stackprotector.h
--- linux-libre-4.9.223-gnu/arch/x86/include/asm/stackprotector.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/arch/x86/include/asm/stackprotector.h	2020-05-20 02:15:44.000000000 -0400
@@ -54,8 +54,13 @@
 /*
  * Initialize the stackprotector canary value.
  *
- * NOTE: this must only be called from functions that never return,
+ * NOTE: this must only be called from functions that never return
  * and it must always be inlined.
+ *
+ * In addition, it should be called from a compilation unit for which
+ * stack protector is disabled. Alternatively, the caller should not end
+ * with a function call which gets tail-call optimized as that would
+ * lead to checking a modified canary value.
  */
 static __always_inline void boot_init_stack_canary(void)
 {
diff -druNp --no-dereference linux-libre-4.9.223-gnu/arch/x86/kernel/smpboot.c linux-libre-4.9.224-gnu/arch/x86/kernel/smpboot.c
--- linux-libre-4.9.223-gnu/arch/x86/kernel/smpboot.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/arch/x86/kernel/smpboot.c	2020-05-20 02:15:44.000000000 -0400
@@ -249,6 +249,14 @@ static void notrace start_secondary(void
 
 	wmb();
 	cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
+
+	/*
+	 * Prevent tail call to cpu_startup_entry() because the stack protector
+	 * guard has been changed a couple of function calls up, in
+	 * boot_init_stack_canary() and must not be checked before tail calling
+	 * another function.
+	 */
+	prevent_tail_call_optimization();
 }
 
 /**
diff -druNp --no-dereference linux-libre-4.9.223-gnu/arch/x86/kvm/x86.c linux-libre-4.9.224-gnu/arch/x86/kvm/x86.c
--- linux-libre-4.9.223-gnu/arch/x86/kvm/x86.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/arch/x86/kvm/x86.c	2020-05-20 02:15:44.000000000 -0400
@@ -3128,7 +3128,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(
 	unsigned bank_num = mcg_cap & 0xff, bank;
 
 	r = -EINVAL;
-	if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS)
+	if (!bank_num || bank_num > KVM_MAX_MCE_BANKS)
 		goto out;
 	if (mcg_cap & ~(kvm_mce_cap_supported | 0xff | 0xff0000))
 		goto out;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/arch/x86/xen/smp.c linux-libre-4.9.224-gnu/arch/x86/xen/smp.c
--- linux-libre-4.9.223-gnu/arch/x86/xen/smp.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/arch/x86/xen/smp.c	2020-05-20 02:15:44.000000000 -0400
@@ -116,6 +116,7 @@ asmlinkage __visible void cpu_bringup_an
 #endif
 	cpu_bringup();
 	cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
+	prevent_tail_call_optimization();
 }
 
 void xen_smp_intr_free(unsigned int cpu)
diff -druNp --no-dereference linux-libre-4.9.223-gnu/block/blk-core.c linux-libre-4.9.224-gnu/block/blk-core.c
--- linux-libre-4.9.223-gnu/block/blk-core.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/block/blk-core.c	2020-05-20 02:15:44.000000000 -0400
@@ -729,6 +729,9 @@ struct request_queue *blk_alloc_queue_no
 
 	kobject_init(&q->kobj, &blk_queue_ktype);
 
+#ifdef CONFIG_BLK_DEV_IO_TRACE
+	mutex_init(&q->blk_trace_mutex);
+#endif
 	mutex_init(&q->sysfs_lock);
 	spin_lock_init(&q->__queue_lock);
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/crypto/lrw.c linux-libre-4.9.224-gnu/crypto/lrw.c
--- linux-libre-4.9.223-gnu/crypto/lrw.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/crypto/lrw.c	2020-05-20 02:15:44.000000000 -0400
@@ -377,7 +377,7 @@ out_put_alg:
 	return inst;
 }
 
-static void free(struct crypto_instance *inst)
+static void free_inst(struct crypto_instance *inst)
 {
 	crypto_drop_spawn(crypto_instance_ctx(inst));
 	kfree(inst);
@@ -386,7 +386,7 @@ static void free(struct crypto_instance
 static struct crypto_template crypto_tmpl = {
 	.name = "lrw",
 	.alloc = alloc,
-	.free = free,
+	.free = free_inst,
 	.module = THIS_MODULE,
 };
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/crypto/xts.c linux-libre-4.9.224-gnu/crypto/xts.c
--- linux-libre-4.9.223-gnu/crypto/xts.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/crypto/xts.c	2020-05-20 02:15:44.000000000 -0400
@@ -329,7 +329,7 @@ out_put_alg:
 	return inst;
 }
 
-static void free(struct crypto_instance *inst)
+static void free_inst(struct crypto_instance *inst)
 {
 	crypto_drop_spawn(crypto_instance_ctx(inst));
 	kfree(inst);
@@ -338,7 +338,7 @@ static void free(struct crypto_instance
 static struct crypto_template crypto_tmpl = {
 	.name = "xts",
 	.alloc = alloc,
-	.free = free,
+	.free = free_inst,
 	.module = THIS_MODULE,
 };
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/acpi/video_detect.c linux-libre-4.9.224-gnu/drivers/acpi/video_detect.c
--- linux-libre-4.9.223-gnu/drivers/acpi/video_detect.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/acpi/video_detect.c	2020-05-20 02:15:44.000000000 -0400
@@ -314,17 +314,6 @@ static const struct dmi_system_id video_
 		DMI_MATCH(DMI_PRODUCT_NAME, "Dell System XPS L702X"),
 		},
 	},
-	{
-	/* https://bugzilla.redhat.com/show_bug.cgi?id=1204476 */
-	/* https://bugs.launchpad.net/ubuntu/+source/linux-lts-trusty/+bug/1416940 */
-	.callback = video_detect_force_native,
-	.ident = "HP Pavilion dv6",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-		DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv6 Notebook PC"),
-		},
-	},
-
 	{ },
 };
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/dma/mmp_tdma.c linux-libre-4.9.224-gnu/drivers/dma/mmp_tdma.c
--- linux-libre-4.9.223-gnu/drivers/dma/mmp_tdma.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/dma/mmp_tdma.c	2020-05-20 02:15:44.000000000 -0400
@@ -362,6 +362,8 @@ static void mmp_tdma_free_descriptor(str
 		gen_pool_free(gpool, (unsigned long)tdmac->desc_arr,
 				size);
 	tdmac->desc_arr = NULL;
+	if (tdmac->status == DMA_ERROR)
+		tdmac->status = DMA_COMPLETE;
 
 	return;
 }
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/dma/pch_dma.c linux-libre-4.9.224-gnu/drivers/dma/pch_dma.c
--- linux-libre-4.9.223-gnu/drivers/dma/pch_dma.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/dma/pch_dma.c	2020-05-20 02:15:44.000000000 -0400
@@ -876,6 +876,7 @@ static int pch_dma_probe(struct pci_dev
 	}
 
 	pci_set_master(pdev);
+	pd->dma.dev = &pdev->dev;
 
 	err = request_irq(pdev->irq, pd_irq, IRQF_SHARED, DRV_NAME, pd);
 	if (err) {
@@ -891,7 +892,6 @@ static int pch_dma_probe(struct pci_dev
 		goto err_free_irq;
 	}
 
-	pd->dma.dev = &pdev->dev;
 
 	INIT_LIST_HEAD(&pd->dma.channels);
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/gpu/drm/qxl/qxl_image.c linux-libre-4.9.224-gnu/drivers/gpu/drm/qxl/qxl_image.c
--- linux-libre-4.9.223-gnu/drivers/gpu/drm/qxl/qxl_image.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/gpu/drm/qxl/qxl_image.c	2020-05-20 02:15:44.000000000 -0400
@@ -210,7 +210,8 @@ qxl_image_init_helper(struct qxl_device
 		break;
 	default:
 		DRM_ERROR("unsupported image bit depth\n");
-		return -EINVAL; /* TODO: cleanup */
+		qxl_bo_kunmap_atomic_page(qdev, image_bo, ptr);
+		return -EINVAL;
 	}
 	image->u.bitmap.flags = QXL_BITMAP_TOP_DOWN;
 	image->u.bitmap.x = width;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/infiniband/core/addr.c linux-libre-4.9.224-gnu/drivers/infiniband/core/addr.c
--- linux-libre-4.9.223-gnu/drivers/infiniband/core/addr.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/infiniband/core/addr.c	2020-05-20 02:15:44.000000000 -0400
@@ -453,16 +453,15 @@ static int addr6_resolve(struct sockaddr
 	struct flowi6 fl6;
 	struct dst_entry *dst;
 	struct rt6_info *rt;
-	int ret;
 
 	memset(&fl6, 0, sizeof fl6);
 	fl6.daddr = dst_in->sin6_addr;
 	fl6.saddr = src_in->sin6_addr;
 	fl6.flowi6_oif = addr->bound_dev_if;
 
-	ret = ipv6_stub->ipv6_dst_lookup(addr->net, NULL, &dst, &fl6);
-	if (ret < 0)
-		return ret;
+	dst = ipv6_stub->ipv6_dst_lookup_flow(addr->net, NULL, &fl6, NULL);
+	if (IS_ERR(dst))
+		return PTR_ERR(dst);
 
 	rt = (struct rt6_info *)dst;
 	if (ipv6_addr_any(&src_in->sin6_addr)) {
@@ -552,6 +551,7 @@ static int addr_resolve(struct sockaddr
 		const struct sockaddr_in6 *dst_in6 =
 			(const struct sockaddr_in6 *)dst_in;
 
+		dst = NULL;
 		ret = addr6_resolve((struct sockaddr_in6 *)src_in,
 				    dst_in6, addr,
 				    &dst);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/infiniband/hw/i40iw/i40iw_hw.c linux-libre-4.9.224-gnu/drivers/infiniband/hw/i40iw/i40iw_hw.c
--- linux-libre-4.9.223-gnu/drivers/infiniband/hw/i40iw/i40iw_hw.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/infiniband/hw/i40iw/i40iw_hw.c	2020-05-20 02:15:44.000000000 -0400
@@ -479,7 +479,7 @@ void i40iw_manage_arp_cache(struct i40iw
 	int arp_index;
 
 	arp_index = i40iw_arp_table(iwdev, ip_addr, ipv4, mac_addr, action);
-	if (arp_index == -1)
+	if (arp_index < 0)
 		return;
 	cqp_request = i40iw_get_cqp_request(&iwdev->cqp, false);
 	if (!cqp_request)
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/infiniband/hw/mlx4/qp.c linux-libre-4.9.224-gnu/drivers/infiniband/hw/mlx4/qp.c
--- linux-libre-4.9.223-gnu/drivers/infiniband/hw/mlx4/qp.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/infiniband/hw/mlx4/qp.c	2020-05-20 02:15:44.000000000 -0400
@@ -2307,6 +2307,7 @@ static int build_sriov_qp0_header(struct
 	int send_size;
 	int header_size;
 	int spc;
+	int err;
 	int i;
 
 	if (wr->wr.opcode != IB_WR_SEND)
@@ -2341,7 +2342,9 @@ static int build_sriov_qp0_header(struct
 
 	sqp->ud_header.lrh.virtual_lane    = 0;
 	sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags & IB_SEND_SOLICITED);
-	ib_get_cached_pkey(ib_dev, sqp->qp.port, 0, &pkey);
+	err = ib_get_cached_pkey(ib_dev, sqp->qp.port, 0, &pkey);
+	if (err)
+		return err;
 	sqp->ud_header.bth.pkey = cpu_to_be16(pkey);
 	if (sqp->qp.mlx4_ib_qp_type == MLX4_IB_QPT_TUN_SMI_OWNER)
 		sqp->ud_header.bth.destination_qpn = cpu_to_be32(wr->remote_qpn);
@@ -2618,9 +2621,14 @@ static int build_mlx_header(struct mlx4_
 	}
 	sqp->ud_header.bth.solicited_event = !!(wr->wr.send_flags & IB_SEND_SOLICITED);
 	if (!sqp->qp.ibqp.qp_num)
-		ib_get_cached_pkey(ib_dev, sqp->qp.port, sqp->pkey_index, &pkey);
+		err = ib_get_cached_pkey(ib_dev, sqp->qp.port, sqp->pkey_index,
+					 &pkey);
 	else
-		ib_get_cached_pkey(ib_dev, sqp->qp.port, wr->pkey_index, &pkey);
+		err = ib_get_cached_pkey(ib_dev, sqp->qp.port, wr->pkey_index,
+					 &pkey);
+	if (err)
+		return err;
+
 	sqp->ud_header.bth.pkey = cpu_to_be16(pkey);
 	sqp->ud_header.bth.destination_qpn = cpu_to_be32(wr->remote_qpn);
 	sqp->ud_header.bth.psn = cpu_to_be32((sqp->send_psn++) & ((1 << 24) - 1));
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/infiniband/sw/rxe/rxe_net.c linux-libre-4.9.224-gnu/drivers/infiniband/sw/rxe/rxe_net.c
--- linux-libre-4.9.223-gnu/drivers/infiniband/sw/rxe/rxe_net.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/infiniband/sw/rxe/rxe_net.c	2020-05-20 02:15:44.000000000 -0400
@@ -182,10 +182,12 @@ static struct dst_entry *rxe_find_route6
 	memcpy(&fl6.daddr, daddr, sizeof(*daddr));
 	fl6.flowi6_proto = IPPROTO_UDP;
 
-	if (unlikely(ipv6_stub->ipv6_dst_lookup(sock_net(recv_sockets.sk6->sk),
-						recv_sockets.sk6->sk, &ndst, &fl6))) {
+	ndst = ipv6_stub->ipv6_dst_lookup_flow(sock_net(recv_sockets.sk6->sk),
+					       recv_sockets.sk6->sk, &fl6,
+					       NULL);
+	if (unlikely(IS_ERR(ndst))) {
 		pr_err_ratelimited("no route to %pI6\n", daddr);
-		goto put;
+		return NULL;
 	}
 
 	if (unlikely(ndst->error)) {
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/net/ethernet/broadcom/bnxt/bnxt.c linux-libre-4.9.224-gnu/drivers/net/ethernet/broadcom/bnxt/bnxt.c
--- linux-libre-4.9.223-gnu/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-05-20 02:15:44.000000000 -0400
@@ -5997,6 +5997,7 @@ static netdev_features_t bnxt_fix_featur
 					   netdev_features_t features)
 {
 	struct bnxt *bp = netdev_priv(dev);
+	netdev_features_t vlan_features;
 
 	if ((features & NETIF_F_NTUPLE) && !bnxt_rfs_capable(bp))
 		features &= ~NETIF_F_NTUPLE;
@@ -6004,12 +6005,14 @@ static netdev_features_t bnxt_fix_featur
 	/* Both CTAG and STAG VLAN accelaration on the RX side have to be
 	 * turned on or off together.
 	 */
-	if ((features & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) !=
-	    (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX)) {
+	vlan_features = features & (NETIF_F_HW_VLAN_CTAG_RX |
+				    NETIF_F_HW_VLAN_STAG_RX);
+	if (vlan_features != (NETIF_F_HW_VLAN_CTAG_RX |
+			      NETIF_F_HW_VLAN_STAG_RX)) {
 		if (dev->features & NETIF_F_HW_VLAN_CTAG_RX)
 			features &= ~(NETIF_F_HW_VLAN_CTAG_RX |
 				      NETIF_F_HW_VLAN_STAG_RX);
-		else
+		else if (vlan_features)
 			features |= NETIF_F_HW_VLAN_CTAG_RX |
 				    NETIF_F_HW_VLAN_STAG_RX;
 	}
@@ -7163,8 +7166,11 @@ static pci_ers_result_t bnxt_io_slot_res
 			result = PCI_ERS_RESULT_RECOVERED;
 	}
 
-	if (result != PCI_ERS_RESULT_RECOVERED && netif_running(netdev))
-		dev_close(netdev);
+	if (result != PCI_ERS_RESULT_RECOVERED) {
+		if (netif_running(netdev))
+			dev_close(netdev);
+		pci_disable_device(pdev);
+	}
 
 	rtnl_unlock();
 
@@ -7175,7 +7181,7 @@ static pci_ers_result_t bnxt_io_slot_res
 			 err); /* non-fatal, continue */
 	}
 
-	return PCI_ERS_RESULT_RECOVERED;
+	return result;
 }
 
 /**
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/net/ethernet/mellanox/mlx4/main.c linux-libre-4.9.224-gnu/drivers/net/ethernet/mellanox/mlx4/main.c
--- linux-libre-4.9.223-gnu/drivers/net/ethernet/mellanox/mlx4/main.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/net/ethernet/mellanox/mlx4/main.c	2020-05-20 02:15:44.000000000 -0400
@@ -2478,6 +2478,7 @@ static int mlx4_allocate_default_counter
 
 		if (!err || err == -ENOSPC) {
 			priv->def_counter[port] = idx;
+			err = 0;
 		} else if (err == -ENOENT) {
 			err = 0;
 			continue;
@@ -2527,7 +2528,8 @@ int mlx4_counter_alloc(struct mlx4_dev *
 				   MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);
 		if (!err)
 			*idx = get_param_l(&out_param);
-
+		if (WARN_ON(err == -ENOSPC))
+			err = -EINVAL;
 		return err;
 	}
 	return __mlx4_counter_alloc(dev, idx);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/net/ethernet/mellanox/mlx5/core/cmd.c linux-libre-4.9.224-gnu/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
--- linux-libre-4.9.223-gnu/drivers/net/ethernet/mellanox/mlx5/core/cmd.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/net/ethernet/mellanox/mlx5/core/cmd.c	2020-05-20 02:15:44.000000000 -0400
@@ -813,7 +813,6 @@ static void cmd_work_handler(struct work
 	}
 
 	cmd->ent_arr[ent->idx] = ent;
-	set_bit(MLX5_CMD_ENT_STATE_PENDING_COMP, &ent->state);
 	lay = get_inst(cmd, ent->idx);
 	ent->lay = lay;
 	memset(lay, 0, sizeof(*lay));
@@ -835,6 +834,7 @@ static void cmd_work_handler(struct work
 
 	if (ent->callback)
 		schedule_delayed_work(&ent->cb_timeout_work, cb_timeout);
+	set_bit(MLX5_CMD_ENT_STATE_PENDING_COMP, &ent->state);
 
 	/* Skip sending command to fw if internal error */
 	if (pci_channel_offline(dev->pdev) ||
@@ -847,6 +847,10 @@ static void cmd_work_handler(struct work
 		MLX5_SET(mbox_out, ent->out, syndrome, drv_synd);
 
 		mlx5_cmd_comp_handler(dev, 1UL << ent->idx, true);
+		/* no doorbell, no need to keep the entry */
+		free_ent(cmd, ent->idx);
+		if (ent->callback)
+			free_cmd(ent);
 		return;
 	}
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/net/ethernet/moxa/moxart_ether.c linux-libre-4.9.224-gnu/drivers/net/ethernet/moxa/moxart_ether.c
--- linux-libre-4.9.223-gnu/drivers/net/ethernet/moxa/moxart_ether.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/net/ethernet/moxa/moxart_ether.c	2020-05-20 02:15:44.000000000 -0400
@@ -571,7 +571,7 @@ static int moxart_remove(struct platform
 	struct net_device *ndev = platform_get_drvdata(pdev);
 
 	unregister_netdev(ndev);
-	free_irq(ndev->irq, ndev);
+	devm_free_irq(&pdev->dev, ndev->irq, ndev);
 	moxart_mac_free_memory(ndev);
 	free_netdev(ndev);
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/net/ethernet/natsemi/jazzsonic.c linux-libre-4.9.224-gnu/drivers/net/ethernet/natsemi/jazzsonic.c
--- linux-libre-4.9.223-gnu/drivers/net/ethernet/natsemi/jazzsonic.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/net/ethernet/natsemi/jazzsonic.c	2020-05-20 02:15:44.000000000 -0400
@@ -247,13 +247,15 @@ static int jazz_sonic_probe(struct platf
 		goto out;
 	err = register_netdev(dev);
 	if (err)
-		goto out1;
+		goto undo_probe1;
 
 	printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq);
 
 	return 0;
 
-out1:
+undo_probe1:
+	dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
+			  lp->descriptors, lp->descriptors_laddr);
 	release_mem_region(dev->base_addr, SONIC_MEM_SIZE);
 out:
 	free_netdev(dev);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/net/geneve.c linux-libre-4.9.224-gnu/drivers/net/geneve.c
--- linux-libre-4.9.223-gnu/drivers/net/geneve.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/net/geneve.c	2020-05-20 02:15:44.000000000 -0400
@@ -835,7 +835,9 @@ static struct dst_entry *geneve_get_v6_d
 			return dst;
 	}
 
-	if (ipv6_stub->ipv6_dst_lookup(geneve->net, gs6->sock->sk, &dst, fl6)) {
+	dst = ipv6_stub->ipv6_dst_lookup_flow(geneve->net, gs6->sock->sk, fl6,
+					      NULL);
+	if (IS_ERR(dst)) {
 		netdev_dbg(dev, "no route to %pI6\n", &fl6->daddr);
 		return ERR_PTR(-ENETUNREACH);
 	}
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/net/macsec.c linux-libre-4.9.224-gnu/drivers/net/macsec.c
--- linux-libre-4.9.223-gnu/drivers/net/macsec.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/net/macsec.c	2020-05-20 02:15:44.000000000 -0400
@@ -1315,7 +1315,8 @@ static struct crypto_aead *macsec_alloc_
 	struct crypto_aead *tfm;
 	int ret;
 
-	tfm = crypto_alloc_aead("gcm(aes)", 0, 0);
+	/* Pick a sync gcm(aes) cipher to ensure order is preserved. */
+	tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC);
 
 	if (IS_ERR(tfm))
 		return tfm;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/net/phy/dp83640.c linux-libre-4.9.224-gnu/drivers/net/phy/dp83640.c
--- linux-libre-4.9.223-gnu/drivers/net/phy/dp83640.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/net/phy/dp83640.c	2020-05-20 02:15:44.000000000 -0400
@@ -1108,7 +1108,7 @@ static struct dp83640_clock *dp83640_clo
 		goto out;
 	}
 	dp83640_clock_init(clock, bus);
-	list_add_tail(&phyter_clocks, &clock->list);
+	list_add_tail(&clock->list, &phyter_clocks);
 out:
 	mutex_unlock(&phyter_clocks_lock);
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/net/phy/micrel.c linux-libre-4.9.224-gnu/drivers/net/phy/micrel.c
--- linux-libre-4.9.223-gnu/drivers/net/phy/micrel.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/net/phy/micrel.c	2020-05-20 02:15:44.000000000 -0400
@@ -677,8 +677,8 @@ static void kszphy_get_strings(struct ph
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(kszphy_hw_stats); i++) {
-		memcpy(data + i * ETH_GSTRING_LEN,
-		       kszphy_hw_stats[i].string, ETH_GSTRING_LEN);
+		strlcpy(data + i * ETH_GSTRING_LEN,
+			kszphy_hw_stats[i].string, ETH_GSTRING_LEN);
 	}
 }
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/net/usb/qmi_wwan.c linux-libre-4.9.224-gnu/drivers/net/usb/qmi_wwan.c
--- linux-libre-4.9.223-gnu/drivers/net/usb/qmi_wwan.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/net/usb/qmi_wwan.c	2020-05-20 02:15:44.000000000 -0400
@@ -950,6 +950,7 @@ static const struct usb_device_id produc
 	{QMI_FIXED_INTF(0x413c, 0x81b3, 8)},	/* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
 	{QMI_FIXED_INTF(0x413c, 0x81b6, 8)},	/* Dell Wireless 5811e */
 	{QMI_FIXED_INTF(0x413c, 0x81b6, 10)},	/* Dell Wireless 5811e */
+	{QMI_FIXED_INTF(0x413c, 0x81cc, 8)},	/* Dell Wireless 5816e */
 	{QMI_FIXED_INTF(0x413c, 0x81d7, 0)},	/* Dell Wireless 5821e */
 	{QMI_FIXED_INTF(0x413c, 0x81d7, 1)},	/* Dell Wireless 5821e preproduction config */
 	{QMI_FIXED_INTF(0x413c, 0x81e0, 0)},	/* Dell Wireless 5821e with eSIM support*/
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/net/vxlan.c linux-libre-4.9.224-gnu/drivers/net/vxlan.c
--- linux-libre-4.9.223-gnu/drivers/net/vxlan.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/net/vxlan.c	2020-05-20 02:15:44.000000000 -0400
@@ -1881,7 +1881,6 @@ static struct dst_entry *vxlan6_get_rout
 	bool use_cache = ip_tunnel_dst_cache_usable(skb, info);
 	struct dst_entry *ndst;
 	struct flowi6 fl6;
-	int err;
 
 	if (!sock6)
 		return ERR_PTR(-EIO);
@@ -1902,11 +1901,10 @@ static struct dst_entry *vxlan6_get_rout
 	fl6.flowi6_mark = skb->mark;
 	fl6.flowi6_proto = IPPROTO_UDP;
 
-	err = ipv6_stub->ipv6_dst_lookup(vxlan->net,
-					 sock6->sock->sk,
-					 &ndst, &fl6);
-	if (err < 0)
-		return ERR_PTR(err);
+	ndst = ipv6_stub->ipv6_dst_lookup_flow(vxlan->net, sock6->sock->sk,
+					       &fl6, NULL);
+	if (unlikely(IS_ERR(ndst)))
+		return ERR_PTR(-ENETUNREACH);
 
 	*saddr = fl6.saddr;
 	if (use_cache)
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/pinctrl/intel/pinctrl-cherryview.c linux-libre-4.9.224-gnu/drivers/pinctrl/intel/pinctrl-cherryview.c
--- linux-libre-4.9.223-gnu/drivers/pinctrl/intel/pinctrl-cherryview.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/pinctrl/intel/pinctrl-cherryview.c	2020-05-20 02:15:44.000000000 -0400
@@ -1509,11 +1509,15 @@ static void chv_gpio_irq_handler(struct
 	struct chv_pinctrl *pctrl = gpiochip_get_data(gc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	unsigned long pending;
+	unsigned long flags;
 	u32 intr_line;
 
 	chained_irq_enter(chip, desc);
 
+	raw_spin_lock_irqsave(&chv_lock, flags);
 	pending = readl(pctrl->regs + CHV_INTSTAT);
+	raw_spin_unlock_irqrestore(&chv_lock, flags);
+
 	for_each_set_bit(intr_line, &pending, pctrl->community->nirqs) {
 		unsigned irq, offset;
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/ptp/ptp_clock.c linux-libre-4.9.224-gnu/drivers/ptp/ptp_clock.c
--- linux-libre-4.9.223-gnu/drivers/ptp/ptp_clock.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/ptp/ptp_clock.c	2020-05-20 02:15:44.000000000 -0400
@@ -171,10 +171,11 @@ static struct posix_clock_operations ptp
 	.read		= ptp_read,
 };
 
-static void delete_ptp_clock(struct posix_clock *pc)
+static void ptp_clock_release(struct device *dev)
 {
-	struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
+	struct ptp_clock *ptp = container_of(dev, struct ptp_clock, dev);
 
+	ptp_cleanup_pin_groups(ptp);
 	mutex_destroy(&ptp->tsevq_mux);
 	mutex_destroy(&ptp->pincfg_mux);
 	ida_simple_remove(&ptp_clocks_map, ptp->index);
@@ -205,7 +206,6 @@ struct ptp_clock *ptp_clock_register(str
 	}
 
 	ptp->clock.ops = ptp_clock_ops;
-	ptp->clock.release = delete_ptp_clock;
 	ptp->info = info;
 	ptp->devid = MKDEV(major, index);
 	ptp->index = index;
@@ -214,17 +214,9 @@ struct ptp_clock *ptp_clock_register(str
 	mutex_init(&ptp->pincfg_mux);
 	init_waitqueue_head(&ptp->tsev_wq);
 
-	/* Create a new device in our class. */
-	ptp->dev = device_create(ptp_class, parent, ptp->devid, ptp,
-				 "ptp%d", ptp->index);
-	if (IS_ERR(ptp->dev))
-		goto no_device;
-
-	dev_set_drvdata(ptp->dev, ptp);
-
-	err = ptp_populate_sysfs(ptp);
+	err = ptp_populate_pin_groups(ptp);
 	if (err)
-		goto no_sysfs;
+		goto no_pin_groups;
 
 	/* Register a new PPS source. */
 	if (info->pps) {
@@ -235,13 +227,24 @@ struct ptp_clock *ptp_clock_register(str
 		pps.owner = info->owner;
 		ptp->pps_source = pps_register_source(&pps, PTP_PPS_DEFAULTS);
 		if (!ptp->pps_source) {
+			err = -EINVAL;
 			pr_err("failed to register pps source\n");
 			goto no_pps;
 		}
 	}
 
-	/* Create a posix clock. */
-	err = posix_clock_register(&ptp->clock, ptp->devid);
+	/* Initialize a new device of our class in our clock structure. */
+	device_initialize(&ptp->dev);
+	ptp->dev.devt = ptp->devid;
+	ptp->dev.class = ptp_class;
+	ptp->dev.parent = parent;
+	ptp->dev.groups = ptp->pin_attr_groups;
+	ptp->dev.release = ptp_clock_release;
+	dev_set_drvdata(&ptp->dev, ptp);
+	dev_set_name(&ptp->dev, "ptp%d", ptp->index);
+
+	/* Create a posix clock and link it to the device. */
+	err = posix_clock_register(&ptp->clock, &ptp->dev);
 	if (err) {
 		pr_err("failed to create posix clock\n");
 		goto no_clock;
@@ -253,10 +256,8 @@ no_clock:
 	if (ptp->pps_source)
 		pps_unregister_source(ptp->pps_source);
 no_pps:
-	ptp_cleanup_sysfs(ptp);
-no_sysfs:
-	device_destroy(ptp_class, ptp->devid);
-no_device:
+	ptp_cleanup_pin_groups(ptp);
+no_pin_groups:
 	mutex_destroy(&ptp->tsevq_mux);
 	mutex_destroy(&ptp->pincfg_mux);
 	ida_simple_remove(&ptp_clocks_map, index);
@@ -275,10 +276,9 @@ int ptp_clock_unregister(struct ptp_cloc
 	/* Release the clock's resources. */
 	if (ptp->pps_source)
 		pps_unregister_source(ptp->pps_source);
-	ptp_cleanup_sysfs(ptp);
-	device_destroy(ptp_class, ptp->devid);
 
 	posix_clock_unregister(&ptp->clock);
+
 	return 0;
 }
 EXPORT_SYMBOL(ptp_clock_unregister);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/ptp/ptp_private.h linux-libre-4.9.224-gnu/drivers/ptp/ptp_private.h
--- linux-libre-4.9.223-gnu/drivers/ptp/ptp_private.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/ptp/ptp_private.h	2020-05-20 02:15:44.000000000 -0400
@@ -40,7 +40,7 @@ struct timestamp_event_queue {
 
 struct ptp_clock {
 	struct posix_clock clock;
-	struct device *dev;
+	struct device dev;
 	struct ptp_clock_info *info;
 	dev_t devid;
 	int index; /* index into clocks.map */
@@ -54,6 +54,8 @@ struct ptp_clock {
 	struct device_attribute *pin_dev_attr;
 	struct attribute **pin_attr;
 	struct attribute_group pin_attr_group;
+	/* 1st entry is a pointer to the real group, 2nd is NULL terminator */
+	const struct attribute_group *pin_attr_groups[2];
 };
 
 /*
@@ -94,8 +96,7 @@ uint ptp_poll(struct posix_clock *pc,
 
 extern const struct attribute_group *ptp_groups[];
 
-int ptp_cleanup_sysfs(struct ptp_clock *ptp);
-
-int ptp_populate_sysfs(struct ptp_clock *ptp);
+int ptp_populate_pin_groups(struct ptp_clock *ptp);
+void ptp_cleanup_pin_groups(struct ptp_clock *ptp);
 
 #endif
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/ptp/ptp_sysfs.c linux-libre-4.9.224-gnu/drivers/ptp/ptp_sysfs.c
--- linux-libre-4.9.223-gnu/drivers/ptp/ptp_sysfs.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/ptp/ptp_sysfs.c	2020-05-20 02:15:44.000000000 -0400
@@ -46,27 +46,6 @@ PTP_SHOW_INT(n_periodic_outputs, n_per_o
 PTP_SHOW_INT(n_programmable_pins, n_pins);
 PTP_SHOW_INT(pps_available, pps);
 
-static struct attribute *ptp_attrs[] = {
-	&dev_attr_clock_name.attr,
-	&dev_attr_max_adjustment.attr,
-	&dev_attr_n_alarms.attr,
-	&dev_attr_n_external_timestamps.attr,
-	&dev_attr_n_periodic_outputs.attr,
-	&dev_attr_n_programmable_pins.attr,
-	&dev_attr_pps_available.attr,
-	NULL,
-};
-
-static const struct attribute_group ptp_group = {
-	.attrs = ptp_attrs,
-};
-
-const struct attribute_group *ptp_groups[] = {
-	&ptp_group,
-	NULL,
-};
-
-
 static ssize_t extts_enable_store(struct device *dev,
 				  struct device_attribute *attr,
 				  const char *buf, size_t count)
@@ -91,6 +70,7 @@ static ssize_t extts_enable_store(struct
 out:
 	return err;
 }
+static DEVICE_ATTR(extts_enable, 0220, NULL, extts_enable_store);
 
 static ssize_t extts_fifo_show(struct device *dev,
 			       struct device_attribute *attr, char *page)
@@ -124,6 +104,7 @@ out:
 	mutex_unlock(&ptp->tsevq_mux);
 	return cnt;
 }
+static DEVICE_ATTR(fifo, 0444, extts_fifo_show, NULL);
 
 static ssize_t period_store(struct device *dev,
 			    struct device_attribute *attr,
@@ -151,6 +132,7 @@ static ssize_t period_store(struct devic
 out:
 	return err;
 }
+static DEVICE_ATTR(period, 0220, NULL, period_store);
 
 static ssize_t pps_enable_store(struct device *dev,
 				struct device_attribute *attr,
@@ -177,6 +159,57 @@ static ssize_t pps_enable_store(struct d
 out:
 	return err;
 }
+static DEVICE_ATTR(pps_enable, 0220, NULL, pps_enable_store);
+
+static struct attribute *ptp_attrs[] = {
+	&dev_attr_clock_name.attr,
+
+	&dev_attr_max_adjustment.attr,
+	&dev_attr_n_alarms.attr,
+	&dev_attr_n_external_timestamps.attr,
+	&dev_attr_n_periodic_outputs.attr,
+	&dev_attr_n_programmable_pins.attr,
+	&dev_attr_pps_available.attr,
+
+	&dev_attr_extts_enable.attr,
+	&dev_attr_fifo.attr,
+	&dev_attr_period.attr,
+	&dev_attr_pps_enable.attr,
+	NULL
+};
+
+static umode_t ptp_is_attribute_visible(struct kobject *kobj,
+					struct attribute *attr, int n)
+{
+	struct device *dev = kobj_to_dev(kobj);
+	struct ptp_clock *ptp = dev_get_drvdata(dev);
+	struct ptp_clock_info *info = ptp->info;
+	umode_t mode = attr->mode;
+
+	if (attr == &dev_attr_extts_enable.attr ||
+	    attr == &dev_attr_fifo.attr) {
+		if (!info->n_ext_ts)
+			mode = 0;
+	} else if (attr == &dev_attr_period.attr) {
+		if (!info->n_per_out)
+			mode = 0;
+	} else if (attr == &dev_attr_pps_enable.attr) {
+		if (!info->pps)
+			mode = 0;
+	}
+
+	return mode;
+}
+
+static const struct attribute_group ptp_group = {
+	.is_visible	= ptp_is_attribute_visible,
+	.attrs		= ptp_attrs,
+};
+
+const struct attribute_group *ptp_groups[] = {
+	&ptp_group,
+	NULL
+};
 
 static int ptp_pin_name2index(struct ptp_clock *ptp, const char *name)
 {
@@ -235,40 +268,14 @@ static ssize_t ptp_pin_store(struct devi
 	return count;
 }
 
-static DEVICE_ATTR(extts_enable, 0220, NULL, extts_enable_store);
-static DEVICE_ATTR(fifo,         0444, extts_fifo_show, NULL);
-static DEVICE_ATTR(period,       0220, NULL, period_store);
-static DEVICE_ATTR(pps_enable,   0220, NULL, pps_enable_store);
-
-int ptp_cleanup_sysfs(struct ptp_clock *ptp)
-{
-	struct device *dev = ptp->dev;
-	struct ptp_clock_info *info = ptp->info;
-
-	if (info->n_ext_ts) {
-		device_remove_file(dev, &dev_attr_extts_enable);
-		device_remove_file(dev, &dev_attr_fifo);
-	}
-	if (info->n_per_out)
-		device_remove_file(dev, &dev_attr_period);
-
-	if (info->pps)
-		device_remove_file(dev, &dev_attr_pps_enable);
-
-	if (info->n_pins) {
-		sysfs_remove_group(&dev->kobj, &ptp->pin_attr_group);
-		kfree(ptp->pin_attr);
-		kfree(ptp->pin_dev_attr);
-	}
-	return 0;
-}
-
-static int ptp_populate_pins(struct ptp_clock *ptp)
+int ptp_populate_pin_groups(struct ptp_clock *ptp)
 {
-	struct device *dev = ptp->dev;
 	struct ptp_clock_info *info = ptp->info;
 	int err = -ENOMEM, i, n_pins = info->n_pins;
 
+	if (!n_pins)
+		return 0;
+
 	ptp->pin_dev_attr = kzalloc(n_pins * sizeof(*ptp->pin_dev_attr),
 				    GFP_KERNEL);
 	if (!ptp->pin_dev_attr)
@@ -292,61 +299,18 @@ static int ptp_populate_pins(struct ptp_
 	ptp->pin_attr_group.name = "pins";
 	ptp->pin_attr_group.attrs = ptp->pin_attr;
 
-	err = sysfs_create_group(&dev->kobj, &ptp->pin_attr_group);
-	if (err)
-		goto no_group;
+	ptp->pin_attr_groups[0] = &ptp->pin_attr_group;
+
 	return 0;
 
-no_group:
-	kfree(ptp->pin_attr);
 no_pin_attr:
 	kfree(ptp->pin_dev_attr);
 no_dev_attr:
 	return err;
 }
 
-int ptp_populate_sysfs(struct ptp_clock *ptp)
+void ptp_cleanup_pin_groups(struct ptp_clock *ptp)
 {
-	struct device *dev = ptp->dev;
-	struct ptp_clock_info *info = ptp->info;
-	int err;
-
-	if (info->n_ext_ts) {
-		err = device_create_file(dev, &dev_attr_extts_enable);
-		if (err)
-			goto out1;
-		err = device_create_file(dev, &dev_attr_fifo);
-		if (err)
-			goto out2;
-	}
-	if (info->n_per_out) {
-		err = device_create_file(dev, &dev_attr_period);
-		if (err)
-			goto out3;
-	}
-	if (info->pps) {
-		err = device_create_file(dev, &dev_attr_pps_enable);
-		if (err)
-			goto out4;
-	}
-	if (info->n_pins) {
-		err = ptp_populate_pins(ptp);
-		if (err)
-			goto out5;
-	}
-	return 0;
-out5:
-	if (info->pps)
-		device_remove_file(dev, &dev_attr_pps_enable);
-out4:
-	if (info->n_per_out)
-		device_remove_file(dev, &dev_attr_period);
-out3:
-	if (info->n_ext_ts)
-		device_remove_file(dev, &dev_attr_fifo);
-out2:
-	if (info->n_ext_ts)
-		device_remove_file(dev, &dev_attr_extts_enable);
-out1:
-	return err;
+	kfree(ptp->pin_attr);
+	kfree(ptp->pin_dev_attr);
 }
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/scsi/sg.c linux-libre-4.9.224-gnu/drivers/scsi/sg.c
--- linux-libre-4.9.223-gnu/drivers/scsi/sg.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/scsi/sg.c	2020-05-20 02:15:44.000000000 -0400
@@ -695,8 +695,10 @@ sg_write(struct file *filp, const char _
 	hp->flags = input_size;	/* structure abuse ... */
 	hp->pack_id = old_hdr.pack_id;
 	hp->usr_ptr = NULL;
-	if (__copy_from_user(cmnd, buf, cmd_size))
+	if (__copy_from_user(cmnd, buf, cmd_size)) {
+		sg_remove_request(sfp, srp);
 		return -EFAULT;
+	}
 	/*
 	 * SG_DXFER_TO_FROM_DEV is functionally equivalent to SG_DXFER_FROM_DEV,
 	 * but is is possible that the app intended SG_DXFER_TO_DEV, because there
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/spi/spi-dw.c linux-libre-4.9.224-gnu/drivers/spi/spi-dw.c
--- linux-libre-4.9.223-gnu/drivers/spi/spi-dw.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/spi/spi-dw.c	2020-05-20 02:15:44.000000000 -0400
@@ -180,9 +180,11 @@ static inline u32 rx_max(struct dw_spi *
 
 static void dw_writer(struct dw_spi *dws)
 {
-	u32 max = tx_max(dws);
+	u32 max;
 	u16 txw = 0;
 
+	spin_lock(&dws->buf_lock);
+	max = tx_max(dws);
 	while (max--) {
 		/* Set the tx word if the transfer's original "tx" is not null */
 		if (dws->tx_end - dws->len) {
@@ -194,13 +196,16 @@ static void dw_writer(struct dw_spi *dws
 		dw_write_io_reg(dws, DW_SPI_DR, txw);
 		dws->tx += dws->n_bytes;
 	}
+	spin_unlock(&dws->buf_lock);
 }
 
 static void dw_reader(struct dw_spi *dws)
 {
-	u32 max = rx_max(dws);
+	u32 max;
 	u16 rxw;
 
+	spin_lock(&dws->buf_lock);
+	max = rx_max(dws);
 	while (max--) {
 		rxw = dw_read_io_reg(dws, DW_SPI_DR);
 		/* Care rx only if the transfer's original "rx" is not null */
@@ -212,6 +217,7 @@ static void dw_reader(struct dw_spi *dws
 		}
 		dws->rx += dws->n_bytes;
 	}
+	spin_unlock(&dws->buf_lock);
 }
 
 static void int_error_stop(struct dw_spi *dws, const char *msg)
@@ -284,18 +290,20 @@ static int dw_spi_transfer_one(struct sp
 {
 	struct dw_spi *dws = spi_master_get_devdata(master);
 	struct chip_data *chip = spi_get_ctldata(spi);
+	unsigned long flags;
 	u8 imask = 0;
 	u16 txlevel = 0;
 	u32 cr0;
 	int ret;
 
 	dws->dma_mapped = 0;
-
+	spin_lock_irqsave(&dws->buf_lock, flags);
 	dws->tx = (void *)transfer->tx_buf;
 	dws->tx_end = dws->tx + transfer->len;
 	dws->rx = transfer->rx_buf;
 	dws->rx_end = dws->rx + transfer->len;
 	dws->len = transfer->len;
+	spin_unlock_irqrestore(&dws->buf_lock, flags);
 
 	spi_enable_chip(dws, 0);
 
@@ -487,6 +495,7 @@ int dw_spi_add_host(struct device *dev,
 	dws->dma_inited = 0;
 	dws->dma_addr = (dma_addr_t)(dws->paddr + DW_SPI_DR);
 	snprintf(dws->name, sizeof(dws->name), "dw_spi%d", dws->bus_num);
+	spin_lock_init(&dws->buf_lock);
 
 	ret = request_irq(dws->irq, dw_spi_irq, IRQF_SHARED, dws->name, master);
 	if (ret < 0) {
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/spi/spi-dw.h linux-libre-4.9.224-gnu/drivers/spi/spi-dw.h
--- linux-libre-4.9.223-gnu/drivers/spi/spi-dw.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/spi/spi-dw.h	2020-05-20 02:15:44.000000000 -0400
@@ -117,6 +117,7 @@ struct dw_spi {
 	size_t			len;
 	void			*tx;
 	void			*tx_end;
+	spinlock_t		buf_lock;
 	void			*rx;
 	void			*rx_end;
 	int			dma_mapped;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/usb/gadget/configfs.c linux-libre-4.9.224-gnu/drivers/usb/gadget/configfs.c
--- linux-libre-4.9.223-gnu/drivers/usb/gadget/configfs.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/usb/gadget/configfs.c	2020-05-20 02:15:44.000000000 -0400
@@ -259,6 +259,9 @@ static ssize_t gadget_dev_desc_UDC_store
 	char *name;
 	int ret;
 
+	if (strlen(page) < len)
+		return -EOVERFLOW;
+
 	name = kstrdup(page, GFP_KERNEL);
 	if (!name)
 		return -ENOMEM;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/usb/gadget/legacy/audio.c linux-libre-4.9.224-gnu/drivers/usb/gadget/legacy/audio.c
--- linux-libre-4.9.223-gnu/drivers/usb/gadget/legacy/audio.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/usb/gadget/legacy/audio.c	2020-05-20 02:15:44.000000000 -0400
@@ -249,8 +249,10 @@ static int audio_bind(struct usb_composi
 		struct usb_descriptor_header *usb_desc;
 
 		usb_desc = usb_otg_descriptor_alloc(cdev->gadget);
-		if (!usb_desc)
+		if (!usb_desc) {
+			status = -ENOMEM;
 			goto fail;
+		}
 		usb_otg_descriptor_init(cdev->gadget, usb_desc);
 		otg_desc[0] = usb_desc;
 		otg_desc[1] = NULL;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/usb/gadget/legacy/cdc2.c linux-libre-4.9.224-gnu/drivers/usb/gadget/legacy/cdc2.c
--- linux-libre-4.9.223-gnu/drivers/usb/gadget/legacy/cdc2.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/usb/gadget/legacy/cdc2.c	2020-05-20 02:15:44.000000000 -0400
@@ -183,8 +183,10 @@ static int cdc_bind(struct usb_composite
 		struct usb_descriptor_header *usb_desc;
 
 		usb_desc = usb_otg_descriptor_alloc(gadget);
-		if (!usb_desc)
+		if (!usb_desc) {
+			status = -ENOMEM;
 			goto fail1;
+		}
 		usb_otg_descriptor_init(gadget, usb_desc);
 		otg_desc[0] = usb_desc;
 		otg_desc[1] = NULL;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/usb/gadget/legacy/ncm.c linux-libre-4.9.224-gnu/drivers/usb/gadget/legacy/ncm.c
--- linux-libre-4.9.223-gnu/drivers/usb/gadget/legacy/ncm.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/usb/gadget/legacy/ncm.c	2020-05-20 02:15:44.000000000 -0400
@@ -162,8 +162,10 @@ static int gncm_bind(struct usb_composit
 		struct usb_descriptor_header *usb_desc;
 
 		usb_desc = usb_otg_descriptor_alloc(gadget);
-		if (!usb_desc)
+		if (!usb_desc) {
+			status = -ENOMEM;
 			goto fail;
+		}
 		usb_otg_descriptor_init(gadget, usb_desc);
 		otg_desc[0] = usb_desc;
 		otg_desc[1] = NULL;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/usb/gadget/udc/net2272.c linux-libre-4.9.224-gnu/drivers/usb/gadget/udc/net2272.c
--- linux-libre-4.9.223-gnu/drivers/usb/gadget/udc/net2272.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/usb/gadget/udc/net2272.c	2020-05-20 02:15:44.000000000 -0400
@@ -2666,6 +2666,8 @@ net2272_plat_probe(struct platform_devic
  err_req:
 	release_mem_region(base, len);
  err:
+	kfree(dev);
+
 	return ret;
 }
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/usb/host/xhci-ring.c linux-libre-4.9.224-gnu/drivers/usb/host/xhci-ring.c
--- linux-libre-4.9.223-gnu/drivers/usb/host/xhci-ring.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/usb/host/xhci-ring.c	2020-05-20 02:15:44.000000000 -0400
@@ -3347,8 +3347,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
 			/* New sg entry */
 			--num_sgs;
 			sent_len -= block_len;
-			if (num_sgs != 0) {
-				sg = sg_next(sg);
+			sg = sg_next(sg);
+			if (num_sgs != 0 && sg) {
 				block_len = sg_dma_len(sg);
 				addr = (u64) sg_dma_address(sg);
 				addr += sent_len;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/usb/serial/garmin_gps.c linux-libre-4.9.224-gnu/drivers/usb/serial/garmin_gps.c
--- linux-libre-4.9.223-gnu/drivers/usb/serial/garmin_gps.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/usb/serial/garmin_gps.c	2020-05-20 02:15:44.000000000 -0400
@@ -1161,8 +1161,8 @@ static void garmin_read_process(struct g
 		   send it directly to the tty port */
 		if (garmin_data_p->flags & FLAGS_QUEUING) {
 			pkt_add(garmin_data_p, data, data_length);
-		} else if (bulk_data ||
-			   getLayerId(data) == GARMIN_LAYERID_APPL) {
+		} else if (bulk_data || (data_length >= sizeof(u32) &&
+				getLayerId(data) == GARMIN_LAYERID_APPL)) {
 
 			spin_lock_irqsave(&garmin_data_p->lock, flags);
 			garmin_data_p->flags |= APP_RESP_SEEN;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/usb/serial/qcserial.c linux-libre-4.9.224-gnu/drivers/usb/serial/qcserial.c
--- linux-libre-4.9.223-gnu/drivers/usb/serial/qcserial.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/usb/serial/qcserial.c	2020-05-20 02:15:44.000000000 -0400
@@ -177,6 +177,7 @@ static const struct usb_device_id id_tab
 	{DEVICE_SWI(0x413c, 0x81b3)},	/* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
 	{DEVICE_SWI(0x413c, 0x81b5)},	/* Dell Wireless 5811e QDL */
 	{DEVICE_SWI(0x413c, 0x81b6)},	/* Dell Wireless 5811e QDL */
+	{DEVICE_SWI(0x413c, 0x81cc)},	/* Dell Wireless 5816e */
 	{DEVICE_SWI(0x413c, 0x81cf)},   /* Dell Wireless 5819 */
 	{DEVICE_SWI(0x413c, 0x81d0)},   /* Dell Wireless 5819 */
 	{DEVICE_SWI(0x413c, 0x81d1)},   /* Dell Wireless 5818 */
diff -druNp --no-dereference linux-libre-4.9.223-gnu/drivers/usb/storage/unusual_uas.h linux-libre-4.9.224-gnu/drivers/usb/storage/unusual_uas.h
--- linux-libre-4.9.223-gnu/drivers/usb/storage/unusual_uas.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/drivers/usb/storage/unusual_uas.h	2020-05-20 02:15:44.000000000 -0400
@@ -41,6 +41,13 @@
  * and don't forget to CC: the USB development list <linux-usb@vger.kernel.org>
  */
 
+/* Reported-by: Julian Groß <julian.g@posteo.de> */
+UNUSUAL_DEV(0x059f, 0x105f, 0x0000, 0x9999,
+		"LaCie",
+		"2Big Quadra USB3",
+		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
+		US_FL_NO_REPORT_OPCODES),
+
 /*
  * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
  * commands in UAS mode.  Observed with the 1.28 firmware; are there others?
diff -druNp --no-dereference linux-libre-4.9.223-gnu/fs/binfmt_elf.c linux-libre-4.9.224-gnu/fs/binfmt_elf.c
--- linux-libre-4.9.223-gnu/fs/binfmt_elf.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/fs/binfmt_elf.c	2020-05-20 02:15:44.000000000 -0400
@@ -1100,6 +1100,18 @@ static int load_elf_binary(struct linux_
 	current->mm->start_stack = bprm->p;
 
 	if ((current->flags & PF_RANDOMIZE) && (randomize_va_space > 1)) {
+		/*
+		 * For architectures with ELF randomization, when executing
+		 * a loader directly (i.e. no interpreter listed in ELF
+		 * headers), move the brk area out of the mmap region
+		 * (since it grows up, and may collide early with the stack
+		 * growing down), and into the unused ELF_ET_DYN_BASE region.
+		 */
+		if (IS_ENABLED(CONFIG_ARCH_HAS_ELF_RANDOMIZE) &&
+		    loc->elf_ex.e_type == ET_DYN && !interpreter)
+			current->mm->brk = current->mm->start_brk =
+				ELF_ET_DYN_BASE;
+
 		current->mm->brk = current->mm->start_brk =
 			arch_randomize_brk(current->mm);
 #ifdef compat_brk_randomized
diff -druNp --no-dereference linux-libre-4.9.223-gnu/fs/char_dev.c linux-libre-4.9.224-gnu/fs/char_dev.c
--- linux-libre-4.9.223-gnu/fs/char_dev.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/fs/char_dev.c	2020-05-20 02:15:44.000000000 -0400
@@ -477,6 +477,85 @@ int cdev_add(struct cdev *p, dev_t dev,
 	return 0;
 }
 
+/**
+ * cdev_set_parent() - set the parent kobject for a char device
+ * @p: the cdev structure
+ * @kobj: the kobject to take a reference to
+ *
+ * cdev_set_parent() sets a parent kobject which will be referenced
+ * appropriately so the parent is not freed before the cdev. This
+ * should be called before cdev_add.
+ */
+void cdev_set_parent(struct cdev *p, struct kobject *kobj)
+{
+	WARN_ON(!kobj->state_initialized);
+	p->kobj.parent = kobj;
+}
+
+/**
+ * cdev_device_add() - add a char device and it's corresponding
+ *	struct device, linkink
+ * @dev: the device structure
+ * @cdev: the cdev structure
+ *
+ * cdev_device_add() adds the char device represented by @cdev to the system,
+ * just as cdev_add does. It then adds @dev to the system using device_add
+ * The dev_t for the char device will be taken from the struct device which
+ * needs to be initialized first. This helper function correctly takes a
+ * reference to the parent device so the parent will not get released until
+ * all references to the cdev are released.
+ *
+ * This helper uses dev->devt for the device number. If it is not set
+ * it will not add the cdev and it will be equivalent to device_add.
+ *
+ * This function should be used whenever the struct cdev and the
+ * struct device are members of the same structure whose lifetime is
+ * managed by the struct device.
+ *
+ * NOTE: Callers must assume that userspace was able to open the cdev and
+ * can call cdev fops callbacks at any time, even if this function fails.
+ */
+int cdev_device_add(struct cdev *cdev, struct device *dev)
+{
+	int rc = 0;
+
+	if (dev->devt) {
+		cdev_set_parent(cdev, &dev->kobj);
+
+		rc = cdev_add(cdev, dev->devt, 1);
+		if (rc)
+			return rc;
+	}
+
+	rc = device_add(dev);
+	if (rc)
+		cdev_del(cdev);
+
+	return rc;
+}
+
+/**
+ * cdev_device_del() - inverse of cdev_device_add
+ * @dev: the device structure
+ * @cdev: the cdev structure
+ *
+ * cdev_device_del() is a helper function to call cdev_del and device_del.
+ * It should be used whenever cdev_device_add is used.
+ *
+ * If dev->devt is not set it will not remove the cdev and will be equivalent
+ * to device_del.
+ *
+ * NOTE: This guarantees that associated sysfs callbacks are not running
+ * or runnable, however any cdevs already open will remain and their fops
+ * will still be callable even after this function returns.
+ */
+void cdev_device_del(struct cdev *cdev, struct device *dev)
+{
+	device_del(dev);
+	if (dev->devt)
+		cdev_del(cdev);
+}
+
 static void cdev_unmap(dev_t dev, unsigned count)
 {
 	kobj_unmap(cdev_map, dev, count);
@@ -488,6 +567,10 @@ static void cdev_unmap(dev_t dev, unsign
  *
  * cdev_del() removes @p from the system, possibly freeing the structure
  * itself.
+ *
+ * NOTE: This guarantees that cdev device will no longer be able to be
+ * opened, however any cdevs already open will remain and their fops will
+ * still be callable even after cdev_del returns.
  */
 void cdev_del(struct cdev *p)
 {
@@ -576,5 +659,8 @@ EXPORT_SYMBOL(cdev_init);
 EXPORT_SYMBOL(cdev_alloc);
 EXPORT_SYMBOL(cdev_del);
 EXPORT_SYMBOL(cdev_add);
+EXPORT_SYMBOL(cdev_set_parent);
+EXPORT_SYMBOL(cdev_device_add);
+EXPORT_SYMBOL(cdev_device_del);
 EXPORT_SYMBOL(__register_chrdev);
 EXPORT_SYMBOL(__unregister_chrdev);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/fs/cifs/cifssmb.c linux-libre-4.9.224-gnu/fs/cifs/cifssmb.c
--- linux-libre-4.9.223-gnu/fs/cifs/cifssmb.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/fs/cifs/cifssmb.c	2020-05-20 02:15:44.000000000 -0400
@@ -184,6 +184,18 @@ cifs_reconnect_tcon(struct cifs_tcon *tc
 	 * reconnect the same SMB session
 	 */
 	mutex_lock(&ses->session_mutex);
+
+	/*
+	 * Recheck after acquire mutex. If another thread is negotiating
+	 * and the server never sends an answer the socket will be closed
+	 * and tcpStatus set to reconnect.
+	 */
+	if (server->tcpStatus == CifsNeedReconnect) {
+		rc = -EHOSTDOWN;
+		mutex_unlock(&ses->session_mutex);
+		goto out;
+	}
+
 	rc = cifs_negotiate_protocol(0, ses);
 	if (rc == 0 && ses->need_reconnect)
 		rc = cifs_setup_session(0, ses, nls_codepage);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/fs/cifs/connect.c linux-libre-4.9.224-gnu/fs/cifs/connect.c
--- linux-libre-4.9.223-gnu/fs/cifs/connect.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/fs/cifs/connect.c	2020-05-20 02:15:44.000000000 -0400
@@ -551,20 +551,21 @@ static bool
 server_unresponsive(struct TCP_Server_Info *server)
 {
 	/*
-	 * We need to wait 2 echo intervals to make sure we handle such
+	 * We need to wait 3 echo intervals to make sure we handle such
 	 * situations right:
 	 * 1s  client sends a normal SMB request
-	 * 2s  client gets a response
+	 * 3s  client gets a response
 	 * 30s echo workqueue job pops, and decides we got a response recently
 	 *     and don't need to send another
 	 * ...
 	 * 65s kernel_recvmsg times out, and we see that we haven't gotten
 	 *     a response in >60s.
 	 */
-	if (server->tcpStatus == CifsGood &&
-	    time_after(jiffies, server->lstrp + 2 * server->echo_interval)) {
+	if ((server->tcpStatus == CifsGood ||
+	    server->tcpStatus == CifsNeedNegotiate) &&
+	    time_after(jiffies, server->lstrp + 3 * server->echo_interval)) {
 		cifs_dbg(VFS, "Server %s has not responded in %lu seconds. Reconnecting...\n",
-			 server->hostname, (2 * server->echo_interval) / HZ);
+			 server->hostname, (3 * server->echo_interval) / HZ);
 		cifs_reconnect(server);
 		wake_up(&server->response_q);
 		return true;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/fs/cifs/smb2pdu.c linux-libre-4.9.224-gnu/fs/cifs/smb2pdu.c
--- linux-libre-4.9.223-gnu/fs/cifs/smb2pdu.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/fs/cifs/smb2pdu.c	2020-05-20 02:15:44.000000000 -0400
@@ -246,6 +246,18 @@ smb2_reconnect(__le16 smb2_command, stru
 	 * the same SMB session
 	 */
 	mutex_lock(&tcon->ses->session_mutex);
+
+	/*
+	 * Recheck after acquire mutex. If another thread is negotiating
+	 * and the server never sends an answer the socket will be closed
+	 * and tcpStatus set to reconnect.
+	 */
+	if (server->tcpStatus == CifsNeedReconnect) {
+		rc = -EHOSTDOWN;
+		mutex_unlock(&tcon->ses->session_mutex);
+		goto out;
+	}
+
 	rc = cifs_negotiate_protocol(0, tcon->ses);
 	if (!rc && tcon->ses->need_reconnect) {
 		rc = cifs_setup_session(0, tcon->ses, nls_codepage);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/fs/exec.c linux-libre-4.9.224-gnu/fs/exec.c
--- linux-libre-4.9.223-gnu/fs/exec.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/fs/exec.c	2020-05-20 02:15:44.000000000 -0400
@@ -1270,6 +1270,8 @@ int flush_old_exec(struct linux_binprm *
 	 */
 	set_mm_exe_file(bprm->mm, bprm->file);
 
+	would_dump(bprm, bprm->file);
+
 	/*
 	 * Release all of the old mmap stuff
 	 */
@@ -1780,8 +1782,6 @@ static int do_execveat_common(int fd, st
 	if (retval < 0)
 		goto out;
 
-	would_dump(bprm, bprm->file);
-
 	retval = exec_binprm(bprm);
 	if (retval < 0)
 		goto out;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/fs/ext4/block_validity.c linux-libre-4.9.224-gnu/fs/ext4/block_validity.c
--- linux-libre-4.9.223-gnu/fs/ext4/block_validity.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/fs/ext4/block_validity.c	2020-05-20 02:15:44.000000000 -0400
@@ -152,6 +152,7 @@ static int ext4_protect_reserved_inode(s
 		return PTR_ERR(inode);
 	num = (inode->i_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits;
 	while (i < num) {
+		cond_resched();
 		map.m_lblk = i;
 		map.m_len = num - i;
 		n = ext4_map_blocks(NULL, inode, &map, 0);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/linux/blkdev.h linux-libre-4.9.224-gnu/include/linux/blkdev.h
--- linux-libre-4.9.223-gnu/include/linux/blkdev.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/linux/blkdev.h	2020-05-20 02:15:44.000000000 -0400
@@ -445,7 +445,8 @@ struct request_queue {
 	unsigned int		sg_reserved_size;
 	int			node;
 #ifdef CONFIG_BLK_DEV_IO_TRACE
-	struct blk_trace	*blk_trace;
+	struct blk_trace __rcu	*blk_trace;
+	struct mutex		blk_trace_mutex;
 #endif
 	/*
 	 * for flush operations
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/linux/blktrace_api.h linux-libre-4.9.224-gnu/include/linux/blktrace_api.h
--- linux-libre-4.9.223-gnu/include/linux/blktrace_api.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/linux/blktrace_api.h	2020-05-20 02:15:44.000000000 -0400
@@ -51,18 +51,26 @@ void __trace_note_message(struct blk_tra
  **/
 #define blk_add_trace_msg(q, fmt, ...)					\
 	do {								\
-		struct blk_trace *bt = (q)->blk_trace;			\
+		struct blk_trace *bt;					\
+									\
+		rcu_read_lock();					\
+		bt = rcu_dereference((q)->blk_trace);			\
 		if (unlikely(bt))					\
 			__trace_note_message(bt, fmt, ##__VA_ARGS__);	\
+		rcu_read_unlock();					\
 	} while (0)
 #define BLK_TN_MAX_MSG		128
 
 static inline bool blk_trace_note_message_enabled(struct request_queue *q)
 {
-	struct blk_trace *bt = q->blk_trace;
-	if (likely(!bt))
-		return false;
-	return bt->act_mask & BLK_TC_NOTIFY;
+	struct blk_trace *bt;
+	bool ret;
+
+	rcu_read_lock();
+	bt = rcu_dereference(q->blk_trace);
+	ret = bt && (bt->act_mask & BLK_TC_NOTIFY);
+	rcu_read_unlock();
+	return ret;
 }
 
 extern void blk_add_driver_data(struct request_queue *q, struct request *rq,
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/linux/cdev.h linux-libre-4.9.224-gnu/include/linux/cdev.h
--- linux-libre-4.9.223-gnu/include/linux/cdev.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/linux/cdev.h	2020-05-20 02:15:44.000000000 -0400
@@ -4,6 +4,7 @@
 #include <linux/kobject.h>
 #include <linux/kdev_t.h>
 #include <linux/list.h>
+#include <linux/device.h>
 
 struct file_operations;
 struct inode;
@@ -26,6 +27,10 @@ void cdev_put(struct cdev *p);
 
 int cdev_add(struct cdev *, dev_t, unsigned);
 
+void cdev_set_parent(struct cdev *p, struct kobject *kobj);
+int cdev_device_add(struct cdev *cdev, struct device *dev);
+void cdev_device_del(struct cdev *cdev, struct device *dev);
+
 void cdev_del(struct cdev *);
 
 void cd_forget(struct inode *);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/linux/compiler.h linux-libre-4.9.224-gnu/include/linux/compiler.h
--- linux-libre-4.9.223-gnu/include/linux/compiler.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/linux/compiler.h	2020-05-20 02:15:44.000000000 -0400
@@ -605,4 +605,11 @@ unsigned long read_word_at_a_time(const
 # define __kprobes
 # define nokprobe_inline	inline
 #endif
+
+/*
+ * This is needed in functions which generate the stack canary, see
+ * arch/x86/kernel/smpboot.c::start_secondary() for an example.
+ */
+#define prevent_tail_call_optimization()	mb()
+
 #endif /* __LINUX_COMPILER_H */
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/linux/fs.h linux-libre-4.9.224-gnu/include/linux/fs.h
--- linux-libre-4.9.223-gnu/include/linux/fs.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/linux/fs.h	2020-05-20 02:15:44.000000000 -0400
@@ -931,7 +931,7 @@ struct file_handle {
 	__u32 handle_bytes;
 	int handle_type;
 	/* file identifier */
-	unsigned char f_handle[0];
+	unsigned char f_handle[];
 };
 
 static inline struct file *get_file(struct file *f)
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/linux/pnp.h linux-libre-4.9.224-gnu/include/linux/pnp.h
--- linux-libre-4.9.223-gnu/include/linux/pnp.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/linux/pnp.h	2020-05-20 02:15:44.000000000 -0400
@@ -219,10 +219,8 @@ struct pnp_card {
 #define global_to_pnp_card(n) list_entry(n, struct pnp_card, global_list)
 #define protocol_to_pnp_card(n) list_entry(n, struct pnp_card, protocol_list)
 #define to_pnp_card(n) container_of(n, struct pnp_card, dev)
-#define pnp_for_each_card(card) \
-	for((card) = global_to_pnp_card(pnp_cards.next); \
-	(card) != global_to_pnp_card(&pnp_cards); \
-	(card) = global_to_pnp_card((card)->global_list.next))
+#define pnp_for_each_card(card)	\
+	list_for_each_entry(card, &pnp_cards, global_list)
 
 struct pnp_card_link {
 	struct pnp_card *card;
@@ -275,14 +273,9 @@ struct pnp_dev {
 #define card_to_pnp_dev(n) list_entry(n, struct pnp_dev, card_list)
 #define protocol_to_pnp_dev(n) list_entry(n, struct pnp_dev, protocol_list)
 #define	to_pnp_dev(n) container_of(n, struct pnp_dev, dev)
-#define pnp_for_each_dev(dev) \
-	for((dev) = global_to_pnp_dev(pnp_global.next); \
-	(dev) != global_to_pnp_dev(&pnp_global); \
-	(dev) = global_to_pnp_dev((dev)->global_list.next))
-#define card_for_each_dev(card,dev) \
-	for((dev) = card_to_pnp_dev((card)->devices.next); \
-	(dev) != card_to_pnp_dev(&(card)->devices); \
-	(dev) = card_to_pnp_dev((dev)->card_list.next))
+#define pnp_for_each_dev(dev) list_for_each_entry(dev, &pnp_global, global_list)
+#define card_for_each_dev(card, dev)	\
+	list_for_each_entry(dev, &(card)->devices, card_list)
 #define pnp_dev_name(dev) (dev)->name
 
 static inline void *pnp_get_drvdata(struct pnp_dev *pdev)
@@ -436,14 +429,10 @@ struct pnp_protocol {
 };
 
 #define to_pnp_protocol(n) list_entry(n, struct pnp_protocol, protocol_list)
-#define protocol_for_each_card(protocol,card) \
-	for((card) = protocol_to_pnp_card((protocol)->cards.next); \
-	(card) != protocol_to_pnp_card(&(protocol)->cards); \
-	(card) = protocol_to_pnp_card((card)->protocol_list.next))
-#define protocol_for_each_dev(protocol,dev) \
-	for((dev) = protocol_to_pnp_dev((protocol)->devices.next); \
-	(dev) != protocol_to_pnp_dev(&(protocol)->devices); \
-	(dev) = protocol_to_pnp_dev((dev)->protocol_list.next))
+#define protocol_for_each_card(protocol, card)	\
+	list_for_each_entry(card, &(protocol)->cards, protocol_list)
+#define protocol_for_each_dev(protocol, dev)	\
+	list_for_each_entry(dev, &(protocol)->devices, protocol_list)
 
 extern struct bus_type pnp_bus_type;
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/linux/posix-clock.h linux-libre-4.9.224-gnu/include/linux/posix-clock.h
--- linux-libre-4.9.223-gnu/include/linux/posix-clock.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/linux/posix-clock.h	2020-05-20 02:15:44.000000000 -0400
@@ -104,29 +104,32 @@ struct posix_clock_operations {
  *
  * @ops:     Functional interface to the clock
  * @cdev:    Character device instance for this clock
- * @kref:    Reference count.
+ * @dev:     Pointer to the clock's device.
  * @rwsem:   Protects the 'zombie' field from concurrent access.
  * @zombie:  If 'zombie' is true, then the hardware has disappeared.
- * @release: A function to free the structure when the reference count reaches
- *           zero. May be NULL if structure is statically allocated.
  *
  * Drivers should embed their struct posix_clock within a private
  * structure, obtaining a reference to it during callbacks using
  * container_of().
+ *
+ * Drivers should supply an initialized but not exposed struct device
+ * to posix_clock_register(). It is used to manage lifetime of the
+ * driver's private structure. It's 'release' field should be set to
+ * a release function for this private structure.
  */
 struct posix_clock {
 	struct posix_clock_operations ops;
 	struct cdev cdev;
-	struct kref kref;
+	struct device *dev;
 	struct rw_semaphore rwsem;
 	bool zombie;
-	void (*release)(struct posix_clock *clk);
 };
 
 /**
  * posix_clock_register() - register a new clock
- * @clk:   Pointer to the clock. Caller must provide 'ops' and 'release'
- * @devid: Allocated device id
+ * @clk:   Pointer to the clock. Caller must provide 'ops' field
+ * @dev:   Pointer to the initialized device. Caller must provide
+ *         'release' field
  *
  * A clock driver calls this function to register itself with the
  * clock device subsystem. If 'clk' points to dynamically allocated
@@ -135,7 +138,7 @@ struct posix_clock {
  *
  * Returns zero on success, non-zero otherwise.
  */
-int posix_clock_register(struct posix_clock *clk, dev_t devid);
+int posix_clock_register(struct posix_clock *clk, struct device *dev);
 
 /**
  * posix_clock_unregister() - unregister a clock
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/linux/tty.h linux-libre-4.9.224-gnu/include/linux/tty.h
--- linux-libre-4.9.223-gnu/include/linux/tty.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/linux/tty.h	2020-05-20 02:15:44.000000000 -0400
@@ -64,7 +64,7 @@ struct tty_buffer {
 	int read;
 	int flags;
 	/* Data points here */
-	unsigned long data[0];
+	unsigned long data[];
 };
 
 /* Values for .flags field of tty_buffer */
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/net/addrconf.h linux-libre-4.9.224-gnu/include/net/addrconf.h
--- linux-libre-4.9.223-gnu/include/net/addrconf.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/net/addrconf.h	2020-05-20 02:15:44.000000000 -0400
@@ -206,8 +206,10 @@ struct ipv6_stub {
 				 const struct in6_addr *addr);
 	int (*ipv6_sock_mc_drop)(struct sock *sk, int ifindex,
 				 const struct in6_addr *addr);
-	int (*ipv6_dst_lookup)(struct net *net, struct sock *sk,
-			       struct dst_entry **dst, struct flowi6 *fl6);
+	struct dst_entry *(*ipv6_dst_lookup_flow)(struct net *net,
+						  const struct sock *sk,
+						  struct flowi6 *fl6,
+						  const struct in6_addr *final_dst);
 	void (*udpv6_encap_enable)(void);
 	void (*ndisc_send_na)(struct net_device *dev, const struct in6_addr *daddr,
 			      const struct in6_addr *solicited_addr,
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/net/ipv6.h linux-libre-4.9.224-gnu/include/net/ipv6.h
--- linux-libre-4.9.223-gnu/include/net/ipv6.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/net/ipv6.h	2020-05-20 02:15:44.000000000 -0400
@@ -856,7 +856,7 @@ static inline struct sk_buff *ip6_finish
 
 int ip6_dst_lookup(struct net *net, struct sock *sk, struct dst_entry **dst,
 		   struct flowi6 *fl6);
-struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,
+struct dst_entry *ip6_dst_lookup_flow(struct net *net, const struct sock *sk, struct flowi6 *fl6,
 				      const struct in6_addr *final_dst);
 struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
 					 const struct in6_addr *final_dst);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/net/netfilter/nf_conntrack.h linux-libre-4.9.224-gnu/include/net/netfilter/nf_conntrack.h
--- linux-libre-4.9.223-gnu/include/net/netfilter/nf_conntrack.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/net/netfilter/nf_conntrack.h	2020-05-20 02:15:44.000000000 -0400
@@ -103,7 +103,7 @@ struct nf_conn {
 	struct hlist_node	nat_bysource;
 #endif
 	/* all members below initialized via memset */
-	u8 __nfct_init_offset[0];
+	struct { } __nfct_init_offset;
 
 	/* If we were expected by an expectation, this will be it */
 	struct nf_conn *master;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/include/sound/rawmidi.h linux-libre-4.9.224-gnu/include/sound/rawmidi.h
--- linux-libre-4.9.223-gnu/include/sound/rawmidi.h	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/include/sound/rawmidi.h	2020-05-20 02:15:44.000000000 -0400
@@ -76,6 +76,7 @@ struct snd_rawmidi_runtime {
 	size_t avail_min;	/* min avail for wakeup */
 	size_t avail;		/* max used buffer for wakeup */
 	size_t xruns;		/* over/underruns counter */
+	int buffer_ref;		/* buffer reference count */
 	/* misc */
 	spinlock_t lock;
 	wait_queue_head_t sleep;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/init/main.c linux-libre-4.9.224-gnu/init/main.c
--- linux-libre-4.9.223-gnu/init/main.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/init/main.c	2020-05-20 02:15:44.000000000 -0400
@@ -662,6 +662,8 @@ asmlinkage __visible void __init start_k
 
 	/* Do the rest non-__init'ed, we're now alive */
 	rest_init();
+
+	prevent_tail_call_optimization();
 }
 
 /* Call all constructor functions linked into the kernel. */
diff -druNp --no-dereference linux-libre-4.9.223-gnu/ipc/util.c linux-libre-4.9.224-gnu/ipc/util.c
--- linux-libre-4.9.223-gnu/ipc/util.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/ipc/util.c	2020-05-20 02:15:44.000000000 -0400
@@ -751,21 +751,21 @@ static struct kern_ipc_perm *sysvipc_fin
 			total++;
 	}
 
-	*new_pos = pos + 1;
+	ipc = NULL;
 	if (total >= ids->in_use)
-		return NULL;
+		goto out;
 
 	for (; pos < IPCMNI; pos++) {
 		ipc = idr_find(&ids->ipcs_idr, pos);
 		if (ipc != NULL) {
 			rcu_read_lock();
 			ipc_lock_object(ipc);
-			return ipc;
+			break;
 		}
 	}
-
-	/* Out of range - return NULL to terminate iteration */
-	return NULL;
+out:
+	*new_pos = pos + 1;
+	return ipc;
 }
 
 static void *sysvipc_proc_next(struct seq_file *s, void *it, loff_t *pos)
diff -druNp --no-dereference linux-libre-4.9.223-gnu/kernel/time/posix-clock.c linux-libre-4.9.224-gnu/kernel/time/posix-clock.c
--- linux-libre-4.9.223-gnu/kernel/time/posix-clock.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/kernel/time/posix-clock.c	2020-05-20 02:15:44.000000000 -0400
@@ -25,8 +25,6 @@
 #include <linux/syscalls.h>
 #include <linux/uaccess.h>
 
-static void delete_clock(struct kref *kref);
-
 /*
  * Returns NULL if the posix_clock instance attached to 'fp' is old and stale.
  */
@@ -168,7 +166,7 @@ static int posix_clock_open(struct inode
 		err = 0;
 
 	if (!err) {
-		kref_get(&clk->kref);
+		get_device(clk->dev);
 		fp->private_data = clk;
 	}
 out:
@@ -184,7 +182,7 @@ static int posix_clock_release(struct in
 	if (clk->ops.release)
 		err = clk->ops.release(clk);
 
-	kref_put(&clk->kref, delete_clock);
+	put_device(clk->dev);
 
 	fp->private_data = NULL;
 
@@ -206,38 +204,35 @@ static const struct file_operations posi
 #endif
 };
 
-int posix_clock_register(struct posix_clock *clk, dev_t devid)
+int posix_clock_register(struct posix_clock *clk, struct device *dev)
 {
 	int err;
 
-	kref_init(&clk->kref);
 	init_rwsem(&clk->rwsem);
 
 	cdev_init(&clk->cdev, &posix_clock_file_operations);
+	err = cdev_device_add(&clk->cdev, dev);
+	if (err) {
+		pr_err("%s unable to add device %d:%d\n",
+			dev_name(dev), MAJOR(dev->devt), MINOR(dev->devt));
+		return err;
+	}
 	clk->cdev.owner = clk->ops.owner;
-	err = cdev_add(&clk->cdev, devid, 1);
+	clk->dev = dev;
 
-	return err;
+	return 0;
 }
 EXPORT_SYMBOL_GPL(posix_clock_register);
 
-static void delete_clock(struct kref *kref)
-{
-	struct posix_clock *clk = container_of(kref, struct posix_clock, kref);
-
-	if (clk->release)
-		clk->release(clk);
-}
-
 void posix_clock_unregister(struct posix_clock *clk)
 {
-	cdev_del(&clk->cdev);
+	cdev_device_del(&clk->cdev, clk->dev);
 
 	down_write(&clk->rwsem);
 	clk->zombie = true;
 	up_write(&clk->rwsem);
 
-	kref_put(&clk->kref, delete_clock);
+	put_device(clk->dev);
 }
 EXPORT_SYMBOL_GPL(posix_clock_unregister);
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/kernel/trace/blktrace.c linux-libre-4.9.224-gnu/kernel/trace/blktrace.c
--- linux-libre-4.9.223-gnu/kernel/trace/blktrace.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/kernel/trace/blktrace.c	2020-05-20 02:15:44.000000000 -0400
@@ -325,11 +325,12 @@ static void put_probe_ref(void)
 
 static void blk_trace_cleanup(struct blk_trace *bt)
 {
+	synchronize_rcu();
 	blk_trace_free(bt);
 	put_probe_ref();
 }
 
-int blk_trace_remove(struct request_queue *q)
+static int __blk_trace_remove(struct request_queue *q)
 {
 	struct blk_trace *bt;
 
@@ -342,6 +343,17 @@ int blk_trace_remove(struct request_queu
 
 	return 0;
 }
+
+int blk_trace_remove(struct request_queue *q)
+{
+	int ret;
+
+	mutex_lock(&q->blk_trace_mutex);
+	ret = __blk_trace_remove(q);
+	mutex_unlock(&q->blk_trace_mutex);
+
+	return ret;
+}
 EXPORT_SYMBOL_GPL(blk_trace_remove);
 
 static ssize_t blk_dropped_read(struct file *filp, char __user *buffer,
@@ -546,9 +558,8 @@ err:
 	return ret;
 }
 
-int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
-		    struct block_device *bdev,
-		    char __user *arg)
+static int __blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
+			     struct block_device *bdev, char __user *arg)
 {
 	struct blk_user_trace_setup buts;
 	int ret;
@@ -562,11 +573,24 @@ int blk_trace_setup(struct request_queue
 		return ret;
 
 	if (copy_to_user(arg, &buts, sizeof(buts))) {
-		blk_trace_remove(q);
+		__blk_trace_remove(q);
 		return -EFAULT;
 	}
 	return 0;
 }
+
+int blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
+		    struct block_device *bdev,
+		    char __user *arg)
+{
+	int ret;
+
+	mutex_lock(&q->blk_trace_mutex);
+	ret = __blk_trace_setup(q, name, dev, bdev, arg);
+	mutex_unlock(&q->blk_trace_mutex);
+
+	return ret;
+}
 EXPORT_SYMBOL_GPL(blk_trace_setup);
 
 #if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
@@ -595,7 +619,7 @@ static int compat_blk_trace_setup(struct
 		return ret;
 
 	if (copy_to_user(arg, &buts.name, ARRAY_SIZE(buts.name))) {
-		blk_trace_remove(q);
+		__blk_trace_remove(q);
 		return -EFAULT;
 	}
 
@@ -603,11 +627,13 @@ static int compat_blk_trace_setup(struct
 }
 #endif
 
-int blk_trace_startstop(struct request_queue *q, int start)
+static int __blk_trace_startstop(struct request_queue *q, int start)
 {
 	int ret;
-	struct blk_trace *bt = q->blk_trace;
+	struct blk_trace *bt;
 
+	bt = rcu_dereference_protected(q->blk_trace,
+				       lockdep_is_held(&q->blk_trace_mutex));
 	if (bt == NULL)
 		return -EINVAL;
 
@@ -642,8 +668,25 @@ int blk_trace_startstop(struct request_q
 
 	return ret;
 }
+
+int blk_trace_startstop(struct request_queue *q, int start)
+{
+	int ret;
+
+	mutex_lock(&q->blk_trace_mutex);
+	ret = __blk_trace_startstop(q, start);
+	mutex_unlock(&q->blk_trace_mutex);
+
+	return ret;
+}
 EXPORT_SYMBOL_GPL(blk_trace_startstop);
 
+/*
+ * When reading or writing the blktrace sysfs files, the references to the
+ * opened sysfs or device files should prevent the underlying block device
+ * from being removed. So no further delete protection is really needed.
+ */
+
 /**
  * blk_trace_ioctl: - handle the ioctls associated with tracing
  * @bdev:	the block device
@@ -661,12 +704,12 @@ int blk_trace_ioctl(struct block_device
 	if (!q)
 		return -ENXIO;
 
-	mutex_lock(&bdev->bd_mutex);
+	mutex_lock(&q->blk_trace_mutex);
 
 	switch (cmd) {
 	case BLKTRACESETUP:
 		bdevname(bdev, b);
-		ret = blk_trace_setup(q, b, bdev->bd_dev, bdev, arg);
+		ret = __blk_trace_setup(q, b, bdev->bd_dev, bdev, arg);
 		break;
 #if defined(CONFIG_COMPAT) && defined(CONFIG_X86_64)
 	case BLKTRACESETUP32:
@@ -677,17 +720,17 @@ int blk_trace_ioctl(struct block_device
 	case BLKTRACESTART:
 		start = 1;
 	case BLKTRACESTOP:
-		ret = blk_trace_startstop(q, start);
+		ret = __blk_trace_startstop(q, start);
 		break;
 	case BLKTRACETEARDOWN:
-		ret = blk_trace_remove(q);
+		ret = __blk_trace_remove(q);
 		break;
 	default:
 		ret = -ENOTTY;
 		break;
 	}
 
-	mutex_unlock(&bdev->bd_mutex);
+	mutex_unlock(&q->blk_trace_mutex);
 	return ret;
 }
 
@@ -698,10 +741,14 @@ int blk_trace_ioctl(struct block_device
  **/
 void blk_trace_shutdown(struct request_queue *q)
 {
-	if (q->blk_trace) {
-		blk_trace_startstop(q, 0);
-		blk_trace_remove(q);
+	mutex_lock(&q->blk_trace_mutex);
+	if (rcu_dereference_protected(q->blk_trace,
+				      lockdep_is_held(&q->blk_trace_mutex))) {
+		__blk_trace_startstop(q, 0);
+		__blk_trace_remove(q);
 	}
+
+	mutex_unlock(&q->blk_trace_mutex);
 }
 
 /*
@@ -722,10 +769,14 @@ void blk_trace_shutdown(struct request_q
 static void blk_add_trace_rq(struct request_queue *q, struct request *rq,
 			     unsigned int nr_bytes, u32 what)
 {
-	struct blk_trace *bt = q->blk_trace;
+	struct blk_trace *bt;
 
-	if (likely(!bt))
+	rcu_read_lock();
+	bt = rcu_dereference(q->blk_trace);
+	if (likely(!bt)) {
+		rcu_read_unlock();
 		return;
+	}
 
 	if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
 		what |= BLK_TC_ACT(BLK_TC_PC);
@@ -736,6 +787,7 @@ static void blk_add_trace_rq(struct requ
 		__blk_add_trace(bt, blk_rq_pos(rq), nr_bytes, req_op(rq),
 				rq->cmd_flags, what, rq->errors, 0, NULL);
 	}
+	rcu_read_unlock();
 }
 
 static void blk_add_trace_rq_abort(void *ignore,
@@ -785,13 +837,18 @@ static void blk_add_trace_rq_complete(vo
 static void blk_add_trace_bio(struct request_queue *q, struct bio *bio,
 			      u32 what, int error)
 {
-	struct blk_trace *bt = q->blk_trace;
+	struct blk_trace *bt;
 
-	if (likely(!bt))
+	rcu_read_lock();
+	bt = rcu_dereference(q->blk_trace);
+	if (likely(!bt)) {
+		rcu_read_unlock();
 		return;
+	}
 
 	__blk_add_trace(bt, bio->bi_iter.bi_sector, bio->bi_iter.bi_size,
 			bio_op(bio), bio->bi_opf, what, error, 0, NULL);
+	rcu_read_unlock();
 }
 
 static void blk_add_trace_bio_bounce(void *ignore,
@@ -836,11 +893,14 @@ static void blk_add_trace_getrq(void *ig
 	if (bio)
 		blk_add_trace_bio(q, bio, BLK_TA_GETRQ, 0);
 	else {
-		struct blk_trace *bt = q->blk_trace;
+		struct blk_trace *bt;
 
+		rcu_read_lock();
+		bt = rcu_dereference(q->blk_trace);
 		if (bt)
 			__blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_GETRQ, 0, 0,
 					NULL);
+		rcu_read_unlock();
 	}
 }
 
@@ -852,27 +912,35 @@ static void blk_add_trace_sleeprq(void *
 	if (bio)
 		blk_add_trace_bio(q, bio, BLK_TA_SLEEPRQ, 0);
 	else {
-		struct blk_trace *bt = q->blk_trace;
+		struct blk_trace *bt;
 
+		rcu_read_lock();
+		bt = rcu_dereference(q->blk_trace);
 		if (bt)
 			__blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_SLEEPRQ,
 					0, 0, NULL);
+		rcu_read_unlock();
 	}
 }
 
 static void blk_add_trace_plug(void *ignore, struct request_queue *q)
 {
-	struct blk_trace *bt = q->blk_trace;
+	struct blk_trace *bt;
 
+	rcu_read_lock();
+	bt = rcu_dereference(q->blk_trace);
 	if (bt)
 		__blk_add_trace(bt, 0, 0, 0, 0, BLK_TA_PLUG, 0, 0, NULL);
+	rcu_read_unlock();
 }
 
 static void blk_add_trace_unplug(void *ignore, struct request_queue *q,
 				    unsigned int depth, bool explicit)
 {
-	struct blk_trace *bt = q->blk_trace;
+	struct blk_trace *bt;
 
+	rcu_read_lock();
+	bt = rcu_dereference(q->blk_trace);
 	if (bt) {
 		__be64 rpdu = cpu_to_be64(depth);
 		u32 what;
@@ -884,14 +952,17 @@ static void blk_add_trace_unplug(void *i
 
 		__blk_add_trace(bt, 0, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu);
 	}
+	rcu_read_unlock();
 }
 
 static void blk_add_trace_split(void *ignore,
 				struct request_queue *q, struct bio *bio,
 				unsigned int pdu)
 {
-	struct blk_trace *bt = q->blk_trace;
+	struct blk_trace *bt;
 
+	rcu_read_lock();
+	bt = rcu_dereference(q->blk_trace);
 	if (bt) {
 		__be64 rpdu = cpu_to_be64(pdu);
 
@@ -900,6 +971,7 @@ static void blk_add_trace_split(void *ig
 				BLK_TA_SPLIT, bio->bi_error, sizeof(rpdu),
 				&rpdu);
 	}
+	rcu_read_unlock();
 }
 
 /**
@@ -919,11 +991,15 @@ static void blk_add_trace_bio_remap(void
 				    struct request_queue *q, struct bio *bio,
 				    dev_t dev, sector_t from)
 {
-	struct blk_trace *bt = q->blk_trace;
+	struct blk_trace *bt;
 	struct blk_io_trace_remap r;
 
-	if (likely(!bt))
+	rcu_read_lock();
+	bt = rcu_dereference(q->blk_trace);
+	if (likely(!bt)) {
+		rcu_read_unlock();
 		return;
+	}
 
 	r.device_from = cpu_to_be32(dev);
 	r.device_to   = cpu_to_be32(bio->bi_bdev->bd_dev);
@@ -932,6 +1008,7 @@ static void blk_add_trace_bio_remap(void
 	__blk_add_trace(bt, bio->bi_iter.bi_sector, bio->bi_iter.bi_size,
 			bio_op(bio), bio->bi_opf, BLK_TA_REMAP, bio->bi_error,
 			sizeof(r), &r);
+	rcu_read_unlock();
 }
 
 /**
@@ -952,11 +1029,15 @@ static void blk_add_trace_rq_remap(void
 				   struct request *rq, dev_t dev,
 				   sector_t from)
 {
-	struct blk_trace *bt = q->blk_trace;
+	struct blk_trace *bt;
 	struct blk_io_trace_remap r;
 
-	if (likely(!bt))
+	rcu_read_lock();
+	bt = rcu_dereference(q->blk_trace);
+	if (likely(!bt)) {
+		rcu_read_unlock();
 		return;
+	}
 
 	r.device_from = cpu_to_be32(dev);
 	r.device_to   = cpu_to_be32(disk_devt(rq->rq_disk));
@@ -965,6 +1046,7 @@ static void blk_add_trace_rq_remap(void
 	__blk_add_trace(bt, blk_rq_pos(rq), blk_rq_bytes(rq),
 			rq_data_dir(rq), 0, BLK_TA_REMAP, !!rq->errors,
 			sizeof(r), &r);
+	rcu_read_unlock();
 }
 
 /**
@@ -982,10 +1064,14 @@ void blk_add_driver_data(struct request_
 			 struct request *rq,
 			 void *data, size_t len)
 {
-	struct blk_trace *bt = q->blk_trace;
+	struct blk_trace *bt;
 
-	if (likely(!bt))
+	rcu_read_lock();
+	bt = rcu_dereference(q->blk_trace);
+	if (likely(!bt)) {
+		rcu_read_unlock();
 		return;
+	}
 
 	if (rq->cmd_type == REQ_TYPE_BLOCK_PC)
 		__blk_add_trace(bt, 0, blk_rq_bytes(rq), 0, 0,
@@ -993,6 +1079,7 @@ void blk_add_driver_data(struct request_
 	else
 		__blk_add_trace(bt, blk_rq_pos(rq), blk_rq_bytes(rq), 0, 0,
 				BLK_TA_DRV_DATA, rq->errors, len, data);
+	rcu_read_unlock();
 }
 EXPORT_SYMBOL_GPL(blk_add_driver_data);
 
@@ -1485,6 +1572,7 @@ static int blk_trace_remove_queue(struct
 		return -EINVAL;
 
 	put_probe_ref();
+	synchronize_rcu();
 	blk_trace_free(bt);
 	return 0;
 }
@@ -1646,6 +1734,7 @@ static ssize_t sysfs_blk_trace_attr_show
 	struct hd_struct *p = dev_to_part(dev);
 	struct request_queue *q;
 	struct block_device *bdev;
+	struct blk_trace *bt;
 	ssize_t ret = -ENXIO;
 
 	bdev = bdget(part_devt(p));
@@ -1656,26 +1745,28 @@ static ssize_t sysfs_blk_trace_attr_show
 	if (q == NULL)
 		goto out_bdput;
 
-	mutex_lock(&bdev->bd_mutex);
+	mutex_lock(&q->blk_trace_mutex);
 
+	bt = rcu_dereference_protected(q->blk_trace,
+				       lockdep_is_held(&q->blk_trace_mutex));
 	if (attr == &dev_attr_enable) {
-		ret = sprintf(buf, "%u\n", !!q->blk_trace);
+		ret = sprintf(buf, "%u\n", !!bt);
 		goto out_unlock_bdev;
 	}
 
-	if (q->blk_trace == NULL)
+	if (bt == NULL)
 		ret = sprintf(buf, "disabled\n");
 	else if (attr == &dev_attr_act_mask)
-		ret = blk_trace_mask2str(buf, q->blk_trace->act_mask);
+		ret = blk_trace_mask2str(buf, bt->act_mask);
 	else if (attr == &dev_attr_pid)
-		ret = sprintf(buf, "%u\n", q->blk_trace->pid);
+		ret = sprintf(buf, "%u\n", bt->pid);
 	else if (attr == &dev_attr_start_lba)
-		ret = sprintf(buf, "%llu\n", q->blk_trace->start_lba);
+		ret = sprintf(buf, "%llu\n", bt->start_lba);
 	else if (attr == &dev_attr_end_lba)
-		ret = sprintf(buf, "%llu\n", q->blk_trace->end_lba);
+		ret = sprintf(buf, "%llu\n", bt->end_lba);
 
 out_unlock_bdev:
-	mutex_unlock(&bdev->bd_mutex);
+	mutex_unlock(&q->blk_trace_mutex);
 out_bdput:
 	bdput(bdev);
 out:
@@ -1689,6 +1780,7 @@ static ssize_t sysfs_blk_trace_attr_stor
 	struct block_device *bdev;
 	struct request_queue *q;
 	struct hd_struct *p;
+	struct blk_trace *bt;
 	u64 value;
 	ssize_t ret = -EINVAL;
 
@@ -1717,10 +1809,12 @@ static ssize_t sysfs_blk_trace_attr_stor
 	if (q == NULL)
 		goto out_bdput;
 
-	mutex_lock(&bdev->bd_mutex);
+	mutex_lock(&q->blk_trace_mutex);
 
+	bt = rcu_dereference_protected(q->blk_trace,
+				       lockdep_is_held(&q->blk_trace_mutex));
 	if (attr == &dev_attr_enable) {
-		if (!!value == !!q->blk_trace) {
+		if (!!value == !!bt) {
 			ret = 0;
 			goto out_unlock_bdev;
 		}
@@ -1732,22 +1826,25 @@ static ssize_t sysfs_blk_trace_attr_stor
 	}
 
 	ret = 0;
-	if (q->blk_trace == NULL)
+	if (bt == NULL) {
 		ret = blk_trace_setup_queue(q, bdev);
+		bt = rcu_dereference_protected(q->blk_trace,
+				lockdep_is_held(&q->blk_trace_mutex));
+	}
 
 	if (ret == 0) {
 		if (attr == &dev_attr_act_mask)
-			q->blk_trace->act_mask = value;
+			bt->act_mask = value;
 		else if (attr == &dev_attr_pid)
-			q->blk_trace->pid = value;
+			bt->pid = value;
 		else if (attr == &dev_attr_start_lba)
-			q->blk_trace->start_lba = value;
+			bt->start_lba = value;
 		else if (attr == &dev_attr_end_lba)
-			q->blk_trace->end_lba = value;
+			bt->end_lba = value;
 	}
 
 out_unlock_bdev:
-	mutex_unlock(&bdev->bd_mutex);
+	mutex_unlock(&q->blk_trace_mutex);
 out_bdput:
 	bdput(bdev);
 out:
diff -druNp --no-dereference linux-libre-4.9.223-gnu/kernel/trace/trace.c linux-libre-4.9.224-gnu/kernel/trace/trace.c
--- linux-libre-4.9.223-gnu/kernel/trace/trace.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/kernel/trace/trace.c	2020-05-20 02:15:44.000000000 -0400
@@ -7032,6 +7032,19 @@ static int allocate_trace_buffers(struct
 	 */
 	allocate_snapshot = false;
 #endif
+
+	/*
+	 * Because of some magic with the way alloc_percpu() works on
+	 * x86_64, we need to synchronize the pgd of all the tables,
+	 * otherwise the trace events that happen in x86_64 page fault
+	 * handlers can't cope with accessing the chance that a
+	 * alloc_percpu()'d memory might be touched in the page fault trace
+	 * event. Oh, and we need to audit all other alloc_percpu() and vmalloc()
+	 * calls in tracing, because something might get triggered within a
+	 * page fault trace event!
+	 */
+	vmalloc_sync_mappings();
+
 	return 0;
 }
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/Makefile linux-libre-4.9.224-gnu/Makefile
--- linux-libre-4.9.223-gnu/Makefile	2020-05-10 17:30:41.000000000 -0400
+++ linux-libre-4.9.224-gnu/Makefile	2020-05-20 10:39:50.000000000 -0400
@@ -1,6 +1,6 @@
 VERSION = 4
 PATCHLEVEL = 9
-SUBLEVEL = 223
+SUBLEVEL = 224
 EXTRAVERSION = -gnu
 NAME = Roaring Lionus
 
@@ -658,20 +658,14 @@ KBUILD_CFLAGS	+= $(call cc-option,-fdata
 endif
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS	+= -Os $(call cc-disable-warning,maybe-uninitialized,)
-else
-ifdef CONFIG_PROFILE_ALL_BRANCHES
-KBUILD_CFLAGS	+= -O2 $(call cc-disable-warning,maybe-uninitialized,)
+KBUILD_CFLAGS   += -Os
 else
 KBUILD_CFLAGS   += -O2
 endif
-endif
-
-KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \
-			$(call cc-disable-warning,maybe-uninitialized,))
 
 # Tell gcc to never replace conditional load with a non-conditional one
 KBUILD_CFLAGS	+= $(call cc-option,--param=allow-store-data-races=0)
+KBUILD_CFLAGS	+= $(call cc-option,-fno-allow-store-data-races)
 
 # check for 'asm goto'
 ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
@@ -804,6 +798,17 @@ KBUILD_CFLAGS += $(call cc-disable-warni
 # disable stringop warnings in gcc 8+
 KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
 
+# We'll want to enable this eventually, but it's not going away for 5.7 at least
+KBUILD_CFLAGS += $(call cc-disable-warning, zero-length-bounds)
+KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds)
+KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow)
+
+# Another good warning that we'll want to enable eventually
+KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
+
+# Enabled with W=2, disabled by default as noisy
+KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
+
 # disable invalid "can't wrap" optimizations for signed / pointers
 KBUILD_CFLAGS	+= $(call cc-option,-fno-strict-overflow)
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/mm/page_alloc.c linux-libre-4.9.224-gnu/mm/page_alloc.c
--- linux-libre-4.9.223-gnu/mm/page_alloc.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/mm/page_alloc.c	2020-05-20 02:15:44.000000000 -0400
@@ -1408,6 +1408,7 @@ void set_zone_contiguous(struct zone *zo
 		if (!__pageblock_pfn_to_page(block_start_pfn,
 					     block_end_pfn, zone))
 			return;
+		cond_resched();
 	}
 
 	/* We confirm that there is no hole */
diff -druNp --no-dereference linux-libre-4.9.223-gnu/mm/shmem.c linux-libre-4.9.224-gnu/mm/shmem.c
--- linux-libre-4.9.223-gnu/mm/shmem.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/mm/shmem.c	2020-05-20 02:15:44.000000000 -0400
@@ -2082,7 +2082,11 @@ int shmem_lock(struct file *file, int lo
 	struct shmem_inode_info *info = SHMEM_I(inode);
 	int retval = -ENOMEM;
 
-	spin_lock_irq(&info->lock);
+	/*
+	 * What serializes the accesses to info->flags?
+	 * ipc_lock_object() when called from shmctl_do_lock(),
+	 * no serialization needed when called from shm_destroy().
+	 */
 	if (lock && !(info->flags & VM_LOCKED)) {
 		if (!user_shm_lock(inode->i_size, user))
 			goto out_nomem;
@@ -2097,7 +2101,6 @@ int shmem_lock(struct file *file, int lo
 	retval = 0;
 
 out_nomem:
-	spin_unlock_irq(&info->lock);
 	return retval;
 }
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/batman-adv/bat_v_ogm.c linux-libre-4.9.224-gnu/net/batman-adv/bat_v_ogm.c
--- linux-libre-4.9.223-gnu/net/batman-adv/bat_v_ogm.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/batman-adv/bat_v_ogm.c	2020-05-20 02:15:44.000000000 -0400
@@ -709,7 +709,7 @@ static void batadv_v_ogm_process(const s
 
 	orig_node = batadv_v_ogm_orig_get(bat_priv, ogm_packet->orig);
 	if (!orig_node)
-		return;
+		goto out;
 
 	neigh_node = batadv_neigh_node_get_or_create(orig_node, if_incoming,
 						     ethhdr->h_source);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/batman-adv/network-coding.c linux-libre-4.9.224-gnu/net/batman-adv/network-coding.c
--- linux-libre-4.9.223-gnu/net/batman-adv/network-coding.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/batman-adv/network-coding.c	2020-05-20 02:15:44.000000000 -0400
@@ -1012,15 +1012,8 @@ static struct batadv_nc_path *batadv_nc_
  */
 static u8 batadv_nc_random_weight_tq(u8 tq)
 {
-	u8 rand_val, rand_tq;
-
-	get_random_bytes(&rand_val, sizeof(rand_val));
-
 	/* randomize the estimated packet loss (max TQ - estimated TQ) */
-	rand_tq = rand_val * (BATADV_TQ_MAX_VALUE - tq);
-
-	/* normalize the randomized packet loss */
-	rand_tq /= BATADV_TQ_MAX_VALUE;
+	u8 rand_tq = prandom_u32_max(BATADV_TQ_MAX_VALUE + 1 - tq);
 
 	/* convert to (randomized) estimated tq again */
 	return BATADV_TQ_MAX_VALUE - rand_tq;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/batman-adv/sysfs.c linux-libre-4.9.224-gnu/net/batman-adv/sysfs.c
--- linux-libre-4.9.223-gnu/net/batman-adv/sysfs.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/batman-adv/sysfs.c	2020-05-20 02:15:44.000000000 -0400
@@ -1087,7 +1087,7 @@ static ssize_t batadv_store_throughput_o
 	ret = batadv_parse_throughput(net_dev, buff, "throughput_override",
 				      &tp_override);
 	if (!ret)
-		return count;
+		goto out;
 
 	old_tp_override = atomic_read(&hard_iface->bat_v.throughput_override);
 	if (old_tp_override == tp_override)
@@ -1120,6 +1120,7 @@ static ssize_t batadv_show_throughput_ov
 
 	tp_override = atomic_read(&hard_iface->bat_v.throughput_override);
 
+	batadv_hardif_put(hard_iface);
 	return sprintf(buff, "%u.%u MBit\n", tp_override / 10,
 		       tp_override % 10);
 }
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/core/dev.c linux-libre-4.9.224-gnu/net/core/dev.c
--- linux-libre-4.9.223-gnu/net/core/dev.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/core/dev.c	2020-05-20 02:15:44.000000000 -0400
@@ -6939,11 +6939,13 @@ static void netdev_sync_lower_features(s
 			netdev_dbg(upper, "Disabling feature %pNF on lower dev %s.\n",
 				   &feature, lower->name);
 			lower->wanted_features &= ~feature;
-			netdev_update_features(lower);
+			__netdev_update_features(lower);
 
 			if (unlikely(lower->features & feature))
 				netdev_WARN(upper, "failed to disable %pNF on %s!\n",
 					    &feature, lower->name);
+			else
+				netdev_features_change(lower);
 		}
 	}
 }
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/core/drop_monitor.c linux-libre-4.9.224-gnu/net/core/drop_monitor.c
--- linux-libre-4.9.223-gnu/net/core/drop_monitor.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/core/drop_monitor.c	2020-05-20 02:15:44.000000000 -0400
@@ -159,6 +159,7 @@ static void sched_send_work(unsigned lon
 static void trace_drop_common(struct sk_buff *skb, void *location)
 {
 	struct net_dm_alert_msg *msg;
+	struct net_dm_drop_point *point;
 	struct nlmsghdr *nlh;
 	struct nlattr *nla;
 	int i;
@@ -177,11 +178,13 @@ static void trace_drop_common(struct sk_
 	nlh = (struct nlmsghdr *)dskb->data;
 	nla = genlmsg_data(nlmsg_data(nlh));
 	msg = nla_data(nla);
+	point = msg->points;
 	for (i = 0; i < msg->entries; i++) {
-		if (!memcmp(&location, msg->points[i].pc, sizeof(void *))) {
-			msg->points[i].count++;
+		if (!memcmp(&location, &point->pc, sizeof(void *))) {
+			point->count++;
 			goto out;
 		}
+		point++;
 	}
 	if (msg->entries == dm_hit_limit)
 		goto out;
@@ -190,8 +193,8 @@ static void trace_drop_common(struct sk_
 	 */
 	__nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
 	nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
-	memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
-	msg->points[msg->entries].count = 1;
+	memcpy(point->pc, &location, sizeof(void *));
+	point->count = 1;
 	msg->entries++;
 
 	if (!timer_pending(&data->send_timer)) {
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/core/netprio_cgroup.c linux-libre-4.9.224-gnu/net/core/netprio_cgroup.c
--- linux-libre-4.9.223-gnu/net/core/netprio_cgroup.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/core/netprio_cgroup.c	2020-05-20 02:15:44.000000000 -0400
@@ -237,6 +237,8 @@ static void net_prio_attach(struct cgrou
 	struct task_struct *p;
 	struct cgroup_subsys_state *css;
 
+	cgroup_sk_alloc_disable();
+
 	cgroup_taskset_for_each(p, css, tset) {
 		void *v = (void *)(unsigned long)css->cgroup->id;
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/dccp/ipv6.c linux-libre-4.9.224-gnu/net/dccp/ipv6.c
--- linux-libre-4.9.223-gnu/net/dccp/ipv6.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/dccp/ipv6.c	2020-05-20 02:15:44.000000000 -0400
@@ -209,7 +209,7 @@ static int dccp_v6_send_response(const s
 	final_p = fl6_update_dst(&fl6, rcu_dereference(np->opt), &final);
 	rcu_read_unlock();
 
-	dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
+	dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl6, final_p);
 	if (IS_ERR(dst)) {
 		err = PTR_ERR(dst);
 		dst = NULL;
@@ -280,7 +280,7 @@ static void dccp_v6_ctl_send_reset(const
 	security_skb_classify_flow(rxskb, flowi6_to_flowi(&fl6));
 
 	/* sk = NULL, but it is safe for now. RST socket required. */
-	dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL);
+	dst = ip6_dst_lookup_flow(sock_net(ctl_sk), ctl_sk, &fl6, NULL);
 	if (!IS_ERR(dst)) {
 		skb_dst_set(skb, dst);
 		ip6_xmit(ctl_sk, skb, &fl6, 0, NULL, 0);
@@ -889,7 +889,7 @@ static int dccp_v6_connect(struct sock *
 	opt = rcu_dereference_protected(np->opt, lockdep_sock_is_held(sk));
 	final_p = fl6_update_dst(&fl6, opt, &final);
 
-	dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
+	dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl6, final_p);
 	if (IS_ERR(dst)) {
 		err = PTR_ERR(dst);
 		goto failure;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv4/cipso_ipv4.c linux-libre-4.9.224-gnu/net/ipv4/cipso_ipv4.c
--- linux-libre-4.9.223-gnu/net/ipv4/cipso_ipv4.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv4/cipso_ipv4.c	2020-05-20 02:15:44.000000000 -0400
@@ -1272,7 +1272,8 @@ static int cipso_v4_parsetag_rbm(const s
 			return ret_val;
 		}
 
-		secattr->flags |= NETLBL_SECATTR_MLS_CAT;
+		if (secattr->attr.mls.cat)
+			secattr->flags |= NETLBL_SECATTR_MLS_CAT;
 	}
 
 	return 0;
@@ -1453,7 +1454,8 @@ static int cipso_v4_parsetag_rng(const s
 			return ret_val;
 		}
 
-		secattr->flags |= NETLBL_SECATTR_MLS_CAT;
+		if (secattr->attr.mls.cat)
+			secattr->flags |= NETLBL_SECATTR_MLS_CAT;
 	}
 
 	return 0;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv4/route.c linux-libre-4.9.224-gnu/net/ipv4/route.c
--- linux-libre-4.9.223-gnu/net/ipv4/route.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv4/route.c	2020-05-20 02:15:44.000000000 -0400
@@ -898,7 +898,7 @@ void ip_rt_send_redirect(struct sk_buff
 	/* Check for load limit; set rate_last to the latest sent
 	 * redirect.
 	 */
-	if (peer->rate_tokens == 0 ||
+	if (peer->n_redirects == 0 ||
 	    time_after(jiffies,
 		       (peer->rate_last +
 			(ip_rt_redirect_load << peer->n_redirects)))) {
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv6/addrconf_core.c linux-libre-4.9.224-gnu/net/ipv6/addrconf_core.c
--- linux-libre-4.9.223-gnu/net/ipv6/addrconf_core.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv6/addrconf_core.c	2020-05-20 02:15:44.000000000 -0400
@@ -107,15 +107,16 @@ int inet6addr_notifier_call_chain(unsign
 }
 EXPORT_SYMBOL(inet6addr_notifier_call_chain);
 
-static int eafnosupport_ipv6_dst_lookup(struct net *net, struct sock *u1,
-					struct dst_entry **u2,
-					struct flowi6 *u3)
+static struct dst_entry *eafnosupport_ipv6_dst_lookup_flow(struct net *net,
+							   const struct sock *sk,
+							   struct flowi6 *fl6,
+							   const struct in6_addr *final_dst)
 {
-	return -EAFNOSUPPORT;
+	return ERR_PTR(-EAFNOSUPPORT);
 }
 
 const struct ipv6_stub *ipv6_stub __read_mostly = &(struct ipv6_stub) {
-	.ipv6_dst_lookup = eafnosupport_ipv6_dst_lookup,
+	.ipv6_dst_lookup_flow = eafnosupport_ipv6_dst_lookup_flow,
 };
 EXPORT_SYMBOL_GPL(ipv6_stub);
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv6/af_inet6.c linux-libre-4.9.224-gnu/net/ipv6/af_inet6.c
--- linux-libre-4.9.223-gnu/net/ipv6/af_inet6.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv6/af_inet6.c	2020-05-20 02:15:44.000000000 -0400
@@ -702,7 +702,7 @@ int inet6_sk_rebuild_header(struct sock
 					 &final);
 		rcu_read_unlock();
 
-		dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
+		dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl6, final_p);
 		if (IS_ERR(dst)) {
 			sk->sk_route_caps = 0;
 			sk->sk_err_soft = -PTR_ERR(dst);
@@ -860,7 +860,7 @@ static struct pernet_operations inet6_ne
 static const struct ipv6_stub ipv6_stub_impl = {
 	.ipv6_sock_mc_join = ipv6_sock_mc_join,
 	.ipv6_sock_mc_drop = ipv6_sock_mc_drop,
-	.ipv6_dst_lookup = ip6_dst_lookup,
+	.ipv6_dst_lookup_flow = ip6_dst_lookup_flow,
 	.udpv6_encap_enable = udpv6_encap_enable,
 	.ndisc_send_na = ndisc_send_na,
 	.nd_tbl	= &nd_tbl,
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv6/calipso.c linux-libre-4.9.224-gnu/net/ipv6/calipso.c
--- linux-libre-4.9.223-gnu/net/ipv6/calipso.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv6/calipso.c	2020-05-20 02:15:44.000000000 -0400
@@ -1061,7 +1061,8 @@ static int calipso_opt_getattr(const uns
 			goto getattr_return;
 		}
 
-		secattr->flags |= NETLBL_SECATTR_MLS_CAT;
+		if (secattr->attr.mls.cat)
+			secattr->flags |= NETLBL_SECATTR_MLS_CAT;
 	}
 
 	secattr->type = NETLBL_NLTYPE_CALIPSO;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv6/datagram.c linux-libre-4.9.224-gnu/net/ipv6/datagram.c
--- linux-libre-4.9.223-gnu/net/ipv6/datagram.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv6/datagram.c	2020-05-20 02:15:44.000000000 -0400
@@ -87,7 +87,7 @@ int ip6_datagram_dst_update(struct sock
 	final_p = fl6_update_dst(&fl6, opt, &final);
 	rcu_read_unlock();
 
-	dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
+	dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl6, final_p);
 	if (IS_ERR(dst)) {
 		err = PTR_ERR(dst);
 		goto out;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv6/inet6_connection_sock.c linux-libre-4.9.224-gnu/net/ipv6/inet6_connection_sock.c
--- linux-libre-4.9.223-gnu/net/ipv6/inet6_connection_sock.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv6/inet6_connection_sock.c	2020-05-20 02:15:44.000000000 -0400
@@ -90,7 +90,7 @@ struct dst_entry *inet6_csk_route_req(co
 	fl6->fl6_sport = htons(ireq->ir_num);
 	security_req_classify_flow(req, flowi6_to_flowi(fl6));
 
-	dst = ip6_dst_lookup_flow(sk, fl6, final_p);
+	dst = ip6_dst_lookup_flow(sock_net(sk), sk, fl6, final_p);
 	if (IS_ERR(dst))
 		return NULL;
 
@@ -144,7 +144,7 @@ static struct dst_entry *inet6_csk_route
 
 	dst = __inet6_csk_dst_check(sk, np->dst_cookie);
 	if (!dst) {
-		dst = ip6_dst_lookup_flow(sk, fl6, final_p);
+		dst = ip6_dst_lookup_flow(sock_net(sk), sk, fl6, final_p);
 
 		if (!IS_ERR(dst))
 			ip6_dst_store(sk, dst, NULL, NULL);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv6/ip6_output.c linux-libre-4.9.224-gnu/net/ipv6/ip6_output.c
--- linux-libre-4.9.223-gnu/net/ipv6/ip6_output.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv6/ip6_output.c	2020-05-20 02:15:44.000000000 -0400
@@ -1075,19 +1075,19 @@ EXPORT_SYMBOL_GPL(ip6_dst_lookup);
  *	It returns a valid dst pointer on success, or a pointer encoded
  *	error code.
  */
-struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6,
+struct dst_entry *ip6_dst_lookup_flow(struct net *net, const struct sock *sk, struct flowi6 *fl6,
 				      const struct in6_addr *final_dst)
 {
 	struct dst_entry *dst = NULL;
 	int err;
 
-	err = ip6_dst_lookup_tail(sock_net(sk), sk, &dst, fl6);
+	err = ip6_dst_lookup_tail(net, sk, &dst, fl6);
 	if (err)
 		return ERR_PTR(err);
 	if (final_dst)
 		fl6->daddr = *final_dst;
 
-	return xfrm_lookup_route(sock_net(sk), dst, flowi6_to_flowi(fl6), sk, 0);
+	return xfrm_lookup_route(net, dst, flowi6_to_flowi(fl6), sk, 0);
 }
 EXPORT_SYMBOL_GPL(ip6_dst_lookup_flow);
 
@@ -1112,7 +1112,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow
 
 	dst = ip6_sk_dst_check(sk, dst, fl6);
 	if (!dst)
-		dst = ip6_dst_lookup_flow(sk, fl6, final_dst);
+		dst = ip6_dst_lookup_flow(sock_net(sk), sk, fl6, final_dst);
 
 	return dst;
 }
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv6/raw.c linux-libre-4.9.224-gnu/net/ipv6/raw.c
--- linux-libre-4.9.223-gnu/net/ipv6/raw.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv6/raw.c	2020-05-20 02:15:44.000000000 -0400
@@ -920,7 +920,7 @@ static int rawv6_sendmsg(struct sock *sk
 
 	fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel);
 
-	dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
+	dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl6, final_p);
 	if (IS_ERR(dst)) {
 		err = PTR_ERR(dst);
 		goto out;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv6/route.c linux-libre-4.9.224-gnu/net/ipv6/route.c
--- linux-libre-4.9.223-gnu/net/ipv6/route.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv6/route.c	2020-05-20 02:15:44.000000000 -0400
@@ -1373,8 +1373,10 @@ static void __ip6_rt_update_pmtu(struct
 {
 	struct rt6_info *rt6 = (struct rt6_info *)dst;
 
-	if (dst_metric_locked(dst, RTAX_MTU))
-		return;
+	/* Note: do *NOT* check dst_metric_locked(dst, RTAX_MTU)
+	 * IPv6 pmtu discovery isn't optional, so 'mtu lock' cannot disable it.
+	 * [see also comment in rt6_mtu_change_route()]
+	 */
 
 	dst_confirm(dst);
 	mtu = max_t(u32, mtu, IPV6_MIN_MTU);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv6/syncookies.c linux-libre-4.9.224-gnu/net/ipv6/syncookies.c
--- linux-libre-4.9.223-gnu/net/ipv6/syncookies.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv6/syncookies.c	2020-05-20 02:15:44.000000000 -0400
@@ -230,7 +230,7 @@ struct sock *cookie_v6_check(struct sock
 		fl6.fl6_sport = inet_sk(sk)->inet_sport;
 		security_req_classify_flow(req, flowi6_to_flowi(&fl6));
 
-		dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
+		dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl6, final_p);
 		if (IS_ERR(dst))
 			goto out_free;
 	}
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/ipv6/tcp_ipv6.c linux-libre-4.9.224-gnu/net/ipv6/tcp_ipv6.c
--- linux-libre-4.9.223-gnu/net/ipv6/tcp_ipv6.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/ipv6/tcp_ipv6.c	2020-05-20 02:15:44.000000000 -0400
@@ -244,7 +244,7 @@ static int tcp_v6_connect(struct sock *s
 
 	security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
 
-	dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
+	dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl6, final_p);
 	if (IS_ERR(dst)) {
 		err = PTR_ERR(dst);
 		goto failure;
@@ -841,7 +841,7 @@ static void tcp_v6_send_response(const s
 	 * Underlying function will use this to retrieve the network
 	 * namespace
 	 */
-	dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL);
+	dst = ip6_dst_lookup_flow(sock_net(ctl_sk), ctl_sk, &fl6, NULL);
 	if (!IS_ERR(dst)) {
 		skb_dst_set(buff, dst);
 		ip6_xmit(ctl_sk, buff, &fl6, fl6.flowi6_mark, NULL, tclass);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/l2tp/l2tp_ip6.c linux-libre-4.9.224-gnu/net/l2tp/l2tp_ip6.c
--- linux-libre-4.9.223-gnu/net/l2tp/l2tp_ip6.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/l2tp/l2tp_ip6.c	2020-05-20 02:15:44.000000000 -0400
@@ -620,7 +620,7 @@ static int l2tp_ip6_sendmsg(struct sock
 
 	fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel);
 
-	dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
+	dst = ip6_dst_lookup_flow(sock_net(sk), sk, &fl6, final_p);
 	if (IS_ERR(dst)) {
 		err = PTR_ERR(dst);
 		goto out;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/mpls/af_mpls.c linux-libre-4.9.224-gnu/net/mpls/af_mpls.c
--- linux-libre-4.9.223-gnu/net/mpls/af_mpls.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/mpls/af_mpls.c	2020-05-20 02:15:44.000000000 -0400
@@ -497,16 +497,15 @@ static struct net_device *inet6_fib_look
 	struct net_device *dev;
 	struct dst_entry *dst;
 	struct flowi6 fl6;
-	int err;
 
 	if (!ipv6_stub)
 		return ERR_PTR(-EAFNOSUPPORT);
 
 	memset(&fl6, 0, sizeof(fl6));
 	memcpy(&fl6.daddr, addr, sizeof(struct in6_addr));
-	err = ipv6_stub->ipv6_dst_lookup(net, NULL, &dst, &fl6);
-	if (err)
-		return ERR_PTR(err);
+	dst = ipv6_stub->ipv6_dst_lookup_flow(net, NULL, &fl6, NULL);
+	if (IS_ERR(dst))
+		return ERR_CAST(dst);
 
 	dev = dst->dev;
 	dev_hold(dev);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/netfilter/nf_conntrack_core.c linux-libre-4.9.224-gnu/net/netfilter/nf_conntrack_core.c
--- linux-libre-4.9.223-gnu/net/netfilter/nf_conntrack_core.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/netfilter/nf_conntrack_core.c	2020-05-20 02:15:44.000000000 -0400
@@ -1124,9 +1124,9 @@ __nf_conntrack_alloc(struct net *net,
 	*(unsigned long *)(&ct->tuplehash[IP_CT_DIR_REPLY].hnnode.pprev) = hash;
 	ct->status = 0;
 	write_pnet(&ct->ct_net, net);
-	memset(&ct->__nfct_init_offset[0], 0,
+	memset(&ct->__nfct_init_offset, 0,
 	       offsetof(struct nf_conn, proto) -
-	       offsetof(struct nf_conn, __nfct_init_offset[0]));
+	       offsetof(struct nf_conn, __nfct_init_offset));
 
 	nf_ct_zone_add(ct, zone);
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/netlabel/netlabel_kapi.c linux-libre-4.9.224-gnu/net/netlabel/netlabel_kapi.c
--- linux-libre-4.9.223-gnu/net/netlabel/netlabel_kapi.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/netlabel/netlabel_kapi.c	2020-05-20 02:15:44.000000000 -0400
@@ -748,6 +748,12 @@ int netlbl_catmap_getlong(struct netlbl_
 	if ((off & (BITS_PER_LONG - 1)) != 0)
 		return -EINVAL;
 
+	/* a null catmap is equivalent to an empty one */
+	if (!catmap) {
+		*offset = (u32)-1;
+		return 0;
+	}
+
 	if (off < catmap->startbit) {
 		off = catmap->startbit;
 		*offset = off;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/sched/sch_choke.c linux-libre-4.9.224-gnu/net/sched/sch_choke.c
--- linux-libre-4.9.223-gnu/net/sched/sch_choke.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/sched/sch_choke.c	2020-05-20 02:15:44.000000000 -0400
@@ -382,7 +382,8 @@ static void choke_reset(struct Qdisc *sc
 
 	sch->q.qlen = 0;
 	sch->qstats.backlog = 0;
-	memset(q->tab, 0, (q->tab_mask + 1) * sizeof(struct sk_buff *));
+	if (q->tab)
+		memset(q->tab, 0, (q->tab_mask + 1) * sizeof(struct sk_buff *));
 	q->head = q->tail = 0;
 	red_restart(&q->vars);
 }
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/sched/sch_fq_codel.c linux-libre-4.9.224-gnu/net/sched/sch_fq_codel.c
--- linux-libre-4.9.223-gnu/net/sched/sch_fq_codel.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/sched/sch_fq_codel.c	2020-05-20 02:15:44.000000000 -0400
@@ -428,7 +428,7 @@ static int fq_codel_change(struct Qdisc
 		q->quantum = max(256U, nla_get_u32(tb[TCA_FQ_CODEL_QUANTUM]));
 
 	if (tb[TCA_FQ_CODEL_DROP_BATCH_SIZE])
-		q->drop_batch_size = min(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE]));
+		q->drop_batch_size = max(1U, nla_get_u32(tb[TCA_FQ_CODEL_DROP_BATCH_SIZE]));
 
 	if (tb[TCA_FQ_CODEL_MEMORY_LIMIT])
 		q->memory_limit = min(1U << 31, nla_get_u32(tb[TCA_FQ_CODEL_MEMORY_LIMIT]));
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/sched/sch_sfq.c linux-libre-4.9.224-gnu/net/sched/sch_sfq.c
--- linux-libre-4.9.223-gnu/net/sched/sch_sfq.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/sched/sch_sfq.c	2020-05-20 02:15:44.000000000 -0400
@@ -635,6 +635,15 @@ static int sfq_change(struct Qdisc *sch,
 	if (ctl->divisor &&
 	    (!is_power_of_2(ctl->divisor) || ctl->divisor > 65536))
 		return -EINVAL;
+
+	/* slot->allot is a short, make sure quantum is not too big. */
+	if (ctl->quantum) {
+		unsigned int scaled = SFQ_ALLOT_SIZE(ctl->quantum);
+
+		if (scaled <= 0 || scaled > SHRT_MAX)
+			return -EINVAL;
+	}
+
 	if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max,
 					ctl_v1->Wlog))
 		return -EINVAL;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/sctp/ipv6.c linux-libre-4.9.224-gnu/net/sctp/ipv6.c
--- linux-libre-4.9.223-gnu/net/sctp/ipv6.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/sctp/ipv6.c	2020-05-20 02:15:44.000000000 -0400
@@ -269,7 +269,7 @@ static void sctp_v6_get_dst(struct sctp_
 	final_p = fl6_update_dst(fl6, rcu_dereference(np->opt), &final);
 	rcu_read_unlock();
 
-	dst = ip6_dst_lookup_flow(sk, fl6, final_p);
+	dst = ip6_dst_lookup_flow(sock_net(sk), sk, fl6, final_p);
 	if (!asoc || saddr) {
 		t->dst = dst;
 		memcpy(fl, &_fl, sizeof(_fl));
@@ -327,7 +327,7 @@ static void sctp_v6_get_dst(struct sctp_
 		fl6->saddr = laddr->a.v6.sin6_addr;
 		fl6->fl6_sport = laddr->a.v6.sin6_port;
 		final_p = fl6_update_dst(fl6, rcu_dereference(np->opt), &final);
-		bdst = ip6_dst_lookup_flow(sk, fl6, final_p);
+		bdst = ip6_dst_lookup_flow(sock_net(sk), sk, fl6, final_p);
 
 		if (IS_ERR(bdst))
 			continue;
diff -druNp --no-dereference linux-libre-4.9.223-gnu/net/tipc/udp_media.c linux-libre-4.9.224-gnu/net/tipc/udp_media.c
--- linux-libre-4.9.223-gnu/net/tipc/udp_media.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/net/tipc/udp_media.c	2020-05-20 02:15:44.000000000 -0400
@@ -187,10 +187,13 @@ static int tipc_udp_xmit(struct net *net
 			.saddr = src->ipv6,
 			.flowi6_proto = IPPROTO_UDP
 		};
-		err = ipv6_stub->ipv6_dst_lookup(net, ub->ubsock->sk, &ndst,
-						 &fl6);
-		if (err)
+		ndst = ipv6_stub->ipv6_dst_lookup_flow(net,
+						       ub->ubsock->sk,
+						       &fl6, NULL);
+		if (IS_ERR(ndst)) {
+			err = PTR_ERR(ndst);
 			goto tx_error;
+		}
 		ttl = ip6_dst_hoplimit(ndst);
 		err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, NULL,
 					   &src->ipv6, &dst->ipv6, 0, ttl, 0,
diff -druNp --no-dereference linux-libre-4.9.223-gnu/scripts/decodecode linux-libre-4.9.224-gnu/scripts/decodecode
--- linux-libre-4.9.223-gnu/scripts/decodecode	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/scripts/decodecode	2020-05-20 02:15:44.000000000 -0400
@@ -98,7 +98,7 @@ faultlinenum=$(( $(wc -l $T.oo  | cut -d
 faultline=`cat $T.dis | head -1 | cut -d":" -f2-`
 faultline=`echo "$faultline" | sed -e 's/\[/\\\[/g; s/\]/\\\]/g'`
 
-cat $T.oo | sed -e "${faultlinenum}s/^\(.*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/"
+cat $T.oo | sed -e "${faultlinenum}s/^\([^:]*:\)\(.*\)/\1\*\2\t\t<-- trapping instruction/"
 echo
 cat $T.aa
 cleanup
diff -druNp --no-dereference linux-libre-4.9.223-gnu/sound/core/rawmidi.c linux-libre-4.9.224-gnu/sound/core/rawmidi.c
--- linux-libre-4.9.223-gnu/sound/core/rawmidi.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/sound/core/rawmidi.c	2020-05-20 02:15:44.000000000 -0400
@@ -108,6 +108,17 @@ static void snd_rawmidi_input_event_work
 		runtime->event(runtime->substream);
 }
 
+/* buffer refcount management: call with runtime->lock held */
+static inline void snd_rawmidi_buffer_ref(struct snd_rawmidi_runtime *runtime)
+{
+	runtime->buffer_ref++;
+}
+
+static inline void snd_rawmidi_buffer_unref(struct snd_rawmidi_runtime *runtime)
+{
+	runtime->buffer_ref--;
+}
+
 static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream)
 {
 	struct snd_rawmidi_runtime *runtime;
@@ -125,7 +136,7 @@ static int snd_rawmidi_runtime_create(st
 		runtime->avail = 0;
 	else
 		runtime->avail = runtime->buffer_size;
-	if ((runtime->buffer = kmalloc(runtime->buffer_size, GFP_KERNEL)) == NULL) {
+	if ((runtime->buffer = kzalloc(runtime->buffer_size, GFP_KERNEL)) == NULL) {
 		kfree(runtime);
 		return -ENOMEM;
 	}
@@ -650,10 +661,15 @@ int snd_rawmidi_output_params(struct snd
 		return -EINVAL;
 	}
 	if (params->buffer_size != runtime->buffer_size) {
-		newbuf = kmalloc(params->buffer_size, GFP_KERNEL);
+		newbuf = kzalloc(params->buffer_size, GFP_KERNEL);
 		if (!newbuf)
 			return -ENOMEM;
 		spin_lock_irq(&runtime->lock);
+		if (runtime->buffer_ref) {
+			spin_unlock_irq(&runtime->lock);
+			kfree(newbuf);
+			return -EBUSY;
+		}
 		oldbuf = runtime->buffer;
 		runtime->buffer = newbuf;
 		runtime->buffer_size = params->buffer_size;
@@ -962,8 +978,10 @@ static long snd_rawmidi_kernel_read1(str
 	long result = 0, count1;
 	struct snd_rawmidi_runtime *runtime = substream->runtime;
 	unsigned long appl_ptr;
+	int err = 0;
 
 	spin_lock_irqsave(&runtime->lock, flags);
+	snd_rawmidi_buffer_ref(runtime);
 	while (count > 0 && runtime->avail) {
 		count1 = runtime->buffer_size - runtime->appl_ptr;
 		if (count1 > count)
@@ -982,16 +1000,19 @@ static long snd_rawmidi_kernel_read1(str
 		if (userbuf) {
 			spin_unlock_irqrestore(&runtime->lock, flags);
 			if (copy_to_user(userbuf + result,
-					 runtime->buffer + appl_ptr, count1)) {
-				return result > 0 ? result : -EFAULT;
-			}
+					 runtime->buffer + appl_ptr, count1))
+				err = -EFAULT;
 			spin_lock_irqsave(&runtime->lock, flags);
+			if (err)
+				goto out;
 		}
 		result += count1;
 		count -= count1;
 	}
+ out:
+	snd_rawmidi_buffer_unref(runtime);
 	spin_unlock_irqrestore(&runtime->lock, flags);
-	return result;
+	return result > 0 ? result : err;
 }
 
 long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream,
@@ -1262,6 +1283,7 @@ static long snd_rawmidi_kernel_write1(st
 			return -EAGAIN;
 		}
 	}
+	snd_rawmidi_buffer_ref(runtime);
 	while (count > 0 && runtime->avail > 0) {
 		count1 = runtime->buffer_size - runtime->appl_ptr;
 		if (count1 > count)
@@ -1293,6 +1315,7 @@ static long snd_rawmidi_kernel_write1(st
 	}
       __end:
 	count1 = runtime->avail < runtime->buffer_size;
+	snd_rawmidi_buffer_unref(runtime);
 	spin_unlock_irqrestore(&runtime->lock, flags);
 	if (count1)
 		snd_rawmidi_output_trigger(substream, 1);
diff -druNp --no-dereference linux-libre-4.9.223-gnu/sound/pci/hda/patch_hdmi.c linux-libre-4.9.224-gnu/sound/pci/hda/patch_hdmi.c
--- linux-libre-4.9.223-gnu/sound/pci/hda/patch_hdmi.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/sound/pci/hda/patch_hdmi.c	2020-05-20 02:15:44.000000000 -0400
@@ -2044,7 +2044,9 @@ static int generic_hdmi_build_controls(s
 
 	for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
 		struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
+		struct hdmi_eld *pin_eld = &per_pin->sink_eld;
 
+		pin_eld->eld_valid = false;
 		hdmi_present_sense(per_pin, 0);
 	}
 
diff -druNp --no-dereference linux-libre-4.9.223-gnu/sound/pci/hda/patch_realtek.c linux-libre-4.9.224-gnu/sound/pci/hda/patch_realtek.c
--- linux-libre-4.9.223-gnu/sound/pci/hda/patch_realtek.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/sound/pci/hda/patch_realtek.c	2020-05-20 02:15:44.000000000 -0400
@@ -4212,8 +4212,6 @@ static void alc_determine_headset_type(s
 		is_ctia = (val & 0x1c02) == 0x1c02;
 		break;
 	case 0x10ec0225:
-		codec->power_save_node = 1;
-		/* fall through */
 	case 0x10ec0295:
 	case 0x10ec0299:
 		alc_process_coef_fw(codec, coef0225);
@@ -4890,6 +4888,7 @@ enum {
 	ALC269_FIXUP_HP_LINE1_MIC1_LED,
 	ALC269_FIXUP_INV_DMIC,
 	ALC269_FIXUP_LENOVO_DOCK,
+	ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST,
 	ALC269_FIXUP_NO_SHUTUP,
 	ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
 	ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
@@ -5157,6 +5156,12 @@ static const struct hda_fixup alc269_fix
 		.chained = true,
 		.chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
 	},
+	[ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc269_fixup_limit_int_mic_boost,
+		.chained = true,
+		.chain_id = ALC269_FIXUP_LENOVO_DOCK,
+	},
 	[ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
@@ -5820,7 +5825,7 @@ static const struct snd_pci_quirk alc269
 	SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
 	SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
 	SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
-	SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK),
+	SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST),
 	SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x21f3, "Thinkpad T430", ALC269_FIXUP_LENOVO_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
@@ -5945,6 +5950,7 @@ static const struct hda_model_fixup alc2
 	{.id = ALC269_FIXUP_HEADSET_MODE, .name = "headset-mode"},
 	{.id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, .name = "headset-mode-no-hp-mic"},
 	{.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
+	{.id = ALC269_FIXUP_LENOVO_DOCK_LIMIT_BOOST, .name = "lenovo-dock-limit-boost"},
 	{.id = ALC269_FIXUP_HP_GPIO_LED, .name = "hp-gpio-led"},
 	{.id = ALC269_FIXUP_HP_DOCK_GPIO_MIC1_LED, .name = "hp-dock-gpio-mic1-led"},
 	{.id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, .name = "dell-headset-multi"},
diff -druNp --no-dereference linux-libre-4.9.223-gnu/sound/usb/quirks.c linux-libre-4.9.224-gnu/sound/usb/quirks.c
--- linux-libre-4.9.223-gnu/sound/usb/quirks.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/sound/usb/quirks.c	2020-05-20 02:15:44.000000000 -0400
@@ -1316,13 +1316,14 @@ void snd_usb_ctl_msg_quirk(struct usb_de
 	    && (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
 		mdelay(20);
 
-	/* Zoom R16/24, Logitech H650e, Jabra 550a needs a tiny delay here,
-	 * otherwise requests like get/set frequency return as failed despite
-	 * actually succeeding.
+	/* Zoom R16/24, Logitech H650e, Jabra 550a, Kingston HyperX needs a tiny
+	 * delay here, otherwise requests like get/set frequency return as
+	 * failed despite actually succeeding.
 	 */
 	if ((chip->usb_id == USB_ID(0x1686, 0x00dd) ||
 	     chip->usb_id == USB_ID(0x046d, 0x0a46) ||
-	     chip->usb_id == USB_ID(0x0b0e, 0x0349)) &&
+	     chip->usb_id == USB_ID(0x0b0e, 0x0349) ||
+	     chip->usb_id == USB_ID(0x0951, 0x16ad)) &&
 	    (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
 		mdelay(1);
 }
diff -druNp --no-dereference linux-libre-4.9.223-gnu/tools/objtool/check.c linux-libre-4.9.224-gnu/tools/objtool/check.c
--- linux-libre-4.9.223-gnu/tools/objtool/check.c	2020-05-10 04:28:04.000000000 -0400
+++ linux-libre-4.9.224-gnu/tools/objtool/check.c	2020-05-20 02:15:44.000000000 -0400
@@ -1264,7 +1264,7 @@ static int update_insn_state_regs(struct
 	struct cfi_reg *cfa = &state->cfa;
 	struct stack_op *op = &insn->stack_op;
 
-	if (cfa->base != CFI_SP)
+	if (cfa->base != CFI_SP && cfa->base != CFI_SP_INDIRECT)
 		return 0;
 
 	/* push */
