]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Apr 2020 09:36:42 +0000 (11:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Apr 2020 09:36:42 +0000 (11:36 +0200)
added patches:
amd-xgbe-use-__napi_schedule-in-bh-context.patch
hsr-check-protocol-version-in-hsr_newlink.patch
net-ipv4-devinet-fix-crash-when-add-del-multicast-ip-with-autojoin.patch
net-ipv6-do-not-consider-routes-via-gateways-for-anycast-address-check.patch
net-qrtr-send-msgs-from-local-of-same-id-as-broadcast.patch
net-revert-default-napi-poll-timeout-to-2-jiffies.patch
net-stmmac-dwmac-sunxi-provide-tx-and-rx-fifo-sizes.patch

queue-4.14/amd-xgbe-use-__napi_schedule-in-bh-context.patch [new file with mode: 0644]
queue-4.14/hsr-check-protocol-version-in-hsr_newlink.patch [new file with mode: 0644]
queue-4.14/net-ipv4-devinet-fix-crash-when-add-del-multicast-ip-with-autojoin.patch [new file with mode: 0644]
queue-4.14/net-ipv6-do-not-consider-routes-via-gateways-for-anycast-address-check.patch [new file with mode: 0644]
queue-4.14/net-qrtr-send-msgs-from-local-of-same-id-as-broadcast.patch [new file with mode: 0644]
queue-4.14/net-revert-default-napi-poll-timeout-to-2-jiffies.patch [new file with mode: 0644]
queue-4.14/net-stmmac-dwmac-sunxi-provide-tx-and-rx-fifo-sizes.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/amd-xgbe-use-__napi_schedule-in-bh-context.patch b/queue-4.14/amd-xgbe-use-__napi_schedule-in-bh-context.patch
new file mode 100644 (file)
index 0000000..9bcb44e
--- /dev/null
@@ -0,0 +1,38 @@
+From foo@baz Sat 18 Apr 2020 11:32:56 AM CEST
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Thu, 16 Apr 2020 17:57:40 +0200
+Subject: amd-xgbe: Use __napi_schedule() in BH context
+
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+[ Upstream commit d518691cbd3be3dae218e05cca3f3fc9b2f1aa77 ]
+
+The driver uses __napi_schedule_irqoff() which is fine as long as it is
+invoked with disabled interrupts by everybody. Since the commit
+mentioned below the driver may invoke xgbe_isr_task() in tasklet/softirq
+context. This may lead to list corruption if another driver uses
+__napi_schedule_irqoff() in IRQ context.
+
+Use __napi_schedule() which safe to use from IRQ and softirq context.
+
+Fixes: 85b85c853401d ("amd-xgbe: Re-issue interrupt if interrupt status not cleared")
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
+Cc: Tom Lendacky <thomas.lendacky@amd.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/amd/xgbe/xgbe-drv.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
++++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+@@ -515,7 +515,7 @@ static void xgbe_isr_task(unsigned long
+                               xgbe_disable_rx_tx_ints(pdata);
+                               /* Turn on polling */
+-                              __napi_schedule_irqoff(&pdata->napi);
++                              __napi_schedule(&pdata->napi);
+                       }
+               } else {
+                       /* Don't clear Rx/Tx status if doing per channel DMA
diff --git a/queue-4.14/hsr-check-protocol-version-in-hsr_newlink.patch b/queue-4.14/hsr-check-protocol-version-in-hsr_newlink.patch
new file mode 100644 (file)
index 0000000..583bf4b
--- /dev/null
@@ -0,0 +1,53 @@
+From foo@baz Sat 18 Apr 2020 11:32:56 AM CEST
+From: Taehee Yoo <ap420073@gmail.com>
+Date: Tue, 7 Apr 2020 13:23:21 +0000
+Subject: hsr: check protocol version in hsr_newlink()
+
+From: Taehee Yoo <ap420073@gmail.com>
+
+[ Upstream commit 4faab8c446def7667adf1f722456c2f4c304069c ]
+
+In the current hsr code, only 0 and 1 protocol versions are valid.
+But current hsr code doesn't check the version, which is received by
+userspace.
+
+Test commands:
+    ip link add dummy0 type dummy
+    ip link add dummy1 type dummy
+    ip link add hsr0 type hsr slave1 dummy0 slave2 dummy1 version 4
+
+In the test commands, version 4 is invalid.
+So, the command should be failed.
+
+After this patch, following error will occur.
+"Error: hsr: Only versions 0..1 are supported."
+
+Fixes: ee1c27977284 ("net/hsr: Added support for HSR v1")
+Signed-off-by: Taehee Yoo <ap420073@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/hsr/hsr_netlink.c |   10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+--- a/net/hsr/hsr_netlink.c
++++ b/net/hsr/hsr_netlink.c
+@@ -64,10 +64,16 @@ static int hsr_newlink(struct net *src_n
+       else
+               multicast_spec = nla_get_u8(data[IFLA_HSR_MULTICAST_SPEC]);
+-      if (!data[IFLA_HSR_VERSION])
++      if (!data[IFLA_HSR_VERSION]) {
+               hsr_version = 0;
+-      else
++      } else {
+               hsr_version = nla_get_u8(data[IFLA_HSR_VERSION]);
++              if (hsr_version > 1) {
++                      NL_SET_ERR_MSG_MOD(extack,
++                                         "Only versions 0..1 are supported");
++                      return -EINVAL;
++              }
++      }
+       return hsr_dev_finalize(dev, link, multicast_spec, hsr_version);
+ }
diff --git a/queue-4.14/net-ipv4-devinet-fix-crash-when-add-del-multicast-ip-with-autojoin.patch b/queue-4.14/net-ipv4-devinet-fix-crash-when-add-del-multicast-ip-with-autojoin.patch
new file mode 100644 (file)
index 0000000..7ee5ef6
--- /dev/null
@@ -0,0 +1,100 @@
+From foo@baz Sat 18 Apr 2020 11:32:56 AM CEST
+From: Taras Chornyi <taras.chornyi@plvision.eu>
+Date: Thu, 9 Apr 2020 20:25:24 +0300
+Subject: net: ipv4: devinet: Fix crash when add/del multicast IP with autojoin
+
+From: Taras Chornyi <taras.chornyi@plvision.eu>
+
+[ Upstream commit 690cc86321eb9bcee371710252742fb16fe96824 ]
+
+When CONFIG_IP_MULTICAST is not set and multicast ip is added to the device
+with autojoin flag or when multicast ip is deleted kernel will crash.
+
+steps to reproduce:
+
+ip addr add 224.0.0.0/32 dev eth0
+ip addr del 224.0.0.0/32 dev eth0
+
+or
+
+ip addr add 224.0.0.0/32 dev eth0 autojoin
+
+Unable to handle kernel NULL pointer dereference at virtual address 0000000000000088
+ pc : _raw_write_lock_irqsave+0x1e0/0x2ac
+ lr : lock_sock_nested+0x1c/0x60
+ Call trace:
+  _raw_write_lock_irqsave+0x1e0/0x2ac
+  lock_sock_nested+0x1c/0x60
+  ip_mc_config.isra.28+0x50/0xe0
+  inet_rtm_deladdr+0x1a8/0x1f0
+  rtnetlink_rcv_msg+0x120/0x350
+  netlink_rcv_skb+0x58/0x120
+  rtnetlink_rcv+0x14/0x20
+  netlink_unicast+0x1b8/0x270
+  netlink_sendmsg+0x1a0/0x3b0
+  ____sys_sendmsg+0x248/0x290
+  ___sys_sendmsg+0x80/0xc0
+  __sys_sendmsg+0x68/0xc0
+  __arm64_sys_sendmsg+0x20/0x30
+  el0_svc_common.constprop.2+0x88/0x150
+  do_el0_svc+0x20/0x80
+ el0_sync_handler+0x118/0x190
+  el0_sync+0x140/0x180
+
+Fixes: 93a714d6b53d ("multicast: Extend ip address command to enable multicast group join/leave on")
+Signed-off-by: Taras Chornyi <taras.chornyi@plvision.eu>
+Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/devinet.c |   13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+--- a/net/ipv4/devinet.c
++++ b/net/ipv4/devinet.c
+@@ -579,12 +579,15 @@ struct in_ifaddr *inet_ifa_byprefix(stru
+       return NULL;
+ }
+-static int ip_mc_config(struct sock *sk, bool join, const struct in_ifaddr *ifa)
++static int ip_mc_autojoin_config(struct net *net, bool join,
++                               const struct in_ifaddr *ifa)
+ {
++#if defined(CONFIG_IP_MULTICAST)
+       struct ip_mreqn mreq = {
+               .imr_multiaddr.s_addr = ifa->ifa_address,
+               .imr_ifindex = ifa->ifa_dev->dev->ifindex,
+       };
++      struct sock *sk = net->ipv4.mc_autojoin_sk;
+       int ret;
+       ASSERT_RTNL();
+@@ -597,6 +600,9 @@ static int ip_mc_config(struct sock *sk,
+       release_sock(sk);
+       return ret;
++#else
++      return -EOPNOTSUPP;
++#endif
+ }
+ static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh,
+@@ -638,7 +644,7 @@ static int inet_rtm_deladdr(struct sk_bu
+                       continue;
+               if (ipv4_is_multicast(ifa->ifa_address))
+-                      ip_mc_config(net->ipv4.mc_autojoin_sk, false, ifa);
++                      ip_mc_autojoin_config(net, false, ifa);
+               __inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).portid);
+               return 0;
+       }
+@@ -896,8 +902,7 @@ static int inet_rtm_newaddr(struct sk_bu
+                */
+               set_ifa_lifetime(ifa, valid_lft, prefered_lft);
+               if (ifa->ifa_flags & IFA_F_MCAUTOJOIN) {
+-                      int ret = ip_mc_config(net->ipv4.mc_autojoin_sk,
+-                                             true, ifa);
++                      int ret = ip_mc_autojoin_config(net, true, ifa);
+                       if (ret < 0) {
+                               inet_free_ifa(ifa);
diff --git a/queue-4.14/net-ipv6-do-not-consider-routes-via-gateways-for-anycast-address-check.patch b/queue-4.14/net-ipv6-do-not-consider-routes-via-gateways-for-anycast-address-check.patch
new file mode 100644 (file)
index 0000000..792f7ed
--- /dev/null
@@ -0,0 +1,66 @@
+From foo@baz Sat 18 Apr 2020 11:32:56 AM CEST
+From: Tim Stallard <code@timstallard.me.uk>
+Date: Fri, 3 Apr 2020 21:26:21 +0100
+Subject: net: ipv6: do not consider routes via gateways for anycast address check
+
+From: Tim Stallard <code@timstallard.me.uk>
+
+[ Upstream commit 03e2a984b6165621f287fadf5f4b5cd8b58dcaba ]
+
+The behaviour for what is considered an anycast address changed in
+commit 45e4fd26683c ("ipv6: Only create RTF_CACHE routes after
+encountering pmtu exception"). This now considers the first
+address in a subnet where there is a route via a gateway
+to be an anycast address.
+
+This breaks path MTU discovery and traceroutes when a host in a
+remote network uses the address at the start of a prefix
+(eg 2600:: advertised as 2600::/48 in the DFZ) as ICMP errors
+will not be sent to anycast addresses.
+
+This patch excludes any routes with a gateway, or via point to
+point links, like the behaviour previously from
+rt6_is_gw_or_nonexthop in net/ipv6/route.c.
+
+This can be tested with:
+ip link add v1 type veth peer name v2
+ip netns add test
+ip netns exec test ip link set lo up
+ip link set v2 netns test
+ip link set v1 up
+ip netns exec test ip link set v2 up
+ip addr add 2001:db8::1/64 dev v1 nodad
+ip addr add 2001:db8:100:: dev lo nodad
+ip netns exec test ip addr add 2001:db8::2/64 dev v2 nodad
+ip netns exec test ip route add unreachable 2001:db8:1::1
+ip netns exec test ip route add 2001:db8:100::/64 via 2001:db8::1
+ip netns exec test sysctl net.ipv6.conf.all.forwarding=1
+ip route add 2001:db8:1::1 via 2001:db8::2
+ping -I 2001:db8::1 2001:db8:1::1 -c1
+ping -I 2001:db8:100:: 2001:db8:1::1 -c1
+ip addr delete 2001:db8:100:: dev lo
+ip netns delete test
+
+Currently the first ping will get back a destination unreachable ICMP
+error, but the second will never get a response, with "icmp6_send:
+acast source" logged. After this patch, both get destination
+unreachable ICMP replies.
+
+Fixes: 45e4fd26683c ("ipv6: Only create RTF_CACHE routes after encountering pmtu exception")
+Signed-off-by: Tim Stallard <code@timstallard.me.uk>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/net/ip6_route.h |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/include/net/ip6_route.h
++++ b/include/net/ip6_route.h
+@@ -207,6 +207,7 @@ static inline bool ipv6_anycast_destinat
+       return rt->rt6i_flags & RTF_ANYCAST ||
+               (rt->rt6i_dst.plen < 127 &&
++               !(rt->rt6i_flags & (RTF_GATEWAY | RTF_NONEXTHOP)) &&
+                ipv6_addr_equal(&rt->rt6i_dst.addr, daddr));
+ }
diff --git a/queue-4.14/net-qrtr-send-msgs-from-local-of-same-id-as-broadcast.patch b/queue-4.14/net-qrtr-send-msgs-from-local-of-same-id-as-broadcast.patch
new file mode 100644 (file)
index 0000000..c3256c4
--- /dev/null
@@ -0,0 +1,52 @@
+From foo@baz Sat 18 Apr 2020 11:32:56 AM CEST
+From: Wang Wenhu <wenhu.wang@vivo.com>
+Date: Wed, 8 Apr 2020 19:53:53 -0700
+Subject: net: qrtr: send msgs from local of same id as broadcast
+
+From: Wang Wenhu <wenhu.wang@vivo.com>
+
+[ Upstream commit 6dbf02acef69b0742c238574583b3068afbd227c ]
+
+If the local node id(qrtr_local_nid) is not modified after its
+initialization, it equals to the broadcast node id(QRTR_NODE_BCAST).
+So the messages from local node should not be taken as broadcast
+and keep the process going to send them out anyway.
+
+The definitions are as follow:
+static unsigned int qrtr_local_nid = NUMA_NO_NODE;
+
+Fixes: fdf5fd397566 ("net: qrtr: Broadcast messages only from control port")
+Signed-off-by: Wang Wenhu <wenhu.wang@vivo.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/qrtr/qrtr.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/net/qrtr/qrtr.c
++++ b/net/qrtr/qrtr.c
+@@ -710,20 +710,21 @@ static int qrtr_sendmsg(struct socket *s
+       node = NULL;
+       if (addr->sq_node == QRTR_NODE_BCAST) {
+-              enqueue_fn = qrtr_bcast_enqueue;
+-              if (addr->sq_port != QRTR_PORT_CTRL) {
++              if (addr->sq_port != QRTR_PORT_CTRL &&
++                  qrtr_local_nid != QRTR_NODE_BCAST) {
+                       release_sock(sk);
+                       return -ENOTCONN;
+               }
++              enqueue_fn = qrtr_bcast_enqueue;
+       } else if (addr->sq_node == ipc->us.sq_node) {
+               enqueue_fn = qrtr_local_enqueue;
+       } else {
+-              enqueue_fn = qrtr_node_enqueue;
+               node = qrtr_node_lookup(addr->sq_node);
+               if (!node) {
+                       release_sock(sk);
+                       return -ECONNRESET;
+               }
++              enqueue_fn = qrtr_node_enqueue;
+       }
+       plen = (len + 3) & ~3;
diff --git a/queue-4.14/net-revert-default-napi-poll-timeout-to-2-jiffies.patch b/queue-4.14/net-revert-default-napi-poll-timeout-to-2-jiffies.patch
new file mode 100644 (file)
index 0000000..b6f9c32
--- /dev/null
@@ -0,0 +1,35 @@
+From foo@baz Sat 18 Apr 2020 11:32:56 AM CEST
+From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
+Date: Mon, 6 Apr 2020 14:39:32 +0300
+Subject: net: revert default NAPI poll timeout to 2 jiffies
+
+From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
+
+[ Upstream commit a4837980fd9fa4c70a821d11831698901baef56b ]
+
+For HZ < 1000 timeout 2000us rounds up to 1 jiffy but expires randomly
+because next timer interrupt could come shortly after starting softirq.
+
+For commonly used CONFIG_HZ=1000 nothing changes.
+
+Fixes: 7acf8a1e8a28 ("Replace 2 jiffies with sysctl netdev_budget_usecs to enable softirq tuning")
+Reported-by: Dmitry Yakunin <zeil@yandex-team.ru>
+Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/core/dev.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -3575,7 +3575,8 @@ EXPORT_SYMBOL(netdev_max_backlog);
+ int netdev_tstamp_prequeue __read_mostly = 1;
+ int netdev_budget __read_mostly = 300;
+-unsigned int __read_mostly netdev_budget_usecs = 2000;
++/* Must be at least 2 jiffes to guarantee 1 jiffy timeout */
++unsigned int __read_mostly netdev_budget_usecs = 2 * USEC_PER_SEC / HZ;
+ int weight_p __read_mostly = 64;           /* old backlog weight */
+ int dev_weight_rx_bias __read_mostly = 1;  /* bias for backlog weight */
+ int dev_weight_tx_bias __read_mostly = 1;  /* bias for output_queue quota */
diff --git a/queue-4.14/net-stmmac-dwmac-sunxi-provide-tx-and-rx-fifo-sizes.patch b/queue-4.14/net-stmmac-dwmac-sunxi-provide-tx-and-rx-fifo-sizes.patch
new file mode 100644 (file)
index 0000000..d786750
--- /dev/null
@@ -0,0 +1,42 @@
+From foo@baz Sat 18 Apr 2020 11:32:56 AM CEST
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Tue, 14 Apr 2020 15:39:52 -0700
+Subject: net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes
+
+From: Florian Fainelli <f.fainelli@gmail.com>
+
+[ Upstream commit 806fd188ce2a4f8b587e83e73c478e6484fbfa55 ]
+
+After commit bfcb813203e619a8960a819bf533ad2a108d8105 ("net: dsa:
+configure the MTU for switch ports") my Lamobo R1 platform which uses
+an allwinner,sun7i-a20-gmac compatible Ethernet MAC started to fail
+by rejecting a MTU of 1536. The reason for that is that the DMA
+capabilities are not readable on this version of the IP, and there
+is also no 'tx-fifo-depth' property being provided in Device Tree. The
+property is documented as optional, and is not provided.
+
+Chen-Yu indicated that the FIFO sizes are 4KB for TX and 16KB for RX, so
+provide these values through platform data as an immediate fix until
+various Device Tree sources get updated accordingly.
+
+Fixes: eaf4fac47807 ("net: stmmac: Do not accept invalid MTU values")
+Suggested-by: Chen-Yu Tsai <wens@csie.org>
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+Acked-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-sunxi.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
+@@ -155,6 +155,8 @@ static int sun7i_gmac_probe(struct platf
+       plat_dat->init = sun7i_gmac_init;
+       plat_dat->exit = sun7i_gmac_exit;
+       plat_dat->fix_mac_speed = sun7i_fix_speed;
++      plat_dat->tx_fifo_size = 4096;
++      plat_dat->rx_fifo_size = 16384;
+       ret = sun7i_gmac_init(pdev, plat_dat->bsp_priv);
+       if (ret)
index 8122a02b6c76737f704ce43d62fcb87243cd4fe9..baec20ad2d86e2685496f54a8748e0559e8f8656 100644 (file)
@@ -103,3 +103,10 @@ ipmi-fix-hung-processes-in-__get_guid.patch
 powerpc-fsl_booke-avoid-creating-duplicate-tlb1-entr.patch
 misc-echo-remove-unnecessary-parentheses-and-simplif.patch
 mfd-dln2-fix-sanity-checking-for-endpoints.patch
+amd-xgbe-use-__napi_schedule-in-bh-context.patch
+hsr-check-protocol-version-in-hsr_newlink.patch
+net-ipv4-devinet-fix-crash-when-add-del-multicast-ip-with-autojoin.patch
+net-ipv6-do-not-consider-routes-via-gateways-for-anycast-address-check.patch
+net-qrtr-send-msgs-from-local-of-same-id-as-broadcast.patch
+net-revert-default-napi-poll-timeout-to-2-jiffies.patch
+net-stmmac-dwmac-sunxi-provide-tx-and-rx-fifo-sizes.patch