From: Greg Kroah-Hartman Date: Sun, 22 Nov 2020 11:11:04 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v4.4.246~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e15dd3439b53c5229cfeb939248251f7ec1ac843;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: ah6-fix-error-return-code-in-ah6_input.patch atm-nicstar-unmap-dma-on-send-error.patch bnxt_en-read-eeprom-a2h-address-using-page-0.patch devlink-add-missing-genlmsg_cancel-in-devlink_nl_sb_port_pool_fill.patch inet_diag-fix-error-path-to-cancel-the-meseage-in-inet_req_diag_fill.patch mlxsw-core-use-variable-timeout-for-emad-retries.patch net-b44-fix-error-return-code-in-b44_init_one.patch net-bridge-add-missing-counters-to-ndo_get_stats64-callback.patch net-dsa-mv88e6xxx-avoid-vtu-corruption-on-6097.patch net-ftgmac100-fix-crash-when-removing-driver.patch net-have-netpoll-bring-up-dsa-management-interface.patch net-mlx4_core-fix-init_hca-fields-offset.patch net-mlx5-disable-qos-when-min_rates-on-all-vfs-are-zero.patch net-usb-qmi_wwan-set-dtr-quirk-for-mr400.patch net-x25-increase-refcnt-of-struct-x25_neigh-in-x25_rx_call_request.patch netlabel-fix-an-uninitialized-warning-in-netlbl_unlabel_staticlist.patch netlabel-fix-our-progress-tracking-in-netlbl_unlabel_staticlist.patch qlcnic-fix-error-return-code-in-qlcnic_83xx_restart_hw.patch sctp-change-to-hold-put-transport-for-proto_unreach_timer.patch tcp-only-postpone-probe_rtt-if-rtt-is-current-min_rtt-estimate.patch --- diff --git a/queue-4.14/ah6-fix-error-return-code-in-ah6_input.patch b/queue-4.14/ah6-fix-error-return-code-in-ah6_input.patch new file mode 100644 index 00000000000..9fe1a162ca9 --- /dev/null +++ b/queue-4.14/ah6-fix-error-return-code-in-ah6_input.patch @@ -0,0 +1,34 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Zhang Changzhong +Date: Tue, 17 Nov 2020 10:45:05 +0800 +Subject: ah6: fix error return code in ah6_input() + +From: Zhang Changzhong + +[ Upstream commit a5ebcbdf34b65fcc07f38eaf2d60563b42619a59 ] + +Fix to return a negative error code from the error handling +case instead of 0, as done elsewhere in this function. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Reported-by: Hulk Robot +Signed-off-by: Zhang Changzhong +Link: https://lore.kernel.org/r/1605581105-35295-1-git-send-email-zhangchangzhong@huawei.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/ah6.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/net/ipv6/ah6.c ++++ b/net/ipv6/ah6.c +@@ -599,7 +599,8 @@ static int ah6_input(struct xfrm_state * + memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len); + memset(ah->auth_data, 0, ahp->icv_trunc_len); + +- if (ipv6_clear_mutable_options(ip6h, hdr_len, XFRM_POLICY_IN)) ++ err = ipv6_clear_mutable_options(ip6h, hdr_len, XFRM_POLICY_IN); ++ if (err) + goto out_free; + + ip6h->priority = 0; diff --git a/queue-4.14/atm-nicstar-unmap-dma-on-send-error.patch b/queue-4.14/atm-nicstar-unmap-dma-on-send-error.patch new file mode 100644 index 00000000000..c3799f7d4de --- /dev/null +++ b/queue-4.14/atm-nicstar-unmap-dma-on-send-error.patch @@ -0,0 +1,35 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Sebastian Andrzej Siewior +Date: Mon, 16 Nov 2020 17:21:14 +0100 +Subject: atm: nicstar: Unmap DMA on send error + +From: Sebastian Andrzej Siewior + +[ Upstream commit 6dceaa9f56e22d0f9b4c4ad2ed9e04e315ce7fe5 ] + +The `skb' is mapped for DMA in ns_send() but does not unmap DMA in case +push_scqe() fails to submit the `skb'. The memory of the `skb' is +released so only the DMA mapping is leaking. + +Unmap the DMA mapping in case push_scqe() failed. + +Fixes: 864a3ff635fa7 ("atm: [nicstar] remove virt_to_bus() and support 64-bit platforms") +Cc: Chas Williams <3chas3@gmail.com> +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/atm/nicstar.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/atm/nicstar.c ++++ b/drivers/atm/nicstar.c +@@ -1707,6 +1707,8 @@ static int ns_send(struct atm_vcc *vcc, + + if (push_scqe(card, vc, scq, &scqe, skb) != 0) { + atomic_inc(&vcc->stats->tx_err); ++ dma_unmap_single(&card->pcidev->dev, NS_PRV_DMA(skb), skb->len, ++ DMA_TO_DEVICE); + dev_kfree_skb_any(skb); + return -EIO; + } diff --git a/queue-4.14/bnxt_en-read-eeprom-a2h-address-using-page-0.patch b/queue-4.14/bnxt_en-read-eeprom-a2h-address-using-page-0.patch new file mode 100644 index 00000000000..26450d51a42 --- /dev/null +++ b/queue-4.14/bnxt_en-read-eeprom-a2h-address-using-page-0.patch @@ -0,0 +1,36 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Edwin Peer +Date: Sun, 15 Nov 2020 19:27:49 -0500 +Subject: bnxt_en: read EEPROM A2h address using page 0 + +From: Edwin Peer + +[ Upstream commit 4260330b32b14330cfe427d568ac5f5b29b5be3d ] + +The module eeprom address range returned by bnxt_get_module_eeprom() +should be 256 bytes of A0h address space, the lower half of the A2h +address space, and page 0 for the upper half of the A2h address space. + +Fix the firmware call by passing page_number 0 for the A2h slave address +space. + +Fixes: 42ee18fe4ca2 ("bnxt_en: Add Support for ETHTOOL_GMODULEINFO and ETHTOOL_GMODULEEEPRO") +Signed-off-by: Edwin Peer +Signed-off-by: Michael Chan +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +@@ -2168,7 +2168,7 @@ static int bnxt_get_module_eeprom(struct + /* Read A2 portion of the EEPROM */ + if (length) { + start -= ETH_MODULE_SFF_8436_LEN; +- rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 1, ++ rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 0, + start, length, data); + } + return rc; diff --git a/queue-4.14/devlink-add-missing-genlmsg_cancel-in-devlink_nl_sb_port_pool_fill.patch b/queue-4.14/devlink-add-missing-genlmsg_cancel-in-devlink_nl_sb_port_pool_fill.patch new file mode 100644 index 00000000000..7e01c452c52 --- /dev/null +++ b/queue-4.14/devlink-add-missing-genlmsg_cancel-in-devlink_nl_sb_port_pool_fill.patch @@ -0,0 +1,45 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Wang Hai +Date: Fri, 13 Nov 2020 19:16:22 +0800 +Subject: devlink: Add missing genlmsg_cancel() in devlink_nl_sb_port_pool_fill() + +From: Wang Hai + +[ Upstream commit 849920c703392957f94023f77ec89ca6cf119d43 ] + +If sb_occ_port_pool_get() failed in devlink_nl_sb_port_pool_fill(), +msg should be canceled by genlmsg_cancel(). + +Fixes: df38dafd2559 ("devlink: implement shared buffer occupancy monitoring interface") +Reported-by: Hulk Robot +Signed-off-by: Wang Hai +Link: https://lore.kernel.org/r/20201113111622.11040-1-wanghai38@huawei.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/core/devlink.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/net/core/devlink.c ++++ b/net/core/devlink.c +@@ -1031,7 +1031,7 @@ static int devlink_nl_sb_port_pool_fill( + err = ops->sb_occ_port_pool_get(devlink_port, devlink_sb->index, + pool_index, &cur, &max); + if (err && err != -EOPNOTSUPP) +- return err; ++ goto sb_occ_get_failure; + if (!err) { + if (nla_put_u32(msg, DEVLINK_ATTR_SB_OCC_CUR, cur)) + goto nla_put_failure; +@@ -1044,8 +1044,10 @@ static int devlink_nl_sb_port_pool_fill( + return 0; + + nla_put_failure: ++ err = -EMSGSIZE; ++sb_occ_get_failure: + genlmsg_cancel(msg, hdr); +- return -EMSGSIZE; ++ return err; + } + + static int devlink_nl_cmd_sb_port_pool_get_doit(struct sk_buff *skb, diff --git a/queue-4.14/inet_diag-fix-error-path-to-cancel-the-meseage-in-inet_req_diag_fill.patch b/queue-4.14/inet_diag-fix-error-path-to-cancel-the-meseage-in-inet_req_diag_fill.patch new file mode 100644 index 00000000000..270a7e05e5d --- /dev/null +++ b/queue-4.14/inet_diag-fix-error-path-to-cancel-the-meseage-in-inet_req_diag_fill.patch @@ -0,0 +1,36 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Wang Hai +Date: Mon, 16 Nov 2020 16:20:18 +0800 +Subject: inet_diag: Fix error path to cancel the meseage in inet_req_diag_fill() + +From: Wang Hai + +[ Upstream commit e33de7c5317e2827b2ba6fd120a505e9eb727b05 ] + +nlmsg_cancel() needs to be called in the error path of +inet_req_diag_fill to cancel the message. + +Fixes: d545caca827b ("net: inet: diag: expose the socket mark to privileged processes.") +Reported-by: Hulk Robot +Signed-off-by: Wang Hai +Link: https://lore.kernel.org/r/20201116082018.16496-1-wanghai38@huawei.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/inet_diag.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/net/ipv4/inet_diag.c ++++ b/net/ipv4/inet_diag.c +@@ -393,8 +393,10 @@ static int inet_req_diag_fill(struct soc + r->idiag_inode = 0; + + if (net_admin && nla_put_u32(skb, INET_DIAG_MARK, +- inet_rsk(reqsk)->ir_mark)) ++ inet_rsk(reqsk)->ir_mark)) { ++ nlmsg_cancel(skb, nlh); + return -EMSGSIZE; ++ } + + nlmsg_end(skb, nlh); + return 0; diff --git a/queue-4.14/mlxsw-core-use-variable-timeout-for-emad-retries.patch b/queue-4.14/mlxsw-core-use-variable-timeout-for-emad-retries.patch new file mode 100644 index 00000000000..5331db1c1e3 --- /dev/null +++ b/queue-4.14/mlxsw-core-use-variable-timeout-for-emad-retries.patch @@ -0,0 +1,43 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Ido Schimmel +Date: Tue, 17 Nov 2020 19:33:52 +0200 +Subject: mlxsw: core: Use variable timeout for EMAD retries + +From: Ido Schimmel + +[ Upstream commit 1f492eab67bced119a0ac7db75ef2047e29a30c6 ] + +The driver sends Ethernet Management Datagram (EMAD) packets to the +device for configuration purposes and waits for up to 200ms for a reply. +A request is retried up to 5 times. + +When the system is under heavy load, replies are not always processed in +time and EMAD transactions fail. + +Make the process more robust to such delays by using exponential +backoff. First wait for up to 200ms, then retransmit and wait for up to +400ms and so on. + +Fixes: caf7297e7ab5 ("mlxsw: core: Introduce support for asynchronous EMAD register access") +Reported-by: Denis Yulevich +Tested-by: Denis Yulevich +Signed-off-by: Ido Schimmel +Reviewed-by: Jiri Pirko +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mellanox/mlxsw/core.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c +@@ -471,7 +471,8 @@ static void mlxsw_emad_trans_timeout_sch + if (trans->core->fw_flash_in_progress) + timeout = msecs_to_jiffies(MLXSW_EMAD_TIMEOUT_DURING_FW_FLASH_MS); + +- queue_delayed_work(trans->core->emad_wq, &trans->timeout_dw, timeout); ++ queue_delayed_work(trans->core->emad_wq, &trans->timeout_dw, ++ timeout << trans->retries); + } + + static int mlxsw_emad_transmit(struct mlxsw_core *mlxsw_core, diff --git a/queue-4.14/net-b44-fix-error-return-code-in-b44_init_one.patch b/queue-4.14/net-b44-fix-error-return-code-in-b44_init_one.patch new file mode 100644 index 00000000000..d5d4276b7c9 --- /dev/null +++ b/queue-4.14/net-b44-fix-error-return-code-in-b44_init_one.patch @@ -0,0 +1,35 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Zhang Changzhong +Date: Tue, 17 Nov 2020 11:02:11 +0800 +Subject: net: b44: fix error return code in b44_init_one() + +From: Zhang Changzhong + +[ Upstream commit 7b027c249da54f492699c43e26cba486cfd48035 ] + +Fix to return a negative error code from the error handling +case instead of 0, as done elsewhere in this function. + +Fixes: 39a6f4bce6b4 ("b44: replace the ssb_dma API with the generic DMA API") +Reported-by: Hulk Robot +Signed-off-by: Zhang Changzhong +Reviewed-by: Michael Chan +Link: https://lore.kernel.org/r/1605582131-36735-1-git-send-email-zhangchangzhong@huawei.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/broadcom/b44.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/b44.c ++++ b/drivers/net/ethernet/broadcom/b44.c +@@ -2391,7 +2391,8 @@ static int b44_init_one(struct ssb_devic + goto err_out_free_dev; + } + +- if (dma_set_mask_and_coherent(sdev->dma_dev, DMA_BIT_MASK(30))) { ++ err = dma_set_mask_and_coherent(sdev->dma_dev, DMA_BIT_MASK(30)); ++ if (err) { + dev_err(sdev->dev, + "Required 30BIT DMA mask unsupported by the system\n"); + goto err_out_powerdown; diff --git a/queue-4.14/net-bridge-add-missing-counters-to-ndo_get_stats64-callback.patch b/queue-4.14/net-bridge-add-missing-counters-to-ndo_get_stats64-callback.patch new file mode 100644 index 00000000000..ba1105bf1ab --- /dev/null +++ b/queue-4.14/net-bridge-add-missing-counters-to-ndo_get_stats64-callback.patch @@ -0,0 +1,32 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Heiner Kallweit +Date: Fri, 13 Nov 2020 10:27:27 +0100 +Subject: net: bridge: add missing counters to ndo_get_stats64 callback + +From: Heiner Kallweit + +[ Upstream commit 7a30ecc9237681bb125cbd30eee92bef7e86293d ] + +In br_forward.c and br_input.c fields dev->stats.tx_dropped and +dev->stats.multicast are populated, but they are ignored in +ndo_get_stats64. + +Fixes: 28172739f0a2 ("net: fix 64 bit counters on 32 bit arches") +Signed-off-by: Heiner Kallweit +Link: https://lore.kernel.org/r/58ea9963-77ad-a7cf-8dfd-fc95ab95f606@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/bridge/br_device.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/net/bridge/br_device.c ++++ b/net/bridge/br_device.c +@@ -186,6 +186,7 @@ static void br_get_stats64(struct net_de + sum.rx_packets += tmp.rx_packets; + } + ++ netdev_stats_to_stats64(stats, &dev->stats); + stats->tx_bytes = sum.tx_bytes; + stats->tx_packets = sum.tx_packets; + stats->rx_bytes = sum.rx_bytes; diff --git a/queue-4.14/net-dsa-mv88e6xxx-avoid-vtu-corruption-on-6097.patch b/queue-4.14/net-dsa-mv88e6xxx-avoid-vtu-corruption-on-6097.patch new file mode 100644 index 00000000000..f55f4363d42 --- /dev/null +++ b/queue-4.14/net-dsa-mv88e6xxx-avoid-vtu-corruption-on-6097.patch @@ -0,0 +1,140 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Tobias Waldekranz +Date: Thu, 12 Nov 2020 12:43:35 +0100 +Subject: net: dsa: mv88e6xxx: Avoid VTU corruption on 6097 + +From: Tobias Waldekranz + +[ Upstream commit 92307069a96c07d9b6e74b96b79390e7cd7d2111 ] + +As soon as you add the second port to a VLAN, all other port +membership configuration is overwritten with zeroes. The HW interprets +this as all ports being "unmodified members" of the VLAN. + +In the simple case when all ports belong to the same VLAN, switching +will still work. But using multiple VLANs or trying to set multiple +ports as tagged members will not work. + +On the 6352, doing a VTU GetNext op, followed by an STU GetNext op +will leave you with both the member- and state- data in the VTU/STU +data registers. But on the 6097 (which uses the same implementation), +the STU GetNext will override the information gathered from the VTU +GetNext. + +Separate the two stages, parsing the result of the VTU GetNext before +doing the STU GetNext. + +We opt to update the existing implementation for all applicable chips, +as opposed to creating a separate callback for 6097, because although +the previous implementation did work for (at least) 6352, the +datasheet does not mention the masking behavior. + +Fixes: ef6fcea37f01 ("net: dsa: mv88e6xxx: get STU entry on VTU GetNext") +Signed-off-by: Tobias Waldekranz +Link: https://lore.kernel.org/r/20201112114335.27371-1-tobias@waldekranz.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/dsa/mv88e6xxx/global1_vtu.c | 59 ++++++++++++++++++++++++++------ + 1 file changed, 49 insertions(+), 10 deletions(-) + +--- a/drivers/net/dsa/mv88e6xxx/global1_vtu.c ++++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c +@@ -124,11 +124,9 @@ static int mv88e6xxx_g1_vtu_vid_write(st + * Offset 0x08: VTU/STU Data Register 2 + * Offset 0x09: VTU/STU Data Register 3 + */ +- +-static int mv88e6185_g1_vtu_data_read(struct mv88e6xxx_chip *chip, +- struct mv88e6xxx_vtu_entry *entry) ++static int mv88e6185_g1_vtu_stu_data_read(struct mv88e6xxx_chip *chip, ++ u16 *regs) + { +- u16 regs[3]; + int i; + + /* Read all 3 VTU/STU Data registers */ +@@ -141,12 +139,45 @@ static int mv88e6185_g1_vtu_data_read(st + return err; + } + +- /* Extract MemberTag and PortState data */ ++ return 0; ++} ++ ++static int mv88e6185_g1_vtu_data_read(struct mv88e6xxx_chip *chip, ++ struct mv88e6xxx_vtu_entry *entry) ++{ ++ u16 regs[3]; ++ int err; ++ int i; ++ ++ err = mv88e6185_g1_vtu_stu_data_read(chip, regs); ++ if (err) ++ return err; ++ ++ /* Extract MemberTag data */ + for (i = 0; i < mv88e6xxx_num_ports(chip); ++i) { + unsigned int member_offset = (i % 4) * 4; +- unsigned int state_offset = member_offset + 2; + + entry->member[i] = (regs[i / 4] >> member_offset) & 0x3; ++ } ++ ++ return 0; ++} ++ ++static int mv88e6185_g1_stu_data_read(struct mv88e6xxx_chip *chip, ++ struct mv88e6xxx_vtu_entry *entry) ++{ ++ u16 regs[3]; ++ int err; ++ int i; ++ ++ err = mv88e6185_g1_vtu_stu_data_read(chip, regs); ++ if (err) ++ return err; ++ ++ /* Extract PortState data */ ++ for (i = 0; i < mv88e6xxx_num_ports(chip); ++i) { ++ unsigned int state_offset = (i % 4) * 4 + 2; ++ + entry->state[i] = (regs[i / 4] >> state_offset) & 0x3; + } + +@@ -319,6 +350,10 @@ int mv88e6185_g1_vtu_getnext(struct mv88 + if (err) + return err; + ++ err = mv88e6185_g1_stu_data_read(chip, entry); ++ if (err) ++ return err; ++ + /* VTU DBNum[3:0] are located in VTU Operation 3:0 + * VTU DBNum[7:4] are located in VTU Operation 11:8 + */ +@@ -344,16 +379,20 @@ int mv88e6352_g1_vtu_getnext(struct mv88 + return err; + + if (entry->valid) { +- /* Fetch (and mask) VLAN PortState data from the STU */ +- err = mv88e6xxx_g1_vtu_stu_get(chip, entry); ++ err = mv88e6185_g1_vtu_data_read(chip, entry); + if (err) + return err; + +- err = mv88e6185_g1_vtu_data_read(chip, entry); ++ err = mv88e6xxx_g1_vtu_fid_read(chip, entry); + if (err) + return err; + +- err = mv88e6xxx_g1_vtu_fid_read(chip, entry); ++ /* Fetch VLAN PortState data from the STU */ ++ err = mv88e6xxx_g1_vtu_stu_get(chip, entry); ++ if (err) ++ return err; ++ ++ err = mv88e6185_g1_stu_data_read(chip, entry); + if (err) + return err; + } diff --git a/queue-4.14/net-ftgmac100-fix-crash-when-removing-driver.patch b/queue-4.14/net-ftgmac100-fix-crash-when-removing-driver.patch new file mode 100644 index 00000000000..47b991eb1d7 --- /dev/null +++ b/queue-4.14/net-ftgmac100-fix-crash-when-removing-driver.patch @@ -0,0 +1,68 @@ +From foo@baz Sun Nov 22 11:49:14 AM CET 2020 +From: Joel Stanley +Date: Tue, 17 Nov 2020 13:14:48 +1030 +Subject: net: ftgmac100: Fix crash when removing driver + +From: Joel Stanley + +[ Upstream commit 3d5179458d22dc0b4fdc724e4bed4231a655112a ] + +When removing the driver we would hit BUG_ON(!list_empty(&dev->ptype_specific)) +in net/core/dev.c due to still having the NC-SI packet handler +registered. + + # echo 1e660000.ethernet > /sys/bus/platform/drivers/ftgmac100/unbind + ------------[ cut here ]------------ + kernel BUG at net/core/dev.c:10254! + Internal error: Oops - BUG: 0 [#1] SMP ARM + CPU: 0 PID: 115 Comm: sh Not tainted 5.10.0-rc3-next-20201111-00007-g02e0365710c4 #46 + Hardware name: Generic DT based system + PC is at netdev_run_todo+0x314/0x394 + LR is at cpumask_next+0x20/0x24 + pc : [<806f5830>] lr : [<80863cb0>] psr: 80000153 + sp : 855bbd58 ip : 00000001 fp : 855bbdac + r10: 80c03d00 r9 : 80c06228 r8 : 81158c54 + r7 : 00000000 r6 : 80c05dec r5 : 80c05d18 r4 : 813b9280 + r3 : 813b9054 r2 : 8122c470 r1 : 00000002 r0 : 00000002 + Flags: Nzcv IRQs on FIQs off Mode SVC_32 ISA ARM Segment none + Control: 00c5387d Table: 85514008 DAC: 00000051 + Process sh (pid: 115, stack limit = 0x7cb5703d) + ... + Backtrace: + [<806f551c>] (netdev_run_todo) from [<80707eec>] (rtnl_unlock+0x18/0x1c) + r10:00000051 r9:854ed710 r8:81158c54 r7:80c76bb0 r6:81158c10 r5:8115b410 + r4:813b9000 + [<80707ed4>] (rtnl_unlock) from [<806f5db8>] (unregister_netdev+0x2c/0x30) + [<806f5d8c>] (unregister_netdev) from [<805a8180>] (ftgmac100_remove+0x20/0xa8) + r5:8115b410 r4:813b9000 + [<805a8160>] (ftgmac100_remove) from [<805355e4>] (platform_drv_remove+0x34/0x4c) + +Fixes: bd466c3fb5a4 ("net/faraday: Support NCSI mode") +Signed-off-by: Joel Stanley +Link: https://lore.kernel.org/r/20201117024448.1170761-1-joel@jms.id.au +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/faraday/ftgmac100.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/net/ethernet/faraday/ftgmac100.c ++++ b/drivers/net/ethernet/faraday/ftgmac100.c +@@ -1860,6 +1860,8 @@ static int ftgmac100_probe(struct platfo + return 0; + + err_ncsi_dev: ++ if (priv->ndev) ++ ncsi_unregister_dev(priv->ndev); + err_register_netdev: + ftgmac100_destroy_mdio(netdev); + err_setup_mdio: +@@ -1880,6 +1882,8 @@ static int ftgmac100_remove(struct platf + netdev = platform_get_drvdata(pdev); + priv = netdev_priv(netdev); + ++ if (priv->ndev) ++ ncsi_unregister_dev(priv->ndev); + unregister_netdev(netdev); + + /* There's a small chance the reset task will have been re-queued, diff --git a/queue-4.14/net-have-netpoll-bring-up-dsa-management-interface.patch b/queue-4.14/net-have-netpoll-bring-up-dsa-management-interface.patch new file mode 100644 index 00000000000..c82f0c59f96 --- /dev/null +++ b/queue-4.14/net-have-netpoll-bring-up-dsa-management-interface.patch @@ -0,0 +1,81 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Florian Fainelli +Date: Mon, 16 Nov 2020 19:52:34 -0800 +Subject: net: Have netpoll bring-up DSA management interface + +From: Florian Fainelli + +[ Upstream commit 1532b9778478577152201adbafa7738b1e844868 ] + +DSA network devices rely on having their DSA management interface up and +running otherwise their ndo_open() will return -ENETDOWN. Without doing +this it would not be possible to use DSA devices as netconsole when +configured on the command line. These devices also do not utilize the +upper/lower linking so the check about the netpoll device having upper +is not going to be a problem. + +The solution adopted here is identical to the one done for +net/ipv4/ipconfig.c with 728c02089a0e ("net: ipv4: handle DSA enabled +master network devices"), with the network namespace scope being +restricted to that of the process configuring netpoll. + +Fixes: 04ff53f96a93 ("net: dsa: Add netconsole support") +Tested-by: Vladimir Oltean +Signed-off-by: Florian Fainelli +Link: https://lore.kernel.org/r/20201117035236.22658-1-f.fainelli@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/core/netpoll.c | 22 ++++++++++++++++++---- + 1 file changed, 18 insertions(+), 4 deletions(-) + +--- a/net/core/netpoll.c ++++ b/net/core/netpoll.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -661,15 +662,15 @@ EXPORT_SYMBOL_GPL(__netpoll_setup); + + int netpoll_setup(struct netpoll *np) + { +- struct net_device *ndev = NULL; ++ struct net_device *ndev = NULL, *dev = NULL; ++ struct net *net = current->nsproxy->net_ns; + struct in_device *in_dev; + int err; + + rtnl_lock(); +- if (np->dev_name[0]) { +- struct net *net = current->nsproxy->net_ns; ++ if (np->dev_name[0]) + ndev = __dev_get_by_name(net, np->dev_name); +- } ++ + if (!ndev) { + np_err(np, "%s doesn't exist, aborting\n", np->dev_name); + err = -ENODEV; +@@ -677,6 +678,19 @@ int netpoll_setup(struct netpoll *np) + } + dev_hold(ndev); + ++ /* bring up DSA management network devices up first */ ++ for_each_netdev(net, dev) { ++ if (!netdev_uses_dsa(dev)) ++ continue; ++ ++ err = dev_change_flags(dev, dev->flags | IFF_UP); ++ if (err < 0) { ++ np_err(np, "%s failed to open %s\n", ++ np->dev_name, dev->name); ++ goto put; ++ } ++ } ++ + if (netdev_master_upper_dev_get(ndev)) { + np_err(np, "%s is a slave device, aborting\n", np->dev_name); + err = -EBUSY; diff --git a/queue-4.14/net-mlx4_core-fix-init_hca-fields-offset.patch b/queue-4.14/net-mlx4_core-fix-init_hca-fields-offset.patch new file mode 100644 index 00000000000..67d895ff555 --- /dev/null +++ b/queue-4.14/net-mlx4_core-fix-init_hca-fields-offset.patch @@ -0,0 +1,67 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Aya Levin +Date: Wed, 18 Nov 2020 10:19:22 +0200 +Subject: net/mlx4_core: Fix init_hca fields offset + +From: Aya Levin + +[ Upstream commit 6d9c8d15af0ef20a66a0b432cac0d08319920602 ] + +Slave function read the following capabilities from the wrong offset: +1. log_mc_entry_sz +2. fs_log_entry_sz +3. log_mc_hash_sz + +Fix that by adjusting these capabilities offset to match firmware +layout. + +Due to the wrong offset read, the following issues might occur: +1+2. Negative value reported at max_mcast_qp_attach. +3. Driver to init FW with multicast hash size of zero. + +Fixes: a40ded604365 ("net/mlx4_core: Add masking for a few queries on HCA caps") +Signed-off-by: Aya Levin +Reviewed-by: Moshe Shemesh +Reviewed-by: Eran Ben Elisha +Signed-off-by: Tariq Toukan +Link: https://lore.kernel.org/r/20201118081922.553-1-tariqt@nvidia.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mellanox/mlx4/fw.c | 6 +++--- + drivers/net/ethernet/mellanox/mlx4/fw.h | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlx4/fw.c ++++ b/drivers/net/ethernet/mellanox/mlx4/fw.c +@@ -1854,14 +1854,14 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, + #define INIT_HCA_LOG_RD_OFFSET (INIT_HCA_QPC_OFFSET + 0x77) + #define INIT_HCA_MCAST_OFFSET 0x0c0 + #define INIT_HCA_MC_BASE_OFFSET (INIT_HCA_MCAST_OFFSET + 0x00) +-#define INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x12) +-#define INIT_HCA_LOG_MC_HASH_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x16) ++#define INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x13) ++#define INIT_HCA_LOG_MC_HASH_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x17) + #define INIT_HCA_UC_STEERING_OFFSET (INIT_HCA_MCAST_OFFSET + 0x18) + #define INIT_HCA_LOG_MC_TABLE_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x1b) + #define INIT_HCA_DEVICE_MANAGED_FLOW_STEERING_EN 0x6 + #define INIT_HCA_FS_PARAM_OFFSET 0x1d0 + #define INIT_HCA_FS_BASE_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x00) +-#define INIT_HCA_FS_LOG_ENTRY_SZ_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x12) ++#define INIT_HCA_FS_LOG_ENTRY_SZ_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x13) + #define INIT_HCA_FS_A0_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x18) + #define INIT_HCA_FS_LOG_TABLE_SZ_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x1b) + #define INIT_HCA_FS_ETH_BITS_OFFSET (INIT_HCA_FS_PARAM_OFFSET + 0x21) +--- a/drivers/net/ethernet/mellanox/mlx4/fw.h ++++ b/drivers/net/ethernet/mellanox/mlx4/fw.h +@@ -181,8 +181,8 @@ struct mlx4_init_hca_param { + u64 cmpt_base; + u64 mtt_base; + u64 global_caps; +- u16 log_mc_entry_sz; +- u16 log_mc_hash_sz; ++ u8 log_mc_entry_sz; ++ u8 log_mc_hash_sz; + u16 hca_core_clock; /* Internal Clock Frequency (in MHz) */ + u8 log_num_qps; + u8 log_num_srqs; diff --git a/queue-4.14/net-mlx5-disable-qos-when-min_rates-on-all-vfs-are-zero.patch b/queue-4.14/net-mlx5-disable-qos-when-min_rates-on-all-vfs-are-zero.patch new file mode 100644 index 00000000000..f18b1e86a9d --- /dev/null +++ b/queue-4.14/net-mlx5-disable-qos-when-min_rates-on-all-vfs-are-zero.patch @@ -0,0 +1,77 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Vladyslav Tarasiuk +Date: Wed, 21 Oct 2020 11:05:41 +0300 +Subject: net/mlx5: Disable QoS when min_rates on all VFs are zero + +From: Vladyslav Tarasiuk + +[ Upstream commit 470b74758260e4abc2508cf1614573c00a00465c ] + +Currently when QoS is enabled for VF and any min_rate is configured, +the driver sets bw_share value to at least 1 and doesn’t allow to set +it to 0 to make minimal rate unlimited. It means there is always a +minimal rate configured for every VF, even if user tries to remove it. + +In order to make QoS disable possible, check whether all vports have +configured min_rate = 0. If this is true, set their bw_share to 0 to +disable min_rate limitations. + +Fixes: c9497c98901c ("net/mlx5: Add support for setting VF min rate") +Signed-off-by: Vladyslav Tarasiuk +Reviewed-by: Moshe Shemesh +Signed-off-by: Saeed Mahameed +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +@@ -1921,12 +1921,15 @@ static u32 calculate_vports_min_rate_div + max_guarantee = evport->info.min_rate; + } + +- return max_t(u32, max_guarantee / fw_max_bw_share, 1); ++ if (max_guarantee) ++ return max_t(u32, max_guarantee / fw_max_bw_share, 1); ++ return 0; + } + +-static int normalize_vports_min_rate(struct mlx5_eswitch *esw, u32 divider) ++static int normalize_vports_min_rate(struct mlx5_eswitch *esw) + { + u32 fw_max_bw_share = MLX5_CAP_QOS(esw->dev, max_tsar_bw_share); ++ u32 divider = calculate_vports_min_rate_divider(esw); + struct mlx5_vport *evport; + u32 vport_max_rate; + u32 vport_min_rate; +@@ -1940,9 +1943,9 @@ static int normalize_vports_min_rate(str + continue; + vport_min_rate = evport->info.min_rate; + vport_max_rate = evport->info.max_rate; +- bw_share = MLX5_MIN_BW_SHARE; ++ bw_share = 0; + +- if (vport_min_rate) ++ if (divider) + bw_share = MLX5_RATE_TO_BW_SHARE(vport_min_rate, + divider, + fw_max_bw_share); +@@ -1967,7 +1970,6 @@ int mlx5_eswitch_set_vport_rate(struct m + struct mlx5_vport *evport; + u32 fw_max_bw_share; + u32 previous_min_rate; +- u32 divider; + bool min_rate_supported; + bool max_rate_supported; + int err = 0; +@@ -1993,8 +1995,7 @@ int mlx5_eswitch_set_vport_rate(struct m + + previous_min_rate = evport->info.min_rate; + evport->info.min_rate = min_rate; +- divider = calculate_vports_min_rate_divider(esw); +- err = normalize_vports_min_rate(esw, divider); ++ err = normalize_vports_min_rate(esw); + if (err) { + evport->info.min_rate = previous_min_rate; + goto unlock; diff --git a/queue-4.14/net-usb-qmi_wwan-set-dtr-quirk-for-mr400.patch b/queue-4.14/net-usb-qmi_wwan-set-dtr-quirk-for-mr400.patch new file mode 100644 index 00000000000..886e1c663c5 --- /dev/null +++ b/queue-4.14/net-usb-qmi_wwan-set-dtr-quirk-for-mr400.patch @@ -0,0 +1,31 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Filip Moc +Date: Tue, 17 Nov 2020 18:36:31 +0100 +Subject: net: usb: qmi_wwan: Set DTR quirk for MR400 + +From: Filip Moc + +[ Upstream commit df8d85d8c69d6837817e54dcb73c84a8b5a13877 ] + +LTE module MR400 embedded in TL-MR6400 v4 requires DTR to be set. + +Signed-off-by: Filip Moc +Acked-by: Bjørn Mork +Link: https://lore.kernel.org/r/20201117173631.GA550981@moc6.cz +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/usb/qmi_wwan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -1029,7 +1029,7 @@ static const struct usb_device_id produc + {QMI_FIXED_INTF(0x05c6, 0x9011, 4)}, + {QMI_FIXED_INTF(0x05c6, 0x9021, 1)}, + {QMI_FIXED_INTF(0x05c6, 0x9022, 2)}, +- {QMI_FIXED_INTF(0x05c6, 0x9025, 4)}, /* Alcatel-sbell ASB TL131 TDD LTE (China Mobile) */ ++ {QMI_QUIRK_SET_DTR(0x05c6, 0x9025, 4)}, /* Alcatel-sbell ASB TL131 TDD LTE (China Mobile) */ + {QMI_FIXED_INTF(0x05c6, 0x9026, 3)}, + {QMI_FIXED_INTF(0x05c6, 0x902e, 5)}, + {QMI_FIXED_INTF(0x05c6, 0x9031, 5)}, diff --git a/queue-4.14/net-x25-increase-refcnt-of-struct-x25_neigh-in-x25_rx_call_request.patch b/queue-4.14/net-x25-increase-refcnt-of-struct-x25_neigh-in-x25_rx_call_request.patch new file mode 100644 index 00000000000..0591749380d --- /dev/null +++ b/queue-4.14/net-x25-increase-refcnt-of-struct-x25_neigh-in-x25_rx_call_request.patch @@ -0,0 +1,41 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Xie He +Date: Thu, 12 Nov 2020 02:35:06 -0800 +Subject: net: x25: Increase refcnt of "struct x25_neigh" in x25_rx_call_request + +From: Xie He + +[ Upstream commit 4ee18c179e5e815fa5575e0d2db0c05795a804ee ] + +The x25_disconnect function in x25_subr.c would decrease the refcount of +"x25->neighbour" (struct x25_neigh) and reset this pointer to NULL. + +However, the x25_rx_call_request function in af_x25.c, which is called +when we receive a connection request, does not increase the refcount when +it assigns the pointer. + +Fix this issue by increasing the refcount of "struct x25_neigh" in +x25_rx_call_request. + +This patch fixes frequent kernel crashes when using AF_X25 sockets. + +Fixes: 4becb7ee5b3d ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect") +Cc: Martin Schiller +Signed-off-by: Xie He +Link: https://lore.kernel.org/r/20201112103506.5875-1-xie.he.0141@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/x25/af_x25.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/net/x25/af_x25.c ++++ b/net/x25/af_x25.c +@@ -1048,6 +1048,7 @@ int x25_rx_call_request(struct sk_buff * + makex25->lci = lci; + makex25->dest_addr = dest_addr; + makex25->source_addr = source_addr; ++ x25_neigh_hold(nb); + makex25->neighbour = nb; + makex25->facilities = facilities; + makex25->dte_facilities= dte_facilities; diff --git a/queue-4.14/netlabel-fix-an-uninitialized-warning-in-netlbl_unlabel_staticlist.patch b/queue-4.14/netlabel-fix-an-uninitialized-warning-in-netlbl_unlabel_staticlist.patch new file mode 100644 index 00000000000..ab506203275 --- /dev/null +++ b/queue-4.14/netlabel-fix-an-uninitialized-warning-in-netlbl_unlabel_staticlist.patch @@ -0,0 +1,35 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Paul Moore +Date: Fri, 13 Nov 2020 16:30:40 -0500 +Subject: netlabel: fix an uninitialized warning in netlbl_unlabel_staticlist() + +From: Paul Moore + +[ Upstream commit 1ba86d4366e023d96df3dbe415eea7f1dc08c303 ] + +Static checking revealed that a previous fix to +netlbl_unlabel_staticlist() leaves a stack variable uninitialized, +this patches fixes that. + +Fixes: 866358ec331f ("netlabel: fix our progress tracking in netlbl_unlabel_staticlist()") +Reported-by: Dan Carpenter +Signed-off-by: Paul Moore +Reviewed-by: James Morris +Link: https://lore.kernel.org/r/160530304068.15651.18355773009751195447.stgit@sifl +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/netlabel/netlabel_unlabeled.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/netlabel/netlabel_unlabeled.c ++++ b/net/netlabel/netlabel_unlabeled.c +@@ -1180,7 +1180,7 @@ static int netlbl_unlabel_staticlist(str + u32 skip_bkt = cb->args[0]; + u32 skip_chain = cb->args[1]; + u32 skip_addr4 = cb->args[2]; +- u32 iter_bkt, iter_chain, iter_addr4 = 0, iter_addr6 = 0; ++ u32 iter_bkt, iter_chain = 0, iter_addr4 = 0, iter_addr6 = 0; + struct netlbl_unlhsh_iface *iface; + struct list_head *iter_list; + struct netlbl_af4list *addr4; diff --git a/queue-4.14/netlabel-fix-our-progress-tracking-in-netlbl_unlabel_staticlist.patch b/queue-4.14/netlabel-fix-our-progress-tracking-in-netlbl_unlabel_staticlist.patch new file mode 100644 index 00000000000..d340b2f7e1c --- /dev/null +++ b/queue-4.14/netlabel-fix-our-progress-tracking-in-netlbl_unlabel_staticlist.patch @@ -0,0 +1,89 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Paul Moore +Date: Sun, 8 Nov 2020 09:08:26 -0500 +Subject: netlabel: fix our progress tracking in netlbl_unlabel_staticlist() + +From: Paul Moore + +[ Upstream commit 866358ec331f8faa394995fb4b511af1db0247c8 ] + +The current NetLabel code doesn't correctly keep track of the netlink +dump state in some cases, in particular when multiple interfaces with +large configurations are loaded. The problem manifests itself by not +reporting the full configuration to userspace, even though it is +loaded and active in the kernel. This patch fixes this by ensuring +that the dump state is properly reset when necessary inside the +netlbl_unlabel_staticlist() function. + +Fixes: 8cc44579d1bd ("NetLabel: Introduce static network labels for unlabeled connections") +Signed-off-by: Paul Moore +Link: https://lore.kernel.org/r/160484450633.3752.16512718263560813473.stgit@sifl +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/netlabel/netlabel_unlabeled.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +--- a/net/netlabel/netlabel_unlabeled.c ++++ b/net/netlabel/netlabel_unlabeled.c +@@ -1179,12 +1179,13 @@ static int netlbl_unlabel_staticlist(str + struct netlbl_unlhsh_walk_arg cb_arg; + u32 skip_bkt = cb->args[0]; + u32 skip_chain = cb->args[1]; +- u32 iter_bkt; +- u32 iter_chain = 0, iter_addr4 = 0, iter_addr6 = 0; ++ u32 skip_addr4 = cb->args[2]; ++ u32 iter_bkt, iter_chain, iter_addr4 = 0, iter_addr6 = 0; + struct netlbl_unlhsh_iface *iface; + struct list_head *iter_list; + struct netlbl_af4list *addr4; + #if IS_ENABLED(CONFIG_IPV6) ++ u32 skip_addr6 = cb->args[3]; + struct netlbl_af6list *addr6; + #endif + +@@ -1195,7 +1196,7 @@ static int netlbl_unlabel_staticlist(str + rcu_read_lock(); + for (iter_bkt = skip_bkt; + iter_bkt < rcu_dereference(netlbl_unlhsh)->size; +- iter_bkt++, iter_chain = 0, iter_addr4 = 0, iter_addr6 = 0) { ++ iter_bkt++) { + iter_list = &rcu_dereference(netlbl_unlhsh)->tbl[iter_bkt]; + list_for_each_entry_rcu(iface, iter_list, list) { + if (!iface->valid || +@@ -1203,7 +1204,7 @@ static int netlbl_unlabel_staticlist(str + continue; + netlbl_af4list_foreach_rcu(addr4, + &iface->addr4_list) { +- if (iter_addr4++ < cb->args[2]) ++ if (iter_addr4++ < skip_addr4) + continue; + if (netlbl_unlabel_staticlist_gen( + NLBL_UNLABEL_C_STATICLIST, +@@ -1216,10 +1217,12 @@ static int netlbl_unlabel_staticlist(str + goto unlabel_staticlist_return; + } + } ++ iter_addr4 = 0; ++ skip_addr4 = 0; + #if IS_ENABLED(CONFIG_IPV6) + netlbl_af6list_foreach_rcu(addr6, + &iface->addr6_list) { +- if (iter_addr6++ < cb->args[3]) ++ if (iter_addr6++ < skip_addr6) + continue; + if (netlbl_unlabel_staticlist_gen( + NLBL_UNLABEL_C_STATICLIST, +@@ -1232,8 +1235,12 @@ static int netlbl_unlabel_staticlist(str + goto unlabel_staticlist_return; + } + } ++ iter_addr6 = 0; ++ skip_addr6 = 0; + #endif /* IPv6 */ + } ++ iter_chain = 0; ++ skip_chain = 0; + } + + unlabel_staticlist_return: diff --git a/queue-4.14/qlcnic-fix-error-return-code-in-qlcnic_83xx_restart_hw.patch b/queue-4.14/qlcnic-fix-error-return-code-in-qlcnic_83xx_restart_hw.patch new file mode 100644 index 00000000000..ea493563011 --- /dev/null +++ b/queue-4.14/qlcnic-fix-error-return-code-in-qlcnic_83xx_restart_hw.patch @@ -0,0 +1,34 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Zhang Changzhong +Date: Fri, 13 Nov 2020 14:16:26 +0800 +Subject: qlcnic: fix error return code in qlcnic_83xx_restart_hw() + +From: Zhang Changzhong + +[ Upstream commit 3beb9be165083c2964eba1923601c3bfac0b02d4 ] + +Fix to return a negative error code from the error handling +case instead of 0, as done elsewhere in this function. + +Fixes: 3ced0a88cd4c ("qlcnic: Add support to run firmware POST") +Reported-by: Hulk Robot +Signed-off-by: Zhang Changzhong +Link: https://lore.kernel.org/r/1605248186-16013-1-git-send-email-zhangchangzhong@huawei.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +@@ -2251,7 +2251,8 @@ static int qlcnic_83xx_restart_hw(struct + + /* Boot either flash image or firmware image from host file system */ + if (qlcnic_load_fw_file == 1) { +- if (qlcnic_83xx_load_fw_image_from_host(adapter)) ++ err = qlcnic_83xx_load_fw_image_from_host(adapter); ++ if (err) + return err; + } else { + QLC_SHARED_REG_WR32(adapter, QLCNIC_FW_IMG_VALID, diff --git a/queue-4.14/sctp-change-to-hold-put-transport-for-proto_unreach_timer.patch b/queue-4.14/sctp-change-to-hold-put-transport-for-proto_unreach_timer.patch new file mode 100644 index 00000000000..f691fd213d9 --- /dev/null +++ b/queue-4.14/sctp-change-to-hold-put-transport-for-proto_unreach_timer.patch @@ -0,0 +1,102 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Xin Long +Date: Sat, 14 Nov 2020 13:22:53 +0800 +Subject: sctp: change to hold/put transport for proto_unreach_timer + +From: Xin Long + +[ Upstream commit 057a10fa1f73d745c8e69aa54ab147715f5630ae ] + +A call trace was found in Hangbin's Codenomicon testing with debug kernel: + + [ 2615.981988] ODEBUG: free active (active state 0) object type: timer_list hint: sctp_generate_proto_unreach_event+0x0/0x3a0 [sctp] + [ 2615.995050] WARNING: CPU: 17 PID: 0 at lib/debugobjects.c:328 debug_print_object+0x199/0x2b0 + [ 2616.095934] RIP: 0010:debug_print_object+0x199/0x2b0 + [ 2616.191533] Call Trace: + [ 2616.194265] + [ 2616.202068] debug_check_no_obj_freed+0x25e/0x3f0 + [ 2616.207336] slab_free_freelist_hook+0xeb/0x140 + [ 2616.220971] kfree+0xd6/0x2c0 + [ 2616.224293] rcu_do_batch+0x3bd/0xc70 + [ 2616.243096] rcu_core+0x8b9/0xd00 + [ 2616.256065] __do_softirq+0x23d/0xacd + [ 2616.260166] irq_exit+0x236/0x2a0 + [ 2616.263879] smp_apic_timer_interrupt+0x18d/0x620 + [ 2616.269138] apic_timer_interrupt+0xf/0x20 + [ 2616.273711] + +This is because it holds asoc when transport->proto_unreach_timer starts +and puts asoc when the timer stops, and without holding transport the +transport could be freed when the timer is still running. + +So fix it by holding/putting transport instead for proto_unreach_timer +in transport, just like other timers in transport. + +v1->v2: + - Also use sctp_transport_put() for the "out_unlock:" path in + sctp_generate_proto_unreach_event(), as Marcelo noticed. + +Fixes: 50b5d6ad6382 ("sctp: Fix a race between ICMP protocol unreachable and connect()") +Reported-by: Hangbin Liu +Signed-off-by: Xin Long +Acked-by: Marcelo Ricardo Leitner +Link: https://lore.kernel.org/r/102788809b554958b13b95d33440f5448113b8d6.1605331373.git.lucien.xin@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/sctp/input.c | 4 ++-- + net/sctp/sm_sideeffect.c | 4 ++-- + net/sctp/transport.c | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +--- a/net/sctp/input.c ++++ b/net/sctp/input.c +@@ -453,7 +453,7 @@ void sctp_icmp_proto_unreachable(struct + else { + if (!mod_timer(&t->proto_unreach_timer, + jiffies + (HZ/20))) +- sctp_association_hold(asoc); ++ sctp_transport_hold(t); + } + } else { + struct net *net = sock_net(sk); +@@ -462,7 +462,7 @@ void sctp_icmp_proto_unreachable(struct + "encountered!\n", __func__); + + if (del_timer(&t->proto_unreach_timer)) +- sctp_association_put(asoc); ++ sctp_transport_put(t); + + sctp_do_sm(net, SCTP_EVENT_T_OTHER, + SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH), +--- a/net/sctp/sm_sideeffect.c ++++ b/net/sctp/sm_sideeffect.c +@@ -418,7 +418,7 @@ void sctp_generate_proto_unreach_event(u + /* Try again later. */ + if (!mod_timer(&transport->proto_unreach_timer, + jiffies + (HZ/20))) +- sctp_association_hold(asoc); ++ sctp_transport_hold(transport); + goto out_unlock; + } + +@@ -434,7 +434,7 @@ void sctp_generate_proto_unreach_event(u + + out_unlock: + bh_unlock_sock(sk); +- sctp_association_put(asoc); ++ sctp_transport_put(transport); + } + + /* Handle the timeout of the RE-CONFIG timer. */ +--- a/net/sctp/transport.c ++++ b/net/sctp/transport.c +@@ -151,7 +151,7 @@ void sctp_transport_free(struct sctp_tra + + /* Delete the ICMP proto unreachable timer if it's active. */ + if (del_timer(&transport->proto_unreach_timer)) +- sctp_association_put(transport->asoc); ++ sctp_transport_put(transport); + + sctp_transport_put(transport); + } diff --git a/queue-4.14/series b/queue-4.14/series new file mode 100644 index 00000000000..b720c9c63ac --- /dev/null +++ b/queue-4.14/series @@ -0,0 +1,20 @@ +ah6-fix-error-return-code-in-ah6_input.patch +atm-nicstar-unmap-dma-on-send-error.patch +bnxt_en-read-eeprom-a2h-address-using-page-0.patch +devlink-add-missing-genlmsg_cancel-in-devlink_nl_sb_port_pool_fill.patch +inet_diag-fix-error-path-to-cancel-the-meseage-in-inet_req_diag_fill.patch +mlxsw-core-use-variable-timeout-for-emad-retries.patch +net-b44-fix-error-return-code-in-b44_init_one.patch +net-bridge-add-missing-counters-to-ndo_get_stats64-callback.patch +net-dsa-mv88e6xxx-avoid-vtu-corruption-on-6097.patch +net-have-netpoll-bring-up-dsa-management-interface.patch +netlabel-fix-our-progress-tracking-in-netlbl_unlabel_staticlist.patch +netlabel-fix-an-uninitialized-warning-in-netlbl_unlabel_staticlist.patch +net-mlx4_core-fix-init_hca-fields-offset.patch +net-x25-increase-refcnt-of-struct-x25_neigh-in-x25_rx_call_request.patch +qlcnic-fix-error-return-code-in-qlcnic_83xx_restart_hw.patch +sctp-change-to-hold-put-transport-for-proto_unreach_timer.patch +net-mlx5-disable-qos-when-min_rates-on-all-vfs-are-zero.patch +net-usb-qmi_wwan-set-dtr-quirk-for-mr400.patch +tcp-only-postpone-probe_rtt-if-rtt-is-current-min_rtt-estimate.patch +net-ftgmac100-fix-crash-when-removing-driver.patch diff --git a/queue-4.14/tcp-only-postpone-probe_rtt-if-rtt-is-current-min_rtt-estimate.patch b/queue-4.14/tcp-only-postpone-probe_rtt-if-rtt-is-current-min_rtt-estimate.patch new file mode 100644 index 00000000000..4b8223813c2 --- /dev/null +++ b/queue-4.14/tcp-only-postpone-probe_rtt-if-rtt-is-current-min_rtt-estimate.patch @@ -0,0 +1,46 @@ +From foo@baz Sun Nov 22 12:05:54 PM CET 2020 +From: Ryan Sharpelletti +Date: Mon, 16 Nov 2020 17:44:13 +0000 +Subject: tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate + +From: Ryan Sharpelletti + +[ Upstream commit 1b9e2a8c99a5c021041bfb2d512dc3ed92a94ffd ] + +During loss recovery, retransmitted packets are forced to use TCP +timestamps to calculate the RTT samples, which have a millisecond +granularity. BBR is designed using a microsecond granularity. As a +result, multiple RTT samples could be truncated to the same RTT value +during loss recovery. This is problematic, as BBR will not enter +PROBE_RTT if the RTT sample is <= the current min_rtt sample, meaning +that if there are persistent losses, PROBE_RTT will constantly be +pushed off and potentially never re-entered. This patch makes sure +that BBR enters PROBE_RTT by checking if RTT sample is < the current +min_rtt sample, rather than <=. + +The Netflix transport/TCP team discovered this bug in the Linux TCP +BBR code during lab tests. + +Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control") +Signed-off-by: Ryan Sharpelletti +Signed-off-by: Neal Cardwell +Signed-off-by: Soheil Hassas Yeganeh +Signed-off-by: Yuchung Cheng +Link: https://lore.kernel.org/r/20201116174412.1433277-1-sharpelletti.kdev@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/tcp_bbr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/ipv4/tcp_bbr.c ++++ b/net/ipv4/tcp_bbr.c +@@ -769,7 +769,7 @@ static void bbr_update_min_rtt(struct so + filter_expired = after(tcp_jiffies32, + bbr->min_rtt_stamp + bbr_min_rtt_win_sec * HZ); + if (rs->rtt_us >= 0 && +- (rs->rtt_us <= bbr->min_rtt_us || filter_expired)) { ++ (rs->rtt_us < bbr->min_rtt_us || filter_expired)) { + bbr->min_rtt_us = rs->rtt_us; + bbr->min_rtt_stamp = tcp_jiffies32; + }