]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Fri, 26 Jun 2020 18:07:36 +0000 (14:07 -0400)
committerSasha Levin <sashal@kernel.org>
Fri, 26 Jun 2020 18:07:36 +0000 (14:07 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/fix-a-braino-in-sparc32-fix-register-window-handling.patch [new file with mode: 0644]
queue-4.14/net-be-more-gentle-about-silly-gso-requests-coming-f.patch [new file with mode: 0644]
queue-4.14/net-sched-export-__netdev_watchdog_up.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/fix-a-braino-in-sparc32-fix-register-window-handling.patch b/queue-4.14/fix-a-braino-in-sparc32-fix-register-window-handling.patch
new file mode 100644 (file)
index 0000000..f591d38
--- /dev/null
@@ -0,0 +1,46 @@
+From ef820bbd1a24647456104590a11a1f6a91f880c7 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 6 Jun 2020 23:44:24 -0400
+Subject: fix a braino in "sparc32: fix register window handling in
+ genregs32_[gs]et()"
+
+From: Al Viro <viro@zeniv.linux.org.uk>
+
+[ Upstream commit 9d964e1b82d8182184153b70174f445ea616f053 ]
+
+lost npc in PTRACE_SETREGSET, breaking PTRACE_SETREGS as well
+
+Fixes: cf51e129b968 "sparc32: fix register window handling in genregs32_[gs]et()"
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/sparc/kernel/ptrace_32.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c
+index 60f7205ebe40d..646dd58169ecb 100644
+--- a/arch/sparc/kernel/ptrace_32.c
++++ b/arch/sparc/kernel/ptrace_32.c
+@@ -168,12 +168,17 @@ static int genregs32_set(struct task_struct *target,
+       if (ret || !count)
+               return ret;
+       ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
+-                               &regs->y,
++                               &regs->npc,
+                                34 * sizeof(u32), 35 * sizeof(u32));
+       if (ret || !count)
+               return ret;
++      ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
++                               &regs->y,
++                               35 * sizeof(u32), 36 * sizeof(u32));
++      if (ret || !count)
++              return ret;
+       return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
+-                                       35 * sizeof(u32), 38 * sizeof(u32));
++                                       36 * sizeof(u32), 38 * sizeof(u32));
+ }
+ static int fpregs32_get(struct task_struct *target,
+-- 
+2.25.1
+
diff --git a/queue-4.14/net-be-more-gentle-about-silly-gso-requests-coming-f.patch b/queue-4.14/net-be-more-gentle-about-silly-gso-requests-coming-f.patch
new file mode 100644 (file)
index 0000000..50b3592
--- /dev/null
@@ -0,0 +1,74 @@
+From a7356cc9ba83132190ec15a1e27f7e84b37f6ceb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 28 May 2020 14:57:47 -0700
+Subject: net: be more gentle about silly gso requests coming from user
+
+From: Eric Dumazet <edumazet@google.com>
+
+[ Upstream commit 7c6d2ecbda83150b2036a2b36b21381ad4667762 ]
+
+Recent change in virtio_net_hdr_to_skb() broke some packetdrill tests.
+
+When --mss=XXX option is set, packetdrill always provide gso_type & gso_size
+for its inbound packets, regardless of packet size.
+
+       if (packet->tcp && packet->mss) {
+               if (packet->ipv4)
+                       gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
+               else
+                       gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
+               gso.gso_size = packet->mss;
+       }
+
+Since many other programs could do the same, relax virtio_net_hdr_to_skb()
+to no longer return an error, but instead ignore gso settings.
+
+This keeps Willem intent to make sure no malicious packet could
+reach gso stack.
+
+Note that TCP stack has a special logic in tcp_set_skb_tso_segs()
+to clear gso_size for small packets.
+
+Fixes: 6dd912f82680 ("net: check untrusted gso_size at kernel entry")
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Cc: Willem de Bruijn <willemb@google.com>
+Acked-by: Willem de Bruijn <willemb@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/virtio_net.h | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
+index a16e0bdf77511..d19bfdcf77498 100644
+--- a/include/linux/virtio_net.h
++++ b/include/linux/virtio_net.h
+@@ -107,16 +107,17 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
+       if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
+               u16 gso_size = __virtio16_to_cpu(little_endian, hdr->gso_size);
++              struct skb_shared_info *shinfo = skb_shinfo(skb);
+-              if (skb->len - p_off <= gso_size)
+-                      return -EINVAL;
+-
+-              skb_shinfo(skb)->gso_size = gso_size;
+-              skb_shinfo(skb)->gso_type = gso_type;
++              /* Too small packets are not really GSO ones. */
++              if (skb->len - p_off > gso_size) {
++                      shinfo->gso_size = gso_size;
++                      shinfo->gso_type = gso_type;
+-              /* Header must be checked, and gso_segs computed. */
+-              skb_shinfo(skb)->gso_type |= SKB_GSO_DODGY;
+-              skb_shinfo(skb)->gso_segs = 0;
++                      /* Header must be checked, and gso_segs computed. */
++                      shinfo->gso_type |= SKB_GSO_DODGY;
++                      shinfo->gso_segs = 0;
++              }
+       }
+       return 0;
+-- 
+2.25.1
+
diff --git a/queue-4.14/net-sched-export-__netdev_watchdog_up.patch b/queue-4.14/net-sched-export-__netdev_watchdog_up.patch
new file mode 100644 (file)
index 0000000..760aa5a
--- /dev/null
@@ -0,0 +1,42 @@
+From 934bc414ce619a09ea39a9563aeb57eb3b3b7e7a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 9 Jun 2020 22:11:54 +0200
+Subject: net: sched: export __netdev_watchdog_up()
+
+From: Valentin Longchamp <valentin@longchamp.me>
+
+[ Upstream commit 1a3db27ad9a72d033235b9673653962c02e3486e ]
+
+Since the quiesce/activate rework, __netdev_watchdog_up() is directly
+called in the ucc_geth driver.
+
+Unfortunately, this function is not available for modules and thus
+ucc_geth cannot be built as a module anymore. Fix it by exporting
+__netdev_watchdog_up().
+
+Since the commit introducing the regression was backported to stable
+branches, this one should ideally be as well.
+
+Fixes: 79dde73cf9bc ("net/ethernet/freescale: rework quiesce/activate for ucc_geth")
+Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/sched/sch_generic.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
+index 21b981abbacb5..091a9746627fa 100644
+--- a/net/sched/sch_generic.c
++++ b/net/sched/sch_generic.c
+@@ -341,6 +341,7 @@ void __netdev_watchdog_up(struct net_device *dev)
+                       dev_hold(dev);
+       }
+ }
++EXPORT_SYMBOL_GPL(__netdev_watchdog_up);
+ static void dev_watchdog_up(struct net_device *dev)
+ {
+-- 
+2.25.1
+
index 51bf30c79fbfae8e8b7ca9143ff13023907de7ee..df8f11589983895abd7c04588a11071274c395ef 100644 (file)
@@ -1,3 +1,6 @@
 scsi-scsi_devinfo-handle-non-terminated-strings.patch
 net-be-more-gentle-about-silly-gso-requests-coming-from-user.patch
 block-bio-integrity-don-t-free-buf-if-bio_integrity_add_page-failed.patch
+net-sched-export-__netdev_watchdog_up.patch
+net-be-more-gentle-about-silly-gso-requests-coming-f.patch
+fix-a-braino-in-sparc32-fix-register-window-handling.patch