From: Greg Kroah-Hartman Date: Wed, 23 Jan 2019 07:41:47 +0000 (+0100) Subject: 4.20-stable patches X-Git-Tag: v4.20.5~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60bc118043839ffd64c02ae8fd40e4abf2ae1549;p=thirdparty%2Fkernel%2Fstable-queue.git 4.20-stable patches added patches: ipv6-consider-sk_bound_dev_if-when-binding-a-socket-to-a-v4-mapped-address.patch ipv6-fix-dump-of-specific-table-with-strict-checking.patch ipv6-take-rcu_read_lock-in-__inet6_bind-for-mapped-addresses.patch mlxsw-spectrum-disable-lag-port-tx-before-removing-it.patch mlxsw-spectrum_switchdev-set-pvid-correctly-during-vlan-deletion.patch net-clear-skb-tstamp-in-bridge-forwarding-path.patch net-dsa-mv88x6xxx-mv88e6390-errata.patch net-skbuff-do-not-prefer-skb-allocation-fails-early.patch netlink-fixup-regression-in-rtm_getaddr.patch octeontx2-af-fix-a-resource-leak-in-an-error-handling-path-in-cgx_probe.patch openvswitch-fix-ipv6-later-frags-parsing.patch qmi_wwan-add-mtu-default-to-qmap-network-interface.patch r8169-add-support-for-new-realtek-ethernet.patch --- diff --git a/queue-4.20/ipv6-consider-sk_bound_dev_if-when-binding-a-socket-to-a-v4-mapped-address.patch b/queue-4.20/ipv6-consider-sk_bound_dev_if-when-binding-a-socket-to-a-v4-mapped-address.patch new file mode 100644 index 00000000000..a0f8ec7f62f --- /dev/null +++ b/queue-4.20/ipv6-consider-sk_bound_dev_if-when-binding-a-socket-to-a-v4-mapped-address.patch @@ -0,0 +1,51 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: David Ahern +Date: Fri, 4 Jan 2019 16:58:15 -0800 +Subject: ipv6: Consider sk_bound_dev_if when binding a socket to a v4 mapped address + +From: David Ahern + +[ Upstream commit ec90ad334986fa5856d11dd272f7f22fa86c55c4 ] + +Similar to c5ee066333eb ("ipv6: Consider sk_bound_dev_if when binding a +socket to an address"), binding a socket to v4 mapped addresses needs to +consider if the socket is bound to a device. + +This problem also exists from the beginning of git history. + +Signed-off-by: David Ahern +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/af_inet6.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/net/ipv6/af_inet6.c ++++ b/net/ipv6/af_inet6.c +@@ -310,6 +310,7 @@ static int __inet6_bind(struct sock *sk, + + /* Check if the address belongs to the host. */ + if (addr_type == IPV6_ADDR_MAPPED) { ++ struct net_device *dev = NULL; + int chk_addr_ret; + + /* Binding to v4-mapped address on a v6-only socket +@@ -320,9 +321,17 @@ static int __inet6_bind(struct sock *sk, + goto out; + } + ++ if (sk->sk_bound_dev_if) { ++ dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if); ++ if (!dev) { ++ err = -ENODEV; ++ goto out; ++ } ++ } ++ + /* Reproduce AF_INET checks to make the bindings consistent */ + v4addr = addr->sin6_addr.s6_addr32[3]; +- chk_addr_ret = inet_addr_type(net, v4addr); ++ chk_addr_ret = inet_addr_type_dev_table(net, dev, v4addr); + if (!inet_can_nonlocal_bind(net, inet) && + v4addr != htonl(INADDR_ANY) && + chk_addr_ret != RTN_LOCAL && diff --git a/queue-4.20/ipv6-fix-dump-of-specific-table-with-strict-checking.patch b/queue-4.20/ipv6-fix-dump-of-specific-table-with-strict-checking.patch new file mode 100644 index 00000000000..68f7963a5d5 --- /dev/null +++ b/queue-4.20/ipv6-fix-dump-of-specific-table-with-strict-checking.patch @@ -0,0 +1,39 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: David Ahern +Date: Wed, 2 Jan 2019 18:26:13 -0800 +Subject: ipv6: Fix dump of specific table with strict checking + +From: David Ahern + +[ Upstream commit 73155879b3c1ac3ace35208a54a3a160ec520bef ] + +Dump of a specific table with strict checking enabled is looping. The +problem is that the end of the table dump is not marked in the cb. When +dumping a specific table, cb args 0 and 1 are not used (they are the hash +index and entry with an hash table index when dumping all tables). Re-use +args[0] to hold a 'done' flag for the specific table dump. + +Fixes: 13e38901d46ca ("net/ipv6: Plumb support for filtering route dumps") +Reported-by: Jakub Kicinski +Signed-off-by: David Ahern +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/ip6_fib.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/net/ipv6/ip6_fib.c ++++ b/net/ipv6/ip6_fib.c +@@ -627,7 +627,11 @@ static int inet6_dump_fib(struct sk_buff + return -ENOENT; + } + +- res = fib6_dump_table(tb, skb, cb); ++ if (!cb->args[0]) { ++ res = fib6_dump_table(tb, skb, cb); ++ if (!res) ++ cb->args[0] = 1; ++ } + goto out; + } + diff --git a/queue-4.20/ipv6-take-rcu_read_lock-in-__inet6_bind-for-mapped-addresses.patch b/queue-4.20/ipv6-take-rcu_read_lock-in-__inet6_bind-for-mapped-addresses.patch new file mode 100644 index 00000000000..9be904891dc --- /dev/null +++ b/queue-4.20/ipv6-take-rcu_read_lock-in-__inet6_bind-for-mapped-addresses.patch @@ -0,0 +1,44 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: David Ahern +Date: Sat, 5 Jan 2019 07:35:04 -0800 +Subject: ipv6: Take rcu_read_lock in __inet6_bind for mapped addresses + +From: David Ahern + +[ Upstream commit d4a7e9bb74b5aaf07b89f6531c080b1130bdf019 ] + +I realized the last patch calls dev_get_by_index_rcu in a branch not +holding the rcu lock. Add the calls to rcu_read_lock and rcu_read_unlock. + +Fixes: ec90ad334986 ("ipv6: Consider sk_bound_dev_if when binding a socket to a v4 mapped address") +Signed-off-by: David Ahern +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/af_inet6.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/net/ipv6/af_inet6.c ++++ b/net/ipv6/af_inet6.c +@@ -321,17 +321,20 @@ static int __inet6_bind(struct sock *sk, + goto out; + } + ++ rcu_read_lock(); + if (sk->sk_bound_dev_if) { + dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if); + if (!dev) { + err = -ENODEV; +- goto out; ++ goto out_unlock; + } + } + + /* Reproduce AF_INET checks to make the bindings consistent */ + v4addr = addr->sin6_addr.s6_addr32[3]; + chk_addr_ret = inet_addr_type_dev_table(net, dev, v4addr); ++ rcu_read_unlock(); ++ + if (!inet_can_nonlocal_bind(net, inet) && + v4addr != htonl(INADDR_ANY) && + chk_addr_ret != RTN_LOCAL && diff --git a/queue-4.20/mlxsw-spectrum-disable-lag-port-tx-before-removing-it.patch b/queue-4.20/mlxsw-spectrum-disable-lag-port-tx-before-removing-it.patch new file mode 100644 index 00000000000..0cc07193dc3 --- /dev/null +++ b/queue-4.20/mlxsw-spectrum-disable-lag-port-tx-before-removing-it.patch @@ -0,0 +1,41 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: Jiri Pirko +Date: Tue, 8 Jan 2019 16:48:05 +0000 +Subject: mlxsw: spectrum: Disable lag port TX before removing it + +From: Jiri Pirko + +[ Upstream commit 8adbe212a159d9c78a90fca1d854f6e63452426b ] + +Make sure that lag port TX is disabled before mlxsw_sp_port_lag_leave() +is called and prevent from possible EMAD error. + +Fixes: 0d65fc13042f ("mlxsw: spectrum: Implement LAG port join/leave") +Signed-off-by: Jiri Pirko +Signed-off-by: Ido Schimmel +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +@@ -4738,12 +4738,15 @@ static int mlxsw_sp_netdevice_port_upper + lower_dev, + upper_dev); + } else if (netif_is_lag_master(upper_dev)) { +- if (info->linking) ++ if (info->linking) { + err = mlxsw_sp_port_lag_join(mlxsw_sp_port, + upper_dev); +- else ++ } else { ++ mlxsw_sp_port_lag_tx_en_set(mlxsw_sp_port, ++ false); + mlxsw_sp_port_lag_leave(mlxsw_sp_port, + upper_dev); ++ } + } else if (netif_is_ovs_master(upper_dev)) { + if (info->linking) + err = mlxsw_sp_port_ovs_join(mlxsw_sp_port); diff --git a/queue-4.20/mlxsw-spectrum_switchdev-set-pvid-correctly-during-vlan-deletion.patch b/queue-4.20/mlxsw-spectrum_switchdev-set-pvid-correctly-during-vlan-deletion.patch new file mode 100644 index 00000000000..4acbff093b5 --- /dev/null +++ b/queue-4.20/mlxsw-spectrum_switchdev-set-pvid-correctly-during-vlan-deletion.patch @@ -0,0 +1,32 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: Ido Schimmel +Date: Tue, 8 Jan 2019 16:48:13 +0000 +Subject: mlxsw: spectrum_switchdev: Set PVID correctly during VLAN deletion + +From: Ido Schimmel + +[ Upstream commit 674bed5df4cab8f96d04f7b99608883a48f9226b ] + +When a VLAN is deleted from a bridge port we should not change the PVID +unless the deleted VLAN is the PVID. + +Fixes: fe9ccc785de5 ("mlxsw: spectrum_switchdev: Don't batch VLAN operations") +Signed-off-by: Ido Schimmel +Acked-by: Jiri Pirko +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +@@ -1816,7 +1816,7 @@ static void + mlxsw_sp_bridge_port_vlan_del(struct mlxsw_sp_port *mlxsw_sp_port, + struct mlxsw_sp_bridge_port *bridge_port, u16 vid) + { +- u16 pvid = mlxsw_sp_port->pvid == vid ? 0 : vid; ++ u16 pvid = mlxsw_sp_port->pvid == vid ? 0 : mlxsw_sp_port->pvid; + struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan; + + mlxsw_sp_port_vlan = mlxsw_sp_port_vlan_find_by_vid(mlxsw_sp_port, vid); diff --git a/queue-4.20/net-clear-skb-tstamp-in-bridge-forwarding-path.patch b/queue-4.20/net-clear-skb-tstamp-in-bridge-forwarding-path.patch new file mode 100644 index 00000000000..175115a0b70 --- /dev/null +++ b/queue-4.20/net-clear-skb-tstamp-in-bridge-forwarding-path.patch @@ -0,0 +1,39 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: Paolo Abeni +Date: Tue, 8 Jan 2019 18:45:05 +0100 +Subject: net: clear skb->tstamp in bridge forwarding path + +From: Paolo Abeni + +[ Upstream commit 41d1c8839e5f8cb781cc635f12791decee8271b7 ] + +Matteo reported forwarding issues inside the linux bridge, +if the enslaved interfaces use the fq qdisc. + +Similar to commit 8203e2d844d3 ("net: clear skb->tstamp in +forwarding paths"), we need to clear the tstamp field in +the bridge forwarding path. + +Fixes: 80b14dee2bea ("net: Add a new socket option for a future transmit time.") +Fixes: fb420d5d91c1 ("tcp/fq: move back to CLOCK_MONOTONIC") +Reported-and-tested-by: Matteo Croce +Signed-off-by: Paolo Abeni +Acked-by: Nikolay Aleksandrov +Acked-by: Roopa Prabhu +Reviewed-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/bridge/br_forward.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/net/bridge/br_forward.c ++++ b/net/bridge/br_forward.c +@@ -65,6 +65,7 @@ EXPORT_SYMBOL_GPL(br_dev_queue_push_xmit + + int br_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb) + { ++ skb->tstamp = 0; + return NF_HOOK(NFPROTO_BRIDGE, NF_BR_POST_ROUTING, + net, sk, skb, NULL, skb->dev, + br_dev_queue_push_xmit); diff --git a/queue-4.20/net-dsa-mv88x6xxx-mv88e6390-errata.patch b/queue-4.20/net-dsa-mv88x6xxx-mv88e6390-errata.patch new file mode 100644 index 00000000000..6381fbce520 --- /dev/null +++ b/queue-4.20/net-dsa-mv88x6xxx-mv88e6390-errata.patch @@ -0,0 +1,226 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: Andrew Lunn +Date: Wed, 9 Jan 2019 00:24:03 +0100 +Subject: net: dsa: mv88x6xxx: mv88e6390 errata + +From: Andrew Lunn + +[ Upstream commit ea89098ef9a574bceca00d3b5df14aaf0b3f9ccf ] + +The 6390 copper ports have an errata which require poking magic values +into undocumented magic registers and then performing a software +reset. + +Signed-off-by: Andrew Lunn +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/dsa/mv88e6xxx/chip.c | 113 +++++++++++++++++++++++++++++++++++++++ + drivers/net/dsa/mv88e6xxx/chip.h | 5 + + drivers/net/dsa/mv88e6xxx/port.h | 10 +++ + 3 files changed, 128 insertions(+) + +--- a/drivers/net/dsa/mv88e6xxx/chip.c ++++ b/drivers/net/dsa/mv88e6xxx/chip.c +@@ -2403,6 +2403,107 @@ static int mv88e6xxx_stats_setup(struct + return mv88e6xxx_g1_stats_clear(chip); + } + ++/* The mv88e6390 has some hidden registers used for debug and ++ * development. The errata also makes use of them. ++ */ ++static int mv88e6390_hidden_write(struct mv88e6xxx_chip *chip, int port, ++ int reg, u16 val) ++{ ++ u16 ctrl; ++ int err; ++ ++ err = mv88e6xxx_port_write(chip, PORT_RESERVED_1A_DATA_PORT, ++ PORT_RESERVED_1A, val); ++ if (err) ++ return err; ++ ++ ctrl = PORT_RESERVED_1A_BUSY | PORT_RESERVED_1A_WRITE | ++ PORT_RESERVED_1A_BLOCK | port << PORT_RESERVED_1A_PORT_SHIFT | ++ reg; ++ ++ return mv88e6xxx_port_write(chip, PORT_RESERVED_1A_CTRL_PORT, ++ PORT_RESERVED_1A, ctrl); ++} ++ ++static int mv88e6390_hidden_wait(struct mv88e6xxx_chip *chip) ++{ ++ return mv88e6xxx_wait(chip, PORT_RESERVED_1A_CTRL_PORT, ++ PORT_RESERVED_1A, PORT_RESERVED_1A_BUSY); ++} ++ ++ ++static int mv88e6390_hidden_read(struct mv88e6xxx_chip *chip, int port, ++ int reg, u16 *val) ++{ ++ u16 ctrl; ++ int err; ++ ++ ctrl = PORT_RESERVED_1A_BUSY | PORT_RESERVED_1A_READ | ++ PORT_RESERVED_1A_BLOCK | port << PORT_RESERVED_1A_PORT_SHIFT | ++ reg; ++ ++ err = mv88e6xxx_port_write(chip, PORT_RESERVED_1A_CTRL_PORT, ++ PORT_RESERVED_1A, ctrl); ++ if (err) ++ return err; ++ ++ err = mv88e6390_hidden_wait(chip); ++ if (err) ++ return err; ++ ++ return mv88e6xxx_port_read(chip, PORT_RESERVED_1A_DATA_PORT, ++ PORT_RESERVED_1A, val); ++} ++ ++/* Check if the errata has already been applied. */ ++static bool mv88e6390_setup_errata_applied(struct mv88e6xxx_chip *chip) ++{ ++ int port; ++ int err; ++ u16 val; ++ ++ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) { ++ err = mv88e6390_hidden_read(chip, port, 0, &val); ++ if (err) { ++ dev_err(chip->dev, ++ "Error reading hidden register: %d\n", err); ++ return false; ++ } ++ if (val != 0x01c0) ++ return false; ++ } ++ ++ return true; ++} ++ ++/* The 6390 copper ports have an errata which require poking magic ++ * values into undocumented hidden registers and then performing a ++ * software reset. ++ */ ++static int mv88e6390_setup_errata(struct mv88e6xxx_chip *chip) ++{ ++ int port; ++ int err; ++ ++ if (mv88e6390_setup_errata_applied(chip)) ++ return 0; ++ ++ /* Set the ports into blocking mode */ ++ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) { ++ err = mv88e6xxx_port_set_state(chip, port, BR_STATE_DISABLED); ++ if (err) ++ return err; ++ } ++ ++ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) { ++ err = mv88e6390_hidden_write(chip, port, 0, 0x01c0); ++ if (err) ++ return err; ++ } ++ ++ return mv88e6xxx_software_reset(chip); ++} ++ + static int mv88e6xxx_setup(struct dsa_switch *ds) + { + struct mv88e6xxx_chip *chip = ds->priv; +@@ -2415,6 +2516,12 @@ static int mv88e6xxx_setup(struct dsa_sw + + mutex_lock(&chip->reg_lock); + ++ if (chip->info->ops->setup_errata) { ++ err = chip->info->ops->setup_errata(chip); ++ if (err) ++ goto unlock; ++ } ++ + /* Cache the cmode of each port. */ + for (i = 0; i < mv88e6xxx_num_ports(chip); i++) { + if (chip->info->ops->port_get_cmode) { +@@ -3215,6 +3322,7 @@ static const struct mv88e6xxx_ops mv88e6 + + static const struct mv88e6xxx_ops mv88e6190_ops = { + /* MV88E6XXX_FAMILY_6390 */ ++ .setup_errata = mv88e6390_setup_errata, + .irl_init_all = mv88e6390_g2_irl_init_all, + .get_eeprom = mv88e6xxx_g2_get_eeprom8, + .set_eeprom = mv88e6xxx_g2_set_eeprom8, +@@ -3257,6 +3365,7 @@ static const struct mv88e6xxx_ops mv88e6 + + static const struct mv88e6xxx_ops mv88e6190x_ops = { + /* MV88E6XXX_FAMILY_6390 */ ++ .setup_errata = mv88e6390_setup_errata, + .irl_init_all = mv88e6390_g2_irl_init_all, + .get_eeprom = mv88e6xxx_g2_get_eeprom8, + .set_eeprom = mv88e6xxx_g2_set_eeprom8, +@@ -3299,6 +3408,7 @@ static const struct mv88e6xxx_ops mv88e6 + + static const struct mv88e6xxx_ops mv88e6191_ops = { + /* MV88E6XXX_FAMILY_6390 */ ++ .setup_errata = mv88e6390_setup_errata, + .irl_init_all = mv88e6390_g2_irl_init_all, + .get_eeprom = mv88e6xxx_g2_get_eeprom8, + .set_eeprom = mv88e6xxx_g2_set_eeprom8, +@@ -3390,6 +3500,7 @@ static const struct mv88e6xxx_ops mv88e6 + + static const struct mv88e6xxx_ops mv88e6290_ops = { + /* MV88E6XXX_FAMILY_6390 */ ++ .setup_errata = mv88e6390_setup_errata, + .irl_init_all = mv88e6390_g2_irl_init_all, + .get_eeprom = mv88e6xxx_g2_get_eeprom8, + .set_eeprom = mv88e6xxx_g2_set_eeprom8, +@@ -3693,6 +3804,7 @@ static const struct mv88e6xxx_ops mv88e6 + + static const struct mv88e6xxx_ops mv88e6390_ops = { + /* MV88E6XXX_FAMILY_6390 */ ++ .setup_errata = mv88e6390_setup_errata, + .irl_init_all = mv88e6390_g2_irl_init_all, + .get_eeprom = mv88e6xxx_g2_get_eeprom8, + .set_eeprom = mv88e6xxx_g2_set_eeprom8, +@@ -3740,6 +3852,7 @@ static const struct mv88e6xxx_ops mv88e6 + + static const struct mv88e6xxx_ops mv88e6390x_ops = { + /* MV88E6XXX_FAMILY_6390 */ ++ .setup_errata = mv88e6390_setup_errata, + .irl_init_all = mv88e6390_g2_irl_init_all, + .get_eeprom = mv88e6xxx_g2_get_eeprom8, + .set_eeprom = mv88e6xxx_g2_set_eeprom8, +--- a/drivers/net/dsa/mv88e6xxx/chip.h ++++ b/drivers/net/dsa/mv88e6xxx/chip.h +@@ -300,6 +300,11 @@ struct mv88e6xxx_mdio_bus { + }; + + struct mv88e6xxx_ops { ++ /* Switch Setup Errata, called early in the switch setup to ++ * allow any errata actions to be performed ++ */ ++ int (*setup_errata)(struct mv88e6xxx_chip *chip); ++ + int (*ieee_pri_map)(struct mv88e6xxx_chip *chip); + int (*ip_pri_map)(struct mv88e6xxx_chip *chip); + +--- a/drivers/net/dsa/mv88e6xxx/port.h ++++ b/drivers/net/dsa/mv88e6xxx/port.h +@@ -251,6 +251,16 @@ + /* Offset 0x19: Port IEEE Priority Remapping Registers (4-7) */ + #define MV88E6095_PORT_IEEE_PRIO_REMAP_4567 0x19 + ++/* Offset 0x1a: Magic undocumented errata register */ ++#define PORT_RESERVED_1A 0x1a ++#define PORT_RESERVED_1A_BUSY BIT(15) ++#define PORT_RESERVED_1A_WRITE BIT(14) ++#define PORT_RESERVED_1A_READ 0 ++#define PORT_RESERVED_1A_PORT_SHIFT 5 ++#define PORT_RESERVED_1A_BLOCK (0xf << 10) ++#define PORT_RESERVED_1A_CTRL_PORT 4 ++#define PORT_RESERVED_1A_DATA_PORT 5 ++ + int mv88e6xxx_port_read(struct mv88e6xxx_chip *chip, int port, int reg, + u16 *val); + int mv88e6xxx_port_write(struct mv88e6xxx_chip *chip, int port, int reg, diff --git a/queue-4.20/net-skbuff-do-not-prefer-skb-allocation-fails-early.patch b/queue-4.20/net-skbuff-do-not-prefer-skb-allocation-fails-early.patch new file mode 100644 index 00000000000..1a70d5ffa7d --- /dev/null +++ b/queue-4.20/net-skbuff-do-not-prefer-skb-allocation-fails-early.patch @@ -0,0 +1,69 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: David Rientjes +Date: Wed, 2 Jan 2019 13:01:43 -0800 +Subject: net, skbuff: do not prefer skb allocation fails early + +From: David Rientjes + +[ Upstream commit f8c468e8537925e0c4607263f498a1b7c0c8982e ] + +Commit dcda9b04713c ("mm, tree wide: replace __GFP_REPEAT by +__GFP_RETRY_MAYFAIL with more useful semantic") replaced __GFP_REPEAT in +alloc_skb_with_frags() with __GFP_RETRY_MAYFAIL when the allocation may +directly reclaim. + +The previous behavior would require reclaim up to 1 << order pages for +skb aligned header_len of order > PAGE_ALLOC_COSTLY_ORDER before failing, +otherwise the allocations in alloc_skb() would loop in the page allocator +looking for memory. __GFP_RETRY_MAYFAIL makes both allocations failable +under memory pressure, including for the HEAD allocation. + +This can cause, among many other things, write() to fail with ENOTCONN +during RPC when under memory pressure. + +These allocations should succeed as they did previous to dcda9b04713c +even if it requires calling the oom killer and additional looping in the +page allocator to find memory. There is no way to specify the previous +behavior of __GFP_REPEAT, but it's unlikely to be necessary since the +previous behavior only guaranteed that 1 << order pages would be reclaimed +before failing for order > PAGE_ALLOC_COSTLY_ORDER. That reclaim is not +guaranteed to be contiguous memory, so repeating for such large orders is +usually not beneficial. + +Removing the setting of __GFP_RETRY_MAYFAIL to restore the previous +behavior, specifically not allowing alloc_skb() to fail for small orders +and oom kill if necessary rather than allowing RPCs to fail. + +Fixes: dcda9b04713c ("mm, tree wide: replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL with more useful semantic") +Signed-off-by: David Rientjes +Reviewed-by: Eric Dumazet +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/core/skbuff.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -5202,7 +5202,6 @@ struct sk_buff *alloc_skb_with_frags(uns + unsigned long chunk; + struct sk_buff *skb; + struct page *page; +- gfp_t gfp_head; + int i; + + *errcode = -EMSGSIZE; +@@ -5212,12 +5211,8 @@ struct sk_buff *alloc_skb_with_frags(uns + if (npages > MAX_SKB_FRAGS) + return NULL; + +- gfp_head = gfp_mask; +- if (gfp_head & __GFP_DIRECT_RECLAIM) +- gfp_head |= __GFP_RETRY_MAYFAIL; +- + *errcode = -ENOBUFS; +- skb = alloc_skb(header_len, gfp_head); ++ skb = alloc_skb(header_len, gfp_mask); + if (!skb) + return NULL; + diff --git a/queue-4.20/netlink-fixup-regression-in-rtm_getaddr.patch b/queue-4.20/netlink-fixup-regression-in-rtm_getaddr.patch new file mode 100644 index 00000000000..6ba46640d61 --- /dev/null +++ b/queue-4.20/netlink-fixup-regression-in-rtm_getaddr.patch @@ -0,0 +1,59 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: Arthur Gautier +Date: Mon, 31 Dec 2018 02:10:58 +0000 +Subject: netlink: fixup regression in RTM_GETADDR + +From: Arthur Gautier + +[ Upstream commit 7c1e8a3817c55d73b27cc29b84075999c8894179 ] + +This commit fixes a regression in AF_INET/RTM_GETADDR and +AF_INET6/RTM_GETADDR. + +Before this commit, the kernel would stop dumping addresses once the first +skb was full and end the stream with NLMSG_DONE(-EMSGSIZE). The error +shouldn't be sent back to netlink_dump so the callback is kept alive. The +userspace is expected to call back with a new empty skb. + +Changes from V1: + - The error is not handled in netlink_dump anymore but rather in + inet_dump_ifaddr and inet6_dump_addr directly as suggested by + David Ahern. + +Fixes: d7e38611b81e ("net/ipv4: Put target net when address dump fails due to bad attributes") +Fixes: 242afaa6968c ("net/ipv6: Put target net when address dump fails due to bad attributes") + +Cc: David Ahern +Cc: "David S . Miller" +Cc: netdev@vger.kernel.org +Signed-off-by: Arthur Gautier +Reviewed-by: David Ahern +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/devinet.c | 2 +- + net/ipv6/addrconf.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/net/ipv4/devinet.c ++++ b/net/ipv4/devinet.c +@@ -1826,7 +1826,7 @@ put_tgt_net: + if (fillargs.netnsid >= 0) + put_net(tgt_net); + +- return err < 0 ? err : skb->len; ++ return skb->len ? : err; + } + + static void rtmsg_ifa(int event, struct in_ifaddr *ifa, struct nlmsghdr *nlh, +--- a/net/ipv6/addrconf.c ++++ b/net/ipv6/addrconf.c +@@ -5154,7 +5154,7 @@ put_tgt_net: + if (fillargs.netnsid >= 0) + put_net(tgt_net); + +- return err < 0 ? err : skb->len; ++ return skb->len ? : err; + } + + static int inet6_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) diff --git a/queue-4.20/octeontx2-af-fix-a-resource-leak-in-an-error-handling-path-in-cgx_probe.patch b/queue-4.20/octeontx2-af-fix-a-resource-leak-in-an-error-handling-path-in-cgx_probe.patch new file mode 100644 index 00000000000..373db93362c --- /dev/null +++ b/queue-4.20/octeontx2-af-fix-a-resource-leak-in-an-error-handling-path-in-cgx_probe.patch @@ -0,0 +1,43 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: Christophe JAILLET +Date: Sat, 29 Dec 2018 17:42:22 +0100 +Subject: octeontx2-af: Fix a resource leak in an error handling path in 'cgx_probe()' + +From: Christophe JAILLET + +[ Upstream commit 1492623e837fe7ca6296f7f5411328307e242771 ] + +If an error occurs after the call to 'pci_alloc_irq_vectors()', we must +call 'pci_free_irq_vectors()' in order to avoid a resource leak. + +The same sequence is already in place in the corresponding 'cgx_remove()' +function. + +Fixes: 1463f382f58d ("octeontx2-af: Add support for CGX link management") +Signed-off-by: Christophe JAILLET +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c ++++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c +@@ -668,7 +668,7 @@ static int cgx_probe(struct pci_dev *pde + if (!cgx->reg_base) { + dev_err(dev, "CGX: Cannot map CSR memory space, aborting\n"); + err = -ENOMEM; +- goto err_release_regions; ++ goto err_free_irq_vectors; + } + + nvec = CGX_NVEC; +@@ -693,6 +693,8 @@ static int cgx_probe(struct pci_dev *pde + err_release_lmac: + cgx_lmac_exit(cgx); + list_del(&cgx->cgx_list); ++err_free_irq_vectors: ++ pci_free_irq_vectors(pdev); + err_release_regions: + pci_release_regions(pdev); + err_disable_device: diff --git a/queue-4.20/openvswitch-fix-ipv6-later-frags-parsing.patch b/queue-4.20/openvswitch-fix-ipv6-later-frags-parsing.patch new file mode 100644 index 00000000000..ebd5f572e2f --- /dev/null +++ b/queue-4.20/openvswitch-fix-ipv6-later-frags-parsing.patch @@ -0,0 +1,48 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: Yi-Hung Wei +Date: Thu, 3 Jan 2019 09:51:57 -0800 +Subject: openvswitch: Fix IPv6 later frags parsing + +From: Yi-Hung Wei + +[ Upstream commit 41e4e2cd75346667b0c531c07dab05cce5b06d15 ] + +The previous commit fa642f08839b +("openvswitch: Derive IP protocol number for IPv6 later frags") +introduces IP protocol number parsing for IPv6 later frags that can mess +up the network header length calculation logic, i.e. nh_len < 0. +However, the network header length calculation is mainly for deriving +the transport layer header in the key extraction process which the later +fragment does not apply. + +Therefore, this commit skips the network header length calculation to +fix the issue. + +Reported-by: Chris Mi +Reported-by: Greg Rose +Fixes: fa642f08839b ("openvswitch: Derive IP protocol number for IPv6 later frags") +Signed-off-by: Yi-Hung Wei +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/openvswitch/flow.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/net/openvswitch/flow.c ++++ b/net/openvswitch/flow.c +@@ -276,10 +276,12 @@ static int parse_ipv6hdr(struct sk_buff + + nexthdr = ipv6_find_hdr(skb, &payload_ofs, -1, &frag_off, &flags); + if (flags & IP6_FH_F_FRAG) { +- if (frag_off) ++ if (frag_off) { + key->ip.frag = OVS_FRAG_TYPE_LATER; +- else +- key->ip.frag = OVS_FRAG_TYPE_FIRST; ++ key->ip.proto = nexthdr; ++ return 0; ++ } ++ key->ip.frag = OVS_FRAG_TYPE_FIRST; + } else { + key->ip.frag = OVS_FRAG_TYPE_NONE; + } diff --git a/queue-4.20/qmi_wwan-add-mtu-default-to-qmap-network-interface.patch b/queue-4.20/qmi_wwan-add-mtu-default-to-qmap-network-interface.patch new file mode 100644 index 00000000000..464a125a849 --- /dev/null +++ b/queue-4.20/qmi_wwan-add-mtu-default-to-qmap-network-interface.patch @@ -0,0 +1,31 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: Daniele Palmas +Date: Fri, 4 Jan 2019 13:26:10 +0100 +Subject: qmi_wwan: add MTU default to qmap network interface + +From: Daniele Palmas + +[ Upstream commit f87118d5760f00af7228033fbe783c7f380d2866 ] + +This patch adds MTU default value to qmap network interface in +order to avoid "RTNETLINK answers: No buffer space available" +error when setting an ipv6 address. + +Signed-off-by: Daniele Palmas +Acked-by: Bjørn Mork +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/usb/qmi_wwan.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -123,6 +123,7 @@ static void qmimux_setup(struct net_devi + dev->addr_len = 0; + dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST; + dev->netdev_ops = &qmimux_netdev_ops; ++ dev->mtu = 1500; + dev->needs_free_netdev = true; + } + diff --git a/queue-4.20/r8169-add-support-for-new-realtek-ethernet.patch b/queue-4.20/r8169-add-support-for-new-realtek-ethernet.patch new file mode 100644 index 00000000000..bd6ff4282c1 --- /dev/null +++ b/queue-4.20/r8169-add-support-for-new-realtek-ethernet.patch @@ -0,0 +1,31 @@ +From foo@baz Wed Jan 23 08:14:16 CET 2019 +From: Kai-Heng Feng +Date: Wed, 2 Jan 2019 14:45:07 +0800 +Subject: r8169: Add support for new Realtek Ethernet + +From: Kai-Heng Feng + +[ Upstream commit 36352991835ce99e46b4441dd0eb6980f9a83e8f ] + +There are two new Realtek Ethernet devices which are re-branded r8168h. +Add the IDs to to support them. + +Signed-off-by: Kai-Heng Feng +Reviewed-by: Heiner Kallweit +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/realtek/r8169.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/net/ethernet/realtek/r8169.c ++++ b/drivers/net/ethernet/realtek/r8169.c +@@ -212,6 +212,8 @@ enum cfg_version { + }; + + static const struct pci_device_id rtl8169_pci_tbl[] = { ++ { PCI_VDEVICE(REALTEK, 0x2502), RTL_CFG_1 }, ++ { PCI_VDEVICE(REALTEK, 0x2600), RTL_CFG_1 }, + { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8129), 0, 0, RTL_CFG_0 }, + { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8136), 0, 0, RTL_CFG_2 }, + { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8161), 0, 0, RTL_CFG_1 },