--- /dev/null
+From foo@baz Sun 08 Sep 2019 11:09:01 AM WEST
+From: Eric Dumazet <edumazet@google.com>
+Date: Tue, 27 Aug 2019 03:33:12 -0700
+Subject: mld: fix memory leak in mld_del_delrec()
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit a84d016479896b5526a2cc54784e6ffc41c9d6f6 ]
+
+Similar to the fix done for IPv4 in commit e5b1c6c6277d
+("igmp: fix memory leak in igmpv3_del_delrec()"), we need to
+make sure mca_tomb and mca_sources are not blindly overwritten.
+
+Using swap() then a call to ip6_mc_clear_src() will take care
+of the missing free.
+
+BUG: memory leak
+unreferenced object 0xffff888117d9db00 (size 64):
+ comm "syz-executor247", pid 6918, jiffies 4294943989 (age 25.350s)
+ hex dump (first 32 bytes):
+ 00 00 00 00 00 00 00 00 fe 88 00 00 00 00 00 00 ................
+ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ backtrace:
+ [<000000005b463030>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
+ [<000000005b463030>] slab_post_alloc_hook mm/slab.h:522 [inline]
+ [<000000005b463030>] slab_alloc mm/slab.c:3319 [inline]
+ [<000000005b463030>] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3548
+ [<00000000939cbf94>] kmalloc include/linux/slab.h:552 [inline]
+ [<00000000939cbf94>] kzalloc include/linux/slab.h:748 [inline]
+ [<00000000939cbf94>] ip6_mc_add1_src net/ipv6/mcast.c:2236 [inline]
+ [<00000000939cbf94>] ip6_mc_add_src+0x31f/0x420 net/ipv6/mcast.c:2356
+ [<00000000d8972221>] ip6_mc_source+0x4a8/0x600 net/ipv6/mcast.c:449
+ [<000000002b203d0d>] do_ipv6_setsockopt.isra.0+0x1b92/0x1dd0 net/ipv6/ipv6_sockglue.c:748
+ [<000000001f1e2d54>] ipv6_setsockopt+0x89/0xd0 net/ipv6/ipv6_sockglue.c:944
+ [<00000000c8f7bdf9>] udpv6_setsockopt+0x4e/0x90 net/ipv6/udp.c:1558
+ [<000000005a9a0c5e>] sock_common_setsockopt+0x38/0x50 net/core/sock.c:3139
+ [<00000000910b37b2>] __sys_setsockopt+0x10f/0x220 net/socket.c:2084
+ [<00000000e9108023>] __do_sys_setsockopt net/socket.c:2100 [inline]
+ [<00000000e9108023>] __se_sys_setsockopt net/socket.c:2097 [inline]
+ [<00000000e9108023>] __x64_sys_setsockopt+0x26/0x30 net/socket.c:2097
+ [<00000000f4818160>] do_syscall_64+0x76/0x1a0 arch/x86/entry/common.c:296
+ [<000000008d367e8f>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
+
+Fixes: 1666d49e1d41 ("mld: do not remove mld souce list info when set link down")
+Fixes: 9c8bb163ae78 ("igmp, mld: Fix memory leak in igmpv3/mld_del_delrec()")
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Reported-by: syzbot <syzkaller@googlegroups.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv6/mcast.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/net/ipv6/mcast.c
++++ b/net/ipv6/mcast.c
+@@ -772,12 +772,13 @@ static void mld_del_delrec(struct inet6_
+ im->idev = pmc->idev;
+ im->mca_crcount = idev->mc_qrv;
+ if (im->mca_sfmode == MCAST_INCLUDE) {
+- im->mca_tomb = pmc->mca_tomb;
+- im->mca_sources = pmc->mca_sources;
++ swap(im->mca_tomb, pmc->mca_tomb);
++ swap(im->mca_sources, pmc->mca_sources);
+ for (psf = im->mca_sources; psf; psf = psf->sf_next)
+ psf->sf_crcount = im->mca_crcount;
+ }
+ in6_dev_put(pmc->idev);
++ ip6_mc_clear_src(pmc);
+ kfree(pmc);
+ }
+ spin_unlock_bh(&im->mca_lock);
--- /dev/null
+From foo@baz Sun 08 Sep 2019 11:09:01 AM WEST
+From: Feng Sun <loyou85@gmail.com>
+Date: Mon, 26 Aug 2019 14:46:04 +0800
+Subject: net: fix skb use after free in netpoll
+
+From: Feng Sun <loyou85@gmail.com>
+
+[ Upstream commit 2c1644cf6d46a8267d79ed95cb9b563839346562 ]
+
+After commit baeababb5b85d5c4e6c917efe2a1504179438d3b
+("tun: return NET_XMIT_DROP for dropped packets"),
+when tun_net_xmit drop packets, it will free skb and return NET_XMIT_DROP,
+netpoll_send_skb_on_dev will run into following use after free cases:
+1. retry netpoll_start_xmit with freed skb;
+2. queue freed skb in npinfo->txq.
+queue_process will also run into use after free case.
+
+hit netpoll_send_skb_on_dev first case with following kernel log:
+
+[ 117.864773] kernel BUG at mm/slub.c:306!
+[ 117.864773] invalid opcode: 0000 [#1] SMP PTI
+[ 117.864774] CPU: 3 PID: 2627 Comm: loop_printmsg Kdump: loaded Tainted: P OE 5.3.0-050300rc5-generic #201908182231
+[ 117.864775] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
+[ 117.864775] RIP: 0010:kmem_cache_free+0x28d/0x2b0
+[ 117.864781] Call Trace:
+[ 117.864781] ? tun_net_xmit+0x21c/0x460
+[ 117.864781] kfree_skbmem+0x4e/0x60
+[ 117.864782] kfree_skb+0x3a/0xa0
+[ 117.864782] tun_net_xmit+0x21c/0x460
+[ 117.864782] netpoll_start_xmit+0x11d/0x1b0
+[ 117.864788] netpoll_send_skb_on_dev+0x1b8/0x200
+[ 117.864789] __br_forward+0x1b9/0x1e0 [bridge]
+[ 117.864789] ? skb_clone+0x53/0xd0
+[ 117.864790] ? __skb_clone+0x2e/0x120
+[ 117.864790] deliver_clone+0x37/0x50 [bridge]
+[ 117.864790] maybe_deliver+0x89/0xc0 [bridge]
+[ 117.864791] br_flood+0x6c/0x130 [bridge]
+[ 117.864791] br_dev_xmit+0x315/0x3c0 [bridge]
+[ 117.864792] netpoll_start_xmit+0x11d/0x1b0
+[ 117.864792] netpoll_send_skb_on_dev+0x1b8/0x200
+[ 117.864792] netpoll_send_udp+0x2c6/0x3e8
+[ 117.864793] write_msg+0xd9/0xf0 [netconsole]
+[ 117.864793] console_unlock+0x386/0x4e0
+[ 117.864793] vprintk_emit+0x17e/0x280
+[ 117.864794] vprintk_default+0x29/0x50
+[ 117.864794] vprintk_func+0x4c/0xbc
+[ 117.864794] printk+0x58/0x6f
+[ 117.864795] loop_fun+0x24/0x41 [printmsg_loop]
+[ 117.864795] kthread+0x104/0x140
+[ 117.864795] ? 0xffffffffc05b1000
+[ 117.864796] ? kthread_park+0x80/0x80
+[ 117.864796] ret_from_fork+0x35/0x40
+
+Signed-off-by: Feng Sun <loyou85@gmail.com>
+Signed-off-by: Xiaojun Zhao <xiaojunzhao141@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/core/netpoll.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/net/core/netpoll.c
++++ b/net/core/netpoll.c
+@@ -122,7 +122,7 @@ static void queue_process(struct work_st
+ txq = netdev_get_tx_queue(dev, q_index);
+ HARD_TX_LOCK(dev, txq, smp_processor_id());
+ if (netif_xmit_frozen_or_stopped(txq) ||
+- netpoll_start_xmit(skb, dev, txq) != NETDEV_TX_OK) {
++ !dev_xmit_complete(netpoll_start_xmit(skb, dev, txq))) {
+ skb_queue_head(&npinfo->txq, skb);
+ HARD_TX_UNLOCK(dev, txq);
+ local_irq_restore(flags);
+@@ -357,7 +357,7 @@ void netpoll_send_skb_on_dev(struct netp
+
+ HARD_TX_UNLOCK(dev, txq);
+
+- if (status == NETDEV_TX_OK)
++ if (dev_xmit_complete(status))
+ break;
+
+ }
+@@ -374,7 +374,7 @@ void netpoll_send_skb_on_dev(struct netp
+
+ }
+
+- if (status != NETDEV_TX_OK) {
++ if (!dev_xmit_complete(status)) {
+ skb_queue_tail(&npinfo->txq, skb);
+ schedule_delayed_work(&npinfo->tx_work,0);
+ }
--- /dev/null
+From foo@baz Sun 08 Sep 2019 11:09:01 AM WEST
+From: Vlad Buslov <vladbu@mellanox.com>
+Date: Tue, 27 Aug 2019 21:49:38 +0300
+Subject: net: sched: act_sample: fix psample group handling on overwrite
+
+From: Vlad Buslov <vladbu@mellanox.com>
+
+[ Upstream commit dbf47a2a094edf58983265e323ca4bdcdb58b5ee ]
+
+Action sample doesn't properly handle psample_group pointer in overwrite
+case. Following issues need to be fixed:
+
+- In tcf_sample_init() function RCU_INIT_POINTER() is used to set
+ s->psample_group, even though we neither setting the pointer to NULL, nor
+ preventing concurrent readers from accessing the pointer in some way.
+ Use rcu_swap_protected() instead to safely reset the pointer.
+
+- Old value of s->psample_group is not released or deallocated in any way,
+ which results resource leak. Use psample_group_put() on non-NULL value
+ obtained with rcu_swap_protected().
+
+- The function psample_group_put() that released reference to struct
+ psample_group pointed by rcu-pointer s->psample_group doesn't respect rcu
+ grace period when deallocating it. Extend struct psample_group with rcu
+ head and use kfree_rcu when freeing it.
+
+Fixes: 5c5670fae430 ("net/sched: Introduce sample tc action")
+Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/net/psample.h | 1 +
+ net/psample/psample.c | 2 +-
+ net/sched/act_sample.c | 5 ++++-
+ 3 files changed, 6 insertions(+), 2 deletions(-)
+
+--- a/include/net/psample.h
++++ b/include/net/psample.h
+@@ -12,6 +12,7 @@ struct psample_group {
+ u32 group_num;
+ u32 refcount;
+ u32 seq;
++ struct rcu_head rcu;
+ };
+
+ struct psample_group *psample_group_get(struct net *net, u32 group_num);
+--- a/net/psample/psample.c
++++ b/net/psample/psample.c
+@@ -156,7 +156,7 @@ static void psample_group_destroy(struct
+ {
+ psample_group_notify(group, PSAMPLE_CMD_DEL_GROUP);
+ list_del(&group->list);
+- kfree(group);
++ kfree_rcu(group, rcu);
+ }
+
+ static struct psample_group *
+--- a/net/sched/act_sample.c
++++ b/net/sched/act_sample.c
+@@ -92,13 +92,16 @@ static int tcf_sample_init(struct net *n
+ tcf_idr_release(*a, bind);
+ return -ENOMEM;
+ }
+- RCU_INIT_POINTER(s->psample_group, psample_group);
++ rcu_swap_protected(s->psample_group, psample_group,
++ lockdep_is_held(&s->tcf_lock));
+
+ if (tb[TCA_SAMPLE_TRUNC_SIZE]) {
+ s->truncate = true;
+ s->trunc_size = nla_get_u32(tb[TCA_SAMPLE_TRUNC_SIZE]);
+ }
+
++ if (psample_group)
++ psample_group_put(psample_group);
+ if (ret == ACT_P_CREATED)
+ tcf_idr_insert(tn, *a);
+ return ret;
--- /dev/null
+From foo@baz Sun 08 Sep 2019 11:09:01 AM WEST
+From: Chen-Yu Tsai <wens@csie.org>
+Date: Thu, 29 Aug 2019 11:17:24 +0800
+Subject: net: stmmac: dwmac-rk: Don't fail if phy regulator is absent
+
+From: Chen-Yu Tsai <wens@csie.org>
+
+[ Upstream commit 3b25528e1e355c803e73aa326ce657b5606cda73 ]
+
+The devicetree binding lists the phy phy as optional. As such, the
+driver should not bail out if it can't find a regulator. Instead it
+should just skip the remaining regulator related code and continue
+on normally.
+
+Skip the remainder of phy_power_on() if a regulator supply isn't
+available. This also gets rid of the bogus return code.
+
+Fixes: 2e12f536635f ("net: stmmac: dwmac-rk: Use standard devicetree property for phy regulator")
+Signed-off-by: Chen-Yu Tsai <wens@csie.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+@@ -1145,10 +1145,8 @@ static int phy_power_on(struct rk_priv_d
+ int ret;
+ struct device *dev = &bsp_priv->pdev->dev;
+
+- if (!ldo) {
+- dev_err(dev, "no regulator found\n");
+- return -1;
+- }
++ if (!ldo)
++ return 0;
+
+ if (enable) {
+ ret = regulator_enable(ldo);
--- /dev/null
+From foo@baz Sun 08 Sep 2019 11:09:01 AM WEST
+From: Cong Wang <xiyou.wangcong@gmail.com>
+Date: Sun, 25 Aug 2019 10:01:32 -0700
+Subject: net_sched: fix a NULL pointer deref in ipt action
+
+From: Cong Wang <xiyou.wangcong@gmail.com>
+
+[ Upstream commit 981471bd3abf4d572097645d765391533aac327d ]
+
+The net pointer in struct xt_tgdtor_param is not explicitly
+initialized therefore is still NULL when dereferencing it.
+So we have to find a way to pass the correct net pointer to
+ipt_destroy_target().
+
+The best way I find is just saving the net pointer inside the per
+netns struct tcf_idrinfo, which could make this patch smaller.
+
+Fixes: 0c66dc1ea3f0 ("netfilter: conntrack: register hooks in netns when needed by ruleset")
+Reported-and-tested-by: itugrok@yahoo.com
+Cc: Jamal Hadi Salim <jhs@mojatatu.com>
+Cc: Jiri Pirko <jiri@resnulli.us>
+Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/net/act_api.h | 4 +++-
+ net/sched/act_bpf.c | 2 +-
+ net/sched/act_connmark.c | 2 +-
+ net/sched/act_csum.c | 2 +-
+ net/sched/act_gact.c | 2 +-
+ net/sched/act_ife.c | 2 +-
+ net/sched/act_ipt.c | 11 ++++++-----
+ net/sched/act_mirred.c | 2 +-
+ net/sched/act_nat.c | 2 +-
+ net/sched/act_pedit.c | 2 +-
+ net/sched/act_police.c | 2 +-
+ net/sched/act_sample.c | 2 +-
+ net/sched/act_simple.c | 2 +-
+ net/sched/act_skbedit.c | 2 +-
+ net/sched/act_skbmod.c | 2 +-
+ net/sched/act_tunnel_key.c | 2 +-
+ net/sched/act_vlan.c | 2 +-
+ 17 files changed, 24 insertions(+), 21 deletions(-)
+
+--- a/include/net/act_api.h
++++ b/include/net/act_api.h
+@@ -14,6 +14,7 @@
+ struct tcf_idrinfo {
+ spinlock_t lock;
+ struct idr action_idr;
++ struct net *net;
+ };
+
+ struct tc_action_ops;
+@@ -104,7 +105,7 @@ struct tc_action_net {
+ };
+
+ static inline
+-int tc_action_net_init(struct tc_action_net *tn,
++int tc_action_net_init(struct net *net, struct tc_action_net *tn,
+ const struct tc_action_ops *ops)
+ {
+ int err = 0;
+@@ -113,6 +114,7 @@ int tc_action_net_init(struct tc_action_
+ if (!tn->idrinfo)
+ return -ENOMEM;
+ tn->ops = ops;
++ tn->idrinfo->net = net;
+ spin_lock_init(&tn->idrinfo->lock);
+ idr_init(&tn->idrinfo->action_idr);
+ return err;
+--- a/net/sched/act_bpf.c
++++ b/net/sched/act_bpf.c
+@@ -402,7 +402,7 @@ static __net_init int bpf_init_net(struc
+ {
+ struct tc_action_net *tn = net_generic(net, bpf_net_id);
+
+- return tc_action_net_init(tn, &act_bpf_ops);
++ return tc_action_net_init(net, tn, &act_bpf_ops);
+ }
+
+ static void __net_exit bpf_exit_net(struct net *net)
+--- a/net/sched/act_connmark.c
++++ b/net/sched/act_connmark.c
+@@ -206,7 +206,7 @@ static __net_init int connmark_init_net(
+ {
+ struct tc_action_net *tn = net_generic(net, connmark_net_id);
+
+- return tc_action_net_init(tn, &act_connmark_ops);
++ return tc_action_net_init(net, tn, &act_connmark_ops);
+ }
+
+ static void __net_exit connmark_exit_net(struct net *net)
+--- a/net/sched/act_csum.c
++++ b/net/sched/act_csum.c
+@@ -632,7 +632,7 @@ static __net_init int csum_init_net(stru
+ {
+ struct tc_action_net *tn = net_generic(net, csum_net_id);
+
+- return tc_action_net_init(tn, &act_csum_ops);
++ return tc_action_net_init(net, tn, &act_csum_ops);
+ }
+
+ static void __net_exit csum_exit_net(struct net *net)
+--- a/net/sched/act_gact.c
++++ b/net/sched/act_gact.c
+@@ -232,7 +232,7 @@ static __net_init int gact_init_net(stru
+ {
+ struct tc_action_net *tn = net_generic(net, gact_net_id);
+
+- return tc_action_net_init(tn, &act_gact_ops);
++ return tc_action_net_init(net, tn, &act_gact_ops);
+ }
+
+ static void __net_exit gact_exit_net(struct net *net)
+--- a/net/sched/act_ife.c
++++ b/net/sched/act_ife.c
+@@ -837,7 +837,7 @@ static __net_init int ife_init_net(struc
+ {
+ struct tc_action_net *tn = net_generic(net, ife_net_id);
+
+- return tc_action_net_init(tn, &act_ife_ops);
++ return tc_action_net_init(net, tn, &act_ife_ops);
+ }
+
+ static void __net_exit ife_exit_net(struct net *net)
+--- a/net/sched/act_ipt.c
++++ b/net/sched/act_ipt.c
+@@ -65,12 +65,13 @@ static int ipt_init_target(struct net *n
+ return 0;
+ }
+
+-static void ipt_destroy_target(struct xt_entry_target *t)
++static void ipt_destroy_target(struct xt_entry_target *t, struct net *net)
+ {
+ struct xt_tgdtor_param par = {
+ .target = t->u.kernel.target,
+ .targinfo = t->data,
+ .family = NFPROTO_IPV4,
++ .net = net,
+ };
+ if (par.target->destroy != NULL)
+ par.target->destroy(&par);
+@@ -82,7 +83,7 @@ static void tcf_ipt_release(struct tc_ac
+ struct tcf_ipt *ipt = to_ipt(a);
+
+ if (ipt->tcfi_t) {
+- ipt_destroy_target(ipt->tcfi_t);
++ ipt_destroy_target(ipt->tcfi_t, a->idrinfo->net);
+ kfree(ipt->tcfi_t);
+ }
+ kfree(ipt->tcfi_tname);
+@@ -172,7 +173,7 @@ static int __tcf_ipt_init(struct net *ne
+
+ spin_lock_bh(&ipt->tcf_lock);
+ if (ret != ACT_P_CREATED) {
+- ipt_destroy_target(ipt->tcfi_t);
++ ipt_destroy_target(ipt->tcfi_t, net);
+ kfree(ipt->tcfi_tname);
+ kfree(ipt->tcfi_t);
+ }
+@@ -337,7 +338,7 @@ static __net_init int ipt_init_net(struc
+ {
+ struct tc_action_net *tn = net_generic(net, ipt_net_id);
+
+- return tc_action_net_init(tn, &act_ipt_ops);
++ return tc_action_net_init(net, tn, &act_ipt_ops);
+ }
+
+ static void __net_exit ipt_exit_net(struct net *net)
+@@ -387,7 +388,7 @@ static __net_init int xt_init_net(struct
+ {
+ struct tc_action_net *tn = net_generic(net, xt_net_id);
+
+- return tc_action_net_init(tn, &act_xt_ops);
++ return tc_action_net_init(net, tn, &act_xt_ops);
+ }
+
+ static void __net_exit xt_exit_net(struct net *net)
+--- a/net/sched/act_mirred.c
++++ b/net/sched/act_mirred.c
+@@ -343,7 +343,7 @@ static __net_init int mirred_init_net(st
+ {
+ struct tc_action_net *tn = net_generic(net, mirred_net_id);
+
+- return tc_action_net_init(tn, &act_mirred_ops);
++ return tc_action_net_init(net, tn, &act_mirred_ops);
+ }
+
+ static void __net_exit mirred_exit_net(struct net *net)
+--- a/net/sched/act_nat.c
++++ b/net/sched/act_nat.c
+@@ -307,7 +307,7 @@ static __net_init int nat_init_net(struc
+ {
+ struct tc_action_net *tn = net_generic(net, nat_net_id);
+
+- return tc_action_net_init(tn, &act_nat_ops);
++ return tc_action_net_init(net, tn, &act_nat_ops);
+ }
+
+ static void __net_exit nat_exit_net(struct net *net)
+--- a/net/sched/act_pedit.c
++++ b/net/sched/act_pedit.c
+@@ -458,7 +458,7 @@ static __net_init int pedit_init_net(str
+ {
+ struct tc_action_net *tn = net_generic(net, pedit_net_id);
+
+- return tc_action_net_init(tn, &act_pedit_ops);
++ return tc_action_net_init(net, tn, &act_pedit_ops);
+ }
+
+ static void __net_exit pedit_exit_net(struct net *net)
+--- a/net/sched/act_police.c
++++ b/net/sched/act_police.c
+@@ -331,7 +331,7 @@ static __net_init int police_init_net(st
+ {
+ struct tc_action_net *tn = net_generic(net, police_net_id);
+
+- return tc_action_net_init(tn, &act_police_ops);
++ return tc_action_net_init(net, tn, &act_police_ops);
+ }
+
+ static void __net_exit police_exit_net(struct net *net)
+--- a/net/sched/act_sample.c
++++ b/net/sched/act_sample.c
+@@ -249,7 +249,7 @@ static __net_init int sample_init_net(st
+ {
+ struct tc_action_net *tn = net_generic(net, sample_net_id);
+
+- return tc_action_net_init(tn, &act_sample_ops);
++ return tc_action_net_init(net, tn, &act_sample_ops);
+ }
+
+ static void __net_exit sample_exit_net(struct net *net)
+--- a/net/sched/act_simple.c
++++ b/net/sched/act_simple.c
+@@ -198,7 +198,7 @@ static __net_init int simp_init_net(stru
+ {
+ struct tc_action_net *tn = net_generic(net, simp_net_id);
+
+- return tc_action_net_init(tn, &act_simp_ops);
++ return tc_action_net_init(net, tn, &act_simp_ops);
+ }
+
+ static void __net_exit simp_exit_net(struct net *net)
+--- a/net/sched/act_skbedit.c
++++ b/net/sched/act_skbedit.c
+@@ -239,7 +239,7 @@ static __net_init int skbedit_init_net(s
+ {
+ struct tc_action_net *tn = net_generic(net, skbedit_net_id);
+
+- return tc_action_net_init(tn, &act_skbedit_ops);
++ return tc_action_net_init(net, tn, &act_skbedit_ops);
+ }
+
+ static void __net_exit skbedit_exit_net(struct net *net)
+--- a/net/sched/act_skbmod.c
++++ b/net/sched/act_skbmod.c
+@@ -267,7 +267,7 @@ static __net_init int skbmod_init_net(st
+ {
+ struct tc_action_net *tn = net_generic(net, skbmod_net_id);
+
+- return tc_action_net_init(tn, &act_skbmod_ops);
++ return tc_action_net_init(net, tn, &act_skbmod_ops);
+ }
+
+ static void __net_exit skbmod_exit_net(struct net *net)
+--- a/net/sched/act_tunnel_key.c
++++ b/net/sched/act_tunnel_key.c
+@@ -324,7 +324,7 @@ static __net_init int tunnel_key_init_ne
+ {
+ struct tc_action_net *tn = net_generic(net, tunnel_key_net_id);
+
+- return tc_action_net_init(tn, &act_tunnel_key_ops);
++ return tc_action_net_init(net, tn, &act_tunnel_key_ops);
+ }
+
+ static void __net_exit tunnel_key_exit_net(struct net *net)
+--- a/net/sched/act_vlan.c
++++ b/net/sched/act_vlan.c
+@@ -271,7 +271,7 @@ static __net_init int vlan_init_net(stru
+ {
+ struct tc_action_net *tn = net_generic(net, vlan_net_id);
+
+- return tc_action_net_init(tn, &act_vlan_ops);
++ return tc_action_net_init(net, tn, &act_vlan_ops);
+ }
+
+ static void __net_exit vlan_exit_net(struct net *net)
spi-bcm2835aux-remove-dangerous-uncontrolled-read-of.patch
spi-bcm2835aux-fix-corruptions-for-longer-spi-transf.patch
revert-x86-apic-include-the-ldr-when-clearing-out-ap.patch
+net-fix-skb-use-after-free-in-netpoll.patch
+net_sched-fix-a-null-pointer-deref-in-ipt-action.patch
+net-stmmac-dwmac-rk-don-t-fail-if-phy-regulator-is-absent.patch
+tcp-inherit-timestamp-on-mtu-probe.patch
+tcp-remove-empty-skb-from-write-queue-in-error-cases.patch
+net-sched-act_sample-fix-psample-group-handling-on-overwrite.patch
+mld-fix-memory-leak-in-mld_del_delrec.patch
--- /dev/null
+From foo@baz Sun 08 Sep 2019 11:09:01 AM WEST
+From: Willem de Bruijn <willemb@google.com>
+Date: Tue, 27 Aug 2019 15:09:33 -0400
+Subject: tcp: inherit timestamp on mtu probe
+
+From: Willem de Bruijn <willemb@google.com>
+
+[ Upstream commit 888a5c53c0d8be6e98bc85b677f179f77a647873 ]
+
+TCP associates tx timestamp requests with a byte in the bytestream.
+If merging skbs in tcp_mtu_probe, migrate the tstamp request.
+
+Similar to MSG_EOR, do not allow moving a timestamp from any segment
+in the probe but the last. This to avoid merging multiple timestamps.
+
+Tested with the packetdrill script at
+https://github.com/wdebruij/packetdrill/commits/mtu_probe-1
+
+Link: http://patchwork.ozlabs.org/patch/1143278/#2232897
+Fixes: 4ed2d765dfac ("net-timestamp: TCP timestamping")
+Signed-off-by: Willem de Bruijn <willemb@google.com>
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/tcp_output.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -2025,7 +2025,7 @@ static bool tcp_can_coalesce_send_queue_
+ if (len <= skb->len)
+ break;
+
+- if (unlikely(TCP_SKB_CB(skb)->eor))
++ if (unlikely(TCP_SKB_CB(skb)->eor) || tcp_has_tx_tstamp(skb))
+ return false;
+
+ len -= skb->len;
+@@ -2148,6 +2148,7 @@ static int tcp_mtu_probe(struct sock *sk
+ * we need to propagate it to the new skb.
+ */
+ TCP_SKB_CB(nskb)->eor = TCP_SKB_CB(skb)->eor;
++ tcp_skb_collapse_tstamp(nskb, skb);
+ tcp_unlink_write_queue(skb, sk);
+ sk_wmem_free_skb(sk, skb);
+ } else {
--- /dev/null
+From foo@baz Sun 08 Sep 2019 11:09:01 AM WEST
+From: Eric Dumazet <edumazet@google.com>
+Date: Mon, 26 Aug 2019 09:19:15 -0700
+Subject: tcp: remove empty skb from write queue in error cases
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit fdfc5c8594c24c5df883583ebd286321a80e0a67 ]
+
+Vladimir Rutsky reported stuck TCP sessions after memory pressure
+events. Edge Trigger epoll() user would never receive an EPOLLOUT
+notification allowing them to retry a sendmsg().
+
+Jason tested the case of sk_stream_alloc_skb() returning NULL,
+but there are other paths that could lead both sendmsg() and sendpage()
+to return -1 (EAGAIN), with an empty skb queued on the write queue.
+
+This patch makes sure we remove this empty skb so that
+Jason code can detect that the queue is empty, and
+call sk->sk_write_space(sk) accordingly.
+
+Fixes: ce5ec440994b ("tcp: ensure epoll edge trigger wakeup when write queue is empty")
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Cc: Jason Baron <jbaron@akamai.com>
+Reported-by: Vladimir Rutsky <rutsky@google.com>
+Cc: Soheil Hassas Yeganeh <soheil@google.com>
+Cc: Neal Cardwell <ncardwell@google.com>
+Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
+Acked-by: Neal Cardwell <ncardwell@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/tcp.c | 29 ++++++++++++++++++++---------
+ 1 file changed, 20 insertions(+), 9 deletions(-)
+
+--- a/net/ipv4/tcp.c
++++ b/net/ipv4/tcp.c
+@@ -914,6 +914,22 @@ static int tcp_send_mss(struct sock *sk,
+ return mss_now;
+ }
+
++/* In some cases, both sendpage() and sendmsg() could have added
++ * an skb to the write queue, but failed adding payload on it.
++ * We need to remove it to consume less memory, but more
++ * importantly be able to generate EPOLLOUT for Edge Trigger epoll()
++ * users.
++ */
++static void tcp_remove_empty_skb(struct sock *sk, struct sk_buff *skb)
++{
++ if (skb && !skb->len) {
++ tcp_unlink_write_queue(skb, sk);
++ if (tcp_write_queue_empty(sk))
++ tcp_chrono_stop(sk, TCP_CHRONO_BUSY);
++ sk_wmem_free_skb(sk, skb);
++ }
++}
++
+ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,
+ size_t size, int flags)
+ {
+@@ -1034,6 +1050,7 @@ out:
+ return copied;
+
+ do_error:
++ tcp_remove_empty_skb(sk, tcp_write_queue_tail(sk));
+ if (copied)
+ goto out;
+ out_err:
+@@ -1412,17 +1429,11 @@ out_nopush:
+ sock_zerocopy_put(uarg);
+ return copied + copied_syn;
+
++do_error:
++ skb = tcp_write_queue_tail(sk);
+ do_fault:
+- if (!skb->len) {
+- tcp_unlink_write_queue(skb, sk);
+- /* It is the one place in all of TCP, except connection
+- * reset, where we can be unlinking the send_head.
+- */
+- tcp_check_send_head(sk, skb);
+- sk_wmem_free_skb(sk, skb);
+- }
++ tcp_remove_empty_skb(sk, skb);
+
+-do_error:
+ if (copied + copied_syn)
+ goto out;
+ out_err: