From 31202be14805d020db56baf72bee15e6f4727f03 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 14 Aug 2017 23:18:47 +0100 Subject: [PATCH] Update to 4.13-rc5 --- debian/changelog | 2 +- ...x-tp_reserve-race-in-packet_set_ring.patch | 51 ------ ...sistently-apply-ufo-or-fragmentation.patch | 94 ------------ .../mips-octeon-fix-broken-edac-driver.patch | 145 ------------------ debian/patches/series | 3 - 5 files changed, 1 insertion(+), 294 deletions(-) delete mode 100644 debian/patches/bugfix/all/packet-fix-tp_reserve-race-in-packet_set_ring.patch delete mode 100644 debian/patches/bugfix/all/udp-consistently-apply-ufo-or-fragmentation.patch delete mode 100644 debian/patches/bugfix/mips/mips-octeon-fix-broken-edac-driver.patch diff --git a/debian/changelog b/debian/changelog index bed0ebae0..79888e443 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -linux (4.13~rc4-1~exp1) UNRELEASED; urgency=medium +linux (4.13~rc5-1~exp1) UNRELEASED; urgency=medium * New upstream release candidate diff --git a/debian/patches/bugfix/all/packet-fix-tp_reserve-race-in-packet_set_ring.patch b/debian/patches/bugfix/all/packet-fix-tp_reserve-race-in-packet_set_ring.patch deleted file mode 100644 index d6e14ad86..000000000 --- a/debian/patches/bugfix/all/packet-fix-tp_reserve-race-in-packet_set_ring.patch +++ /dev/null @@ -1,51 +0,0 @@ -From: Willem de Bruijn -Date: Thu, 10 Aug 2017 12:41:58 -0400 -Subject: packet: fix tp_reserve race in packet_set_ring -Origin: https://git.kernel.org/linus/c27927e372f0785f3303e8fad94b85945e2c97b7 -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-1000111 - -Updates to tp_reserve can race with reads of the field in -packet_set_ring. Avoid this by holding the socket lock during -updates in setsockopt PACKET_RESERVE. - -This bug was discovered by syzkaller. - -Fixes: 8913336a7e8d ("packet: add PACKET_RESERVE sockopt") -Reported-by: Andrey Konovalov -Signed-off-by: Willem de Bruijn -Signed-off-by: David S. Miller ---- - net/packet/af_packet.c | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c -index 0615c2a950fa..008a45ca3112 100644 ---- a/net/packet/af_packet.c -+++ b/net/packet/af_packet.c -@@ -3700,14 +3700,19 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv - - if (optlen != sizeof(val)) - return -EINVAL; -- if (po->rx_ring.pg_vec || po->tx_ring.pg_vec) -- return -EBUSY; - if (copy_from_user(&val, optval, sizeof(val))) - return -EFAULT; - if (val > INT_MAX) - return -EINVAL; -- po->tp_reserve = val; -- return 0; -+ lock_sock(sk); -+ if (po->rx_ring.pg_vec || po->tx_ring.pg_vec) { -+ ret = -EBUSY; -+ } else { -+ po->tp_reserve = val; -+ ret = 0; -+ } -+ release_sock(sk); -+ return ret; - } - case PACKET_LOSS: - { --- -2.11.0 - diff --git a/debian/patches/bugfix/all/udp-consistently-apply-ufo-or-fragmentation.patch b/debian/patches/bugfix/all/udp-consistently-apply-ufo-or-fragmentation.patch deleted file mode 100644 index 5233c2741..000000000 --- a/debian/patches/bugfix/all/udp-consistently-apply-ufo-or-fragmentation.patch +++ /dev/null @@ -1,94 +0,0 @@ -From: Willem de Bruijn -Date: Thu, 10 Aug 2017 12:29:19 -0400 -Subject: udp: consistently apply ufo or fragmentation -Origin: https://git.kernel.org/linus/85f1bd9a7b5a79d5baa8bf44af19658f7bf77bfa -Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-1000112 - -When iteratively building a UDP datagram with MSG_MORE and that -datagram exceeds MTU, consistently choose UFO or fragmentation. - -Once skb_is_gso, always apply ufo. Conversely, once a datagram is -split across multiple skbs, do not consider ufo. - -Sendpage already maintains the first invariant, only add the second. -IPv6 does not have a sendpage implementation to modify. - -A gso skb must have a partial checksum, do not follow sk_no_check_tx -in udp_send_skb. - -Found by syzkaller. - -Fixes: e89e9cf539a2 ("[IPv4/IPv6]: UFO Scatter-gather approach") -Reported-by: Andrey Konovalov -Signed-off-by: Willem de Bruijn -Signed-off-by: David S. Miller ---- - net/ipv4/ip_output.c | 8 +++++--- - net/ipv4/udp.c | 2 +- - net/ipv6/ip6_output.c | 7 ++++--- - 3 files changed, 10 insertions(+), 7 deletions(-) - -diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c -index 50c74cd890bc..e153c40c2436 100644 ---- a/net/ipv4/ip_output.c -+++ b/net/ipv4/ip_output.c -@@ -965,11 +965,12 @@ static int __ip_append_data(struct sock *sk, - csummode = CHECKSUM_PARTIAL; - - cork->length += length; -- if ((((length + (skb ? skb->len : fragheaderlen)) > mtu) || -- (skb && skb_is_gso(skb))) && -+ if ((skb && skb_is_gso(skb)) || -+ (((length + (skb ? skb->len : fragheaderlen)) > mtu) && -+ (skb_queue_len(queue) <= 1) && - (sk->sk_protocol == IPPROTO_UDP) && - (rt->dst.dev->features & NETIF_F_UFO) && !dst_xfrm(&rt->dst) && -- (sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx) { -+ (sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx)) { - err = ip_ufo_append_data(sk, queue, getfrag, from, length, - hh_len, fragheaderlen, transhdrlen, - maxfraglen, flags); -@@ -1288,6 +1289,7 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page, - return -EINVAL; - - if ((size + skb->len > mtu) && -+ (skb_queue_len(&sk->sk_write_queue) == 1) && - (sk->sk_protocol == IPPROTO_UDP) && - (rt->dst.dev->features & NETIF_F_UFO)) { - if (skb->ip_summed != CHECKSUM_PARTIAL) -diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c -index e6276fa3750b..a7c804f73990 100644 ---- a/net/ipv4/udp.c -+++ b/net/ipv4/udp.c -@@ -802,7 +802,7 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4) - if (is_udplite) /* UDP-Lite */ - csum = udplite_csum(skb); - -- else if (sk->sk_no_check_tx) { /* UDP csum disabled */ -+ else if (sk->sk_no_check_tx && !skb_is_gso(skb)) { /* UDP csum off */ - - skb->ip_summed = CHECKSUM_NONE; - goto send; -diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c -index 162efba0d0cd..2dfe50d8d609 100644 ---- a/net/ipv6/ip6_output.c -+++ b/net/ipv6/ip6_output.c -@@ -1381,11 +1381,12 @@ static int __ip6_append_data(struct sock *sk, - */ - - cork->length += length; -- if ((((length + (skb ? skb->len : headersize)) > mtu) || -- (skb && skb_is_gso(skb))) && -+ if ((skb && skb_is_gso(skb)) || -+ (((length + (skb ? skb->len : headersize)) > mtu) && -+ (skb_queue_len(queue) <= 1) && - (sk->sk_protocol == IPPROTO_UDP) && - (rt->dst.dev->features & NETIF_F_UFO) && !dst_xfrm(&rt->dst) && -- (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk)) { -+ (sk->sk_type == SOCK_DGRAM) && !udp_get_no_check6_tx(sk))) { - err = ip6_ufo_append_data(sk, queue, getfrag, from, length, - hh_len, fragheaderlen, exthdrlen, - transhdrlen, mtu, flags, fl6); --- -2.11.0 - diff --git a/debian/patches/bugfix/mips/mips-octeon-fix-broken-edac-driver.patch b/debian/patches/bugfix/mips/mips-octeon-fix-broken-edac-driver.patch deleted file mode 100644 index a86cd95cf..000000000 --- a/debian/patches/bugfix/mips/mips-octeon-fix-broken-edac-driver.patch +++ /dev/null @@ -1,145 +0,0 @@ -From: "Steven J. Hill" -Date: Wed, 19 Jul 2017 14:06:41 -0500 -Subject: MIPS: Octeon: Fix broken EDAC driver. -Origin: https://www.linux-mips.org/archives/linux-mips/2017-07/msg00215.html - -Fixes: 15f6847923a8 ("MIPS: Octeon: Remove unused L2C types and -macros.") - -Signed-off-by: Steven J. Hill -Reviewed-by: James Hogan ---- - arch/mips/include/asm/octeon/cvmx-l2c-defs.h | 37 ++++++++++++++++- - arch/mips/include/asm/octeon/cvmx-l2d-defs.h | 60 ++++++++++++++++++++++++++++ - arch/mips/include/asm/octeon/cvmx.h | 1 + - 3 files changed, 97 insertions(+), 1 deletion(-) - create mode 100644 arch/mips/include/asm/octeon/cvmx-l2d-defs.h - ---- a/arch/mips/include/asm/octeon/cvmx-l2c-defs.h -+++ b/arch/mips/include/asm/octeon/cvmx-l2c-defs.h -@@ -33,6 +33,10 @@ - #define CVMX_L2C_DBG (CVMX_ADD_IO_SEG(0x0001180080000030ull)) - #define CVMX_L2C_CFG (CVMX_ADD_IO_SEG(0x0001180080000000ull)) - #define CVMX_L2C_CTL (CVMX_ADD_IO_SEG(0x0001180080800000ull)) -+#define CVMX_L2C_ERR_TDTX(block_id) \ -+ (CVMX_ADD_IO_SEG(0x0001180080A007E0ull) + ((block_id) & 3) * 0x40000ull) -+#define CVMX_L2C_ERR_TTGX(block_id) \ -+ (CVMX_ADD_IO_SEG(0x0001180080A007E8ull) + ((block_id) & 3) * 0x40000ull) - #define CVMX_L2C_LCKBASE (CVMX_ADD_IO_SEG(0x0001180080000058ull)) - #define CVMX_L2C_LCKOFF (CVMX_ADD_IO_SEG(0x0001180080000060ull)) - #define CVMX_L2C_PFCTL (CVMX_ADD_IO_SEG(0x0001180080000090ull)) -@@ -66,9 +70,40 @@ - ((offset) & 1) * 8) - #define CVMX_L2C_WPAR_PPX(offset) (CVMX_ADD_IO_SEG(0x0001180080840000ull) + \ - ((offset) & 31) * 8) --#define CVMX_L2D_FUS3 (CVMX_ADD_IO_SEG(0x00011800800007B8ull)) - - -+union cvmx_l2c_err_tdtx { -+ uint64_t u64; -+ struct cvmx_l2c_err_tdtx_s { -+ __BITFIELD_FIELD(uint64_t dbe:1, -+ __BITFIELD_FIELD(uint64_t sbe:1, -+ __BITFIELD_FIELD(uint64_t vdbe:1, -+ __BITFIELD_FIELD(uint64_t vsbe:1, -+ __BITFIELD_FIELD(uint64_t syn:10, -+ __BITFIELD_FIELD(uint64_t reserved_22_49:28, -+ __BITFIELD_FIELD(uint64_t wayidx:18, -+ __BITFIELD_FIELD(uint64_t reserved_2_3:2, -+ __BITFIELD_FIELD(uint64_t type:2, -+ ;))))))))) -+ } s; -+}; -+ -+union cvmx_l2c_err_ttgx { -+ uint64_t u64; -+ struct cvmx_l2c_err_ttgx_s { -+ __BITFIELD_FIELD(uint64_t dbe:1, -+ __BITFIELD_FIELD(uint64_t sbe:1, -+ __BITFIELD_FIELD(uint64_t noway:1, -+ __BITFIELD_FIELD(uint64_t reserved_56_60:5, -+ __BITFIELD_FIELD(uint64_t syn:6, -+ __BITFIELD_FIELD(uint64_t reserved_22_49:28, -+ __BITFIELD_FIELD(uint64_t wayidx:15, -+ __BITFIELD_FIELD(uint64_t reserved_2_6:5, -+ __BITFIELD_FIELD(uint64_t type:2, -+ ;))))))))) -+ } s; -+}; -+ - union cvmx_l2c_cfg { - uint64_t u64; - struct cvmx_l2c_cfg_s { ---- /dev/null -+++ b/arch/mips/include/asm/octeon/cvmx-l2d-defs.h -@@ -0,0 +1,60 @@ -+/***********************license start*************** -+ * Author: Cavium Networks -+ * -+ * Contact: support@caviumnetworks.com -+ * This file is part of the OCTEON SDK -+ * -+ * Copyright (c) 2003-2017 Cavium, Inc. -+ * -+ * This file is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License, Version 2, as -+ * published by the Free Software Foundation. -+ * -+ * This file is distributed in the hope that it will be useful, but -+ * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty -+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or -+ * NONINFRINGEMENT. See the GNU General Public License for more -+ * details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this file; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ * or visit http://www.gnu.org/licenses/. -+ * -+ * This file may also be available under a different license from Cavium. -+ * Contact Cavium Networks for more information -+ ***********************license end**************************************/ -+ -+#ifndef __CVMX_L2D_DEFS_H__ -+#define __CVMX_L2D_DEFS_H__ -+ -+#define CVMX_L2D_ERR (CVMX_ADD_IO_SEG(0x0001180080000010ull)) -+#define CVMX_L2D_FUS3 (CVMX_ADD_IO_SEG(0x00011800800007B8ull)) -+ -+ -+union cvmx_l2d_err { -+ uint64_t u64; -+ struct cvmx_l2d_err_s { -+ __BITFIELD_FIELD(uint64_t reserved_6_63:58, -+ __BITFIELD_FIELD(uint64_t bmhclsel:1, -+ __BITFIELD_FIELD(uint64_t ded_err:1, -+ __BITFIELD_FIELD(uint64_t sec_err:1, -+ __BITFIELD_FIELD(uint64_t ded_intena:1, -+ __BITFIELD_FIELD(uint64_t sec_intena:1, -+ __BITFIELD_FIELD(uint64_t ecc_ena:1, -+ ;))))))) -+ } s; -+}; -+ -+union cvmx_l2d_fus3 { -+ uint64_t u64; -+ struct cvmx_l2d_fus3_s { -+ __BITFIELD_FIELD(uint64_t reserved_40_63:24, -+ __BITFIELD_FIELD(uint64_t ema_ctl:3, -+ __BITFIELD_FIELD(uint64_t reserved_34_36:3, -+ __BITFIELD_FIELD(uint64_t q3fus:34, -+ ;)))) -+ } s; -+}; -+ -+#endif ---- a/arch/mips/include/asm/octeon/cvmx.h -+++ b/arch/mips/include/asm/octeon/cvmx.h -@@ -62,6 +62,7 @@ enum cvmx_mips_space { - #include - #include - #include -+#include - #include - #include - #include diff --git a/debian/patches/series b/debian/patches/series index d59a69f7b..6e0c6f4db 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -59,7 +59,6 @@ bugfix/x86/platform-x86-ideapad-laptop-add-y520-15ikbn-to-no_hw.patch bugfix/x86/platform-x86-ideapad-laptop-add-y720-15ikbn-to-no_hw.patch bugfix/x86/platform-x86-ideapad-laptop-add-ideapad-v510-15ikb-t.patch bugfix/x86/platform-x86-ideapad-laptop-add-several-models-to-no.patch -bugfix/mips/mips-octeon-fix-broken-edac-driver.patch debian/revert-gpu-host1x-add-iommu-support.patch bugfix/x86/perf-tools-fix-unwind-build-on-i386.patch bugfix/all/mm-revert-x86_64-and-arm64-elf_et_dyn_base-base.patch @@ -116,8 +115,6 @@ features/all/lockdown/arm64-add-kernel-config-option-to-lock-down-when.patch # Security fixes debian/i386-686-pae-pci-set-pci-nobios-by-default.patch -bugfix/all/packet-fix-tp_reserve-race-in-packet_set_ring.patch -bugfix/all/udp-consistently-apply-ufo-or-fragmentation.patch bugfix/all/xfrm-policy-check-policy-direction-value.patch # Fix exported symbol versions