From: Sasha Levin Date: Mon, 22 Feb 2021 01:29:50 +0000 (-0500) Subject: Fixes for 5.10 X-Git-Tag: v5.11.1~1^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3486ffc37d307adeb74be9ddd399458cbef1dad6;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/mptcp-skip-to-next-candidate-if-subflow-has-unacked-.patch b/queue-5.10/mptcp-skip-to-next-candidate-if-subflow-has-unacked-.patch new file mode 100644 index 00000000000..55b2696c8bc --- /dev/null +++ b/queue-5.10/mptcp-skip-to-next-candidate-if-subflow-has-unacked-.patch @@ -0,0 +1,44 @@ +From 20251813a452451d341c8891ec7ab03ff5e5f221 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 19 Nov 2020 11:45:56 -0800 +Subject: mptcp: skip to next candidate if subflow has unacked data + +From: Florian Westphal + +[ Upstream commit 860975c6f80adae9d2c7654bde04a99dd28bc94f ] + +In case a subflow path is blocked, MPTCP-level retransmit may not take +place anymore because such subflow is likely to have unacked data left +in its write queue. + +Ignore subflows that have experienced loss and test next candidate. + +Fixes: 3b1d6210a95773691 ("mptcp: implement and use MPTCP-level retransmission") +Signed-off-by: Florian Westphal +Signed-off-by: Mat Martineau +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/mptcp/protocol.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c +index 967ce9ccfc0da..f56b2e331bb6b 100644 +--- a/net/mptcp/protocol.c ++++ b/net/mptcp/protocol.c +@@ -1648,8 +1648,11 @@ static struct sock *mptcp_subflow_get_retrans(const struct mptcp_sock *msk) + continue; + + /* still data outstanding at TCP level? Don't retransmit. */ +- if (!tcp_write_queue_empty(ssk)) ++ if (!tcp_write_queue_empty(ssk)) { ++ if (inet_csk(ssk)->icsk_ca_state >= TCP_CA_Loss) ++ continue; + return NULL; ++ } + + if (subflow->backup) { + if (!backup) +-- +2.27.0 + diff --git a/queue-5.10/mt76-mt7615-fix-rdd-mcu-cmd-endianness.patch b/queue-5.10/mt76-mt7615-fix-rdd-mcu-cmd-endianness.patch new file mode 100644 index 00000000000..75f3a659863 --- /dev/null +++ b/queue-5.10/mt76-mt7615-fix-rdd-mcu-cmd-endianness.patch @@ -0,0 +1,158 @@ +From 248288ef43ae15b22d69f0aadda8611ea2ccec97 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Nov 2020 00:18:18 +0100 +Subject: mt76: mt7615: fix rdd mcu cmd endianness + +From: Lorenzo Bianconi + +[ Upstream commit 0211c282bc8aaa15343aadbc6e23043e7057f77d ] + +Similar to mt7915 driver, fix mt7615 radar mcu command endianness + +Fixes: 2ce73efe0f8e5 ("mt76: mt7615: initialize radar specs from host driver") +Fixes: 70911d9638069 ("mt76: mt7615: add radar pattern test knob to debugfs") +Signed-off-by: Lorenzo Bianconi +Signed-off-by: Felix Fietkau +Signed-off-by: Sasha Levin +--- + .../net/wireless/mediatek/mt76/mt7615/mcu.c | 89 ++++++++++++++----- + 1 file changed, 66 insertions(+), 23 deletions(-) + +diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +index 31b40fb83f6c1..c31036f57aef8 100644 +--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c ++++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +@@ -2718,11 +2718,11 @@ int mt7615_mcu_rdd_cmd(struct mt7615_dev *dev, + int mt7615_mcu_set_fcc5_lpn(struct mt7615_dev *dev, int val) + { + struct { +- u16 tag; +- u16 min_lpn; ++ __le16 tag; ++ __le16 min_lpn; + } req = { +- .tag = 0x1, +- .min_lpn = val, ++ .tag = cpu_to_le16(0x1), ++ .min_lpn = cpu_to_le16(val), + }; + + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH, +@@ -2733,14 +2733,27 @@ int mt7615_mcu_set_pulse_th(struct mt7615_dev *dev, + const struct mt7615_dfs_pulse *pulse) + { + struct { +- u16 tag; +- struct mt7615_dfs_pulse pulse; ++ __le16 tag; ++ __le32 max_width; /* us */ ++ __le32 max_pwr; /* dbm */ ++ __le32 min_pwr; /* dbm */ ++ __le32 min_stgr_pri; /* us */ ++ __le32 max_stgr_pri; /* us */ ++ __le32 min_cr_pri; /* us */ ++ __le32 max_cr_pri; /* us */ + } req = { +- .tag = 0x3, ++ .tag = cpu_to_le16(0x3), ++#define __req_field(field) .field = cpu_to_le32(pulse->field) ++ __req_field(max_width), ++ __req_field(max_pwr), ++ __req_field(min_pwr), ++ __req_field(min_stgr_pri), ++ __req_field(max_stgr_pri), ++ __req_field(min_cr_pri), ++ __req_field(max_cr_pri), ++#undef __req_field + }; + +- memcpy(&req.pulse, pulse, sizeof(*pulse)); +- + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH, + &req, sizeof(req), true); + } +@@ -2749,16 +2762,45 @@ int mt7615_mcu_set_radar_th(struct mt7615_dev *dev, int index, + const struct mt7615_dfs_pattern *pattern) + { + struct { +- u16 tag; +- u16 radar_type; +- struct mt7615_dfs_pattern pattern; ++ __le16 tag; ++ __le16 radar_type; ++ u8 enb; ++ u8 stgr; ++ u8 min_crpn; ++ u8 max_crpn; ++ u8 min_crpr; ++ u8 min_pw; ++ u8 max_pw; ++ __le32 min_pri; ++ __le32 max_pri; ++ u8 min_crbn; ++ u8 max_crbn; ++ u8 min_stgpn; ++ u8 max_stgpn; ++ u8 min_stgpr; + } req = { +- .tag = 0x2, +- .radar_type = index, ++ .tag = cpu_to_le16(0x2), ++ .radar_type = cpu_to_le16(index), ++#define __req_field_u8(field) .field = pattern->field ++#define __req_field_u32(field) .field = cpu_to_le32(pattern->field) ++ __req_field_u8(enb), ++ __req_field_u8(stgr), ++ __req_field_u8(min_crpn), ++ __req_field_u8(max_crpn), ++ __req_field_u8(min_crpr), ++ __req_field_u8(min_pw), ++ __req_field_u8(max_pw), ++ __req_field_u32(min_pri), ++ __req_field_u32(max_pri), ++ __req_field_u8(min_crbn), ++ __req_field_u8(max_crbn), ++ __req_field_u8(min_stgpn), ++ __req_field_u8(max_stgpn), ++ __req_field_u8(min_stgpr), ++#undef __req_field_u8 ++#undef __req_field_u32 + }; + +- memcpy(&req.pattern, pattern, sizeof(*pattern)); +- + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH, + &req, sizeof(req), true); + } +@@ -2769,9 +2811,9 @@ int mt7615_mcu_rdd_send_pattern(struct mt7615_dev *dev) + u8 pulse_num; + u8 rsv[3]; + struct { +- u32 start_time; +- u16 width; +- s16 power; ++ __le32 start_time; ++ __le16 width; ++ __le16 power; + } pattern[32]; + } req = { + .pulse_num = dev->radar_pattern.n_pulses, +@@ -2784,10 +2826,11 @@ int mt7615_mcu_rdd_send_pattern(struct mt7615_dev *dev) + + /* TODO: add some noise here */ + for (i = 0; i < dev->radar_pattern.n_pulses; i++) { +- req.pattern[i].width = dev->radar_pattern.width; +- req.pattern[i].power = dev->radar_pattern.power; +- req.pattern[i].start_time = start_time + +- i * dev->radar_pattern.period; ++ u32 ts = start_time + i * dev->radar_pattern.period; ++ ++ req.pattern[i].width = cpu_to_le16(dev->radar_pattern.width); ++ req.pattern[i].power = cpu_to_le16(dev->radar_pattern.power); ++ req.pattern[i].start_time = cpu_to_le32(ts); + } + + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_PATTERN, +-- +2.27.0 + diff --git a/queue-5.10/mt76-mt7915-fix-endian-issues.patch b/queue-5.10/mt76-mt7915-fix-endian-issues.patch new file mode 100644 index 00000000000..4855f4d915c --- /dev/null +++ b/queue-5.10/mt76-mt7915-fix-endian-issues.patch @@ -0,0 +1,161 @@ +From 6567cbabfe49c19922e78bb7240cc3da7fa3d6ae Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 12 Nov 2020 15:23:28 +0100 +Subject: mt76: mt7915: fix endian issues + +From: Felix Fietkau + +[ Upstream commit cee236e1489ecca9d23d6ce6f60d126cc651a5ba ] + +Multiple MCU messages were using u16/u32 fields without endian annotations +or conversions + +Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets") +Fixes: 5517f78b0063 ("mt76: mt7915: enable firmware module debug support") +Signed-off-by: Felix Fietkau +Signed-off-by: Sasha Levin +--- + .../net/wireless/mediatek/mt76/mt7915/mcu.c | 87 +++++++++++++++---- + 1 file changed, 68 insertions(+), 19 deletions(-) + +diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +index a3ccc17856615..ea71409751519 100644 +--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c ++++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +@@ -2835,7 +2835,7 @@ int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level) + struct { + u8 ver; + u8 pad; +- u16 len; ++ __le16 len; + u8 level; + u8 rsv[3]; + __le32 module_idx; +@@ -3070,12 +3070,12 @@ int mt7915_mcu_rdd_cmd(struct mt7915_dev *dev, + int mt7915_mcu_set_fcc5_lpn(struct mt7915_dev *dev, int val) + { + struct { +- u32 tag; +- u16 min_lpn; ++ __le32 tag; ++ __le16 min_lpn; + u8 rsv[2]; + } __packed req = { +- .tag = 0x1, +- .min_lpn = val, ++ .tag = cpu_to_le32(0x1), ++ .min_lpn = cpu_to_le16(val), + }; + + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH, +@@ -3086,14 +3086,29 @@ int mt7915_mcu_set_pulse_th(struct mt7915_dev *dev, + const struct mt7915_dfs_pulse *pulse) + { + struct { +- u32 tag; +- struct mt7915_dfs_pulse pulse; ++ __le32 tag; ++ ++ __le32 max_width; /* us */ ++ __le32 max_pwr; /* dbm */ ++ __le32 min_pwr; /* dbm */ ++ __le32 min_stgr_pri; /* us */ ++ __le32 max_stgr_pri; /* us */ ++ __le32 min_cr_pri; /* us */ ++ __le32 max_cr_pri; /* us */ + } __packed req = { +- .tag = 0x3, ++ .tag = cpu_to_le32(0x3), ++ ++#define __req_field(field) .field = cpu_to_le32(pulse->field) ++ __req_field(max_width), ++ __req_field(max_pwr), ++ __req_field(min_pwr), ++ __req_field(min_stgr_pri), ++ __req_field(max_stgr_pri), ++ __req_field(min_cr_pri), ++ __req_field(max_cr_pri), ++#undef __req_field + }; + +- memcpy(&req.pulse, pulse, sizeof(*pulse)); +- + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH, + &req, sizeof(req), true); + } +@@ -3102,16 +3117,50 @@ int mt7915_mcu_set_radar_th(struct mt7915_dev *dev, int index, + const struct mt7915_dfs_pattern *pattern) + { + struct { +- u32 tag; +- u16 radar_type; +- struct mt7915_dfs_pattern pattern; ++ __le32 tag; ++ __le16 radar_type; ++ ++ u8 enb; ++ u8 stgr; ++ u8 min_crpn; ++ u8 max_crpn; ++ u8 min_crpr; ++ u8 min_pw; ++ u32 min_pri; ++ u32 max_pri; ++ u8 max_pw; ++ u8 min_crbn; ++ u8 max_crbn; ++ u8 min_stgpn; ++ u8 max_stgpn; ++ u8 min_stgpr; ++ u8 rsv[2]; ++ u32 min_stgpr_diff; + } __packed req = { +- .tag = 0x2, +- .radar_type = index, ++ .tag = cpu_to_le32(0x2), ++ .radar_type = cpu_to_le16(index), ++ ++#define __req_field_u8(field) .field = pattern->field ++#define __req_field_u32(field) .field = cpu_to_le32(pattern->field) ++ __req_field_u8(enb), ++ __req_field_u8(stgr), ++ __req_field_u8(min_crpn), ++ __req_field_u8(max_crpn), ++ __req_field_u8(min_crpr), ++ __req_field_u8(min_pw), ++ __req_field_u32(min_pri), ++ __req_field_u32(max_pri), ++ __req_field_u8(max_pw), ++ __req_field_u8(min_crbn), ++ __req_field_u8(max_crbn), ++ __req_field_u8(min_stgpn), ++ __req_field_u8(max_stgpn), ++ __req_field_u8(min_stgpr), ++ __req_field_u32(min_stgpr_diff), ++#undef __req_field_u8 ++#undef __req_field_u32 + }; + +- memcpy(&req.pattern, pattern, sizeof(*pattern)); +- + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_RDD_TH, + &req, sizeof(req), true); + } +@@ -3342,12 +3391,12 @@ int mt7915_mcu_add_obss_spr(struct mt7915_dev *dev, struct ieee80211_vif *vif, + u8 drop_tx_idx; + u8 sta_idx; /* 256 sta */ + u8 rsv[2]; +- u32 val; ++ __le32 val; + } __packed req = { + .action = MT_SPR_ENABLE, + .arg_num = 1, + .band_idx = mvif->band_idx, +- .val = enable, ++ .val = cpu_to_le32(enable), + }; + + return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_SPR, +-- +2.27.0 + diff --git a/queue-5.10/net-bridge-fix-a-warning-when-del-bridge-sysfs.patch b/queue-5.10/net-bridge-fix-a-warning-when-del-bridge-sysfs.patch new file mode 100644 index 00000000000..0d682a883e6 --- /dev/null +++ b/queue-5.10/net-bridge-fix-a-warning-when-del-bridge-sysfs.patch @@ -0,0 +1,72 @@ +From a6dcdfa096be5b8ed04c5490c17ceac2dcde587b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 11 Dec 2020 20:29:21 +0800 +Subject: net: bridge: Fix a warning when del bridge sysfs + +From: Wang Hai + +[ Upstream commit 989a1db06eb18ff605377eec87e18d795e0ec74b ] + +I got a warining report: + +br_sysfs_addbr: can't create group bridge4/bridge +------------[ cut here ]------------ +sysfs group 'bridge' not found for kobject 'bridge4' +WARNING: CPU: 2 PID: 9004 at fs/sysfs/group.c:279 sysfs_remove_group fs/sysfs/group.c:279 [inline] +WARNING: CPU: 2 PID: 9004 at fs/sysfs/group.c:279 sysfs_remove_group+0x153/0x1b0 fs/sysfs/group.c:270 +Modules linked in: iptable_nat +... +Call Trace: + br_dev_delete+0x112/0x190 net/bridge/br_if.c:384 + br_dev_newlink net/bridge/br_netlink.c:1381 [inline] + br_dev_newlink+0xdb/0x100 net/bridge/br_netlink.c:1362 + __rtnl_newlink+0xe11/0x13f0 net/core/rtnetlink.c:3441 + rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3500 + rtnetlink_rcv_msg+0x385/0x980 net/core/rtnetlink.c:5562 + netlink_rcv_skb+0x134/0x3d0 net/netlink/af_netlink.c:2494 + netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] + netlink_unicast+0x4a0/0x6a0 net/netlink/af_netlink.c:1330 + netlink_sendmsg+0x793/0xc80 net/netlink/af_netlink.c:1919 + sock_sendmsg_nosec net/socket.c:651 [inline] + sock_sendmsg+0x139/0x170 net/socket.c:671 + ____sys_sendmsg+0x658/0x7d0 net/socket.c:2353 + ___sys_sendmsg+0xf8/0x170 net/socket.c:2407 + __sys_sendmsg+0xd3/0x190 net/socket.c:2440 + do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 + entry_SYSCALL_64_after_hwframe+0x44/0xa9 + +In br_device_event(), if the bridge sysfs fails to be added, +br_device_event() should return error. This can prevent warining +when removing bridge sysfs that do not exist. + +Fixes: bb900b27a2f4 ("bridge: allow creating bridge devices with netlink") +Reported-by: Hulk Robot +Signed-off-by: Wang Hai +Tested-by: Nikolay Aleksandrov +Acked-by: Nikolay Aleksandrov +Link: https://lore.kernel.org/r/20201211122921.40386-1-wanghai38@huawei.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/bridge/br.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/net/bridge/br.c b/net/bridge/br.c +index 401eeb9142eb6..1b169f8e74919 100644 +--- a/net/bridge/br.c ++++ b/net/bridge/br.c +@@ -43,7 +43,10 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v + + if (event == NETDEV_REGISTER) { + /* register of bridge completed, add sysfs entries */ +- br_sysfs_addbr(dev); ++ err = br_sysfs_addbr(dev); ++ if (err) ++ return notifier_from_errno(err); ++ + return NOTIFY_DONE; + } + } +-- +2.27.0 + diff --git a/queue-5.10/net-fix-proc_fs-init-handling-in-af_packet-and-tls.patch b/queue-5.10/net-fix-proc_fs-init-handling-in-af_packet-and-tls.patch new file mode 100644 index 00000000000..cd4763bd2fb --- /dev/null +++ b/queue-5.10/net-fix-proc_fs-init-handling-in-af_packet-and-tls.patch @@ -0,0 +1,85 @@ +From d5ff8674e01f09858570cfd31fda888fa3c60954 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 14 Dec 2020 22:25:50 +0200 +Subject: net: fix proc_fs init handling in af_packet and tls + +From: Yonatan Linik + +[ Upstream commit a268e0f2455c32653140775662b40c2b1f1b2efa ] + +proc_fs was used, in af_packet, without a surrounding #ifdef, +although there is no hard dependency on proc_fs. +That caused the initialization of the af_packet module to fail +when CONFIG_PROC_FS=n. + +Specifically, proc_create_net() was used in af_packet.c, +and when it fails, packet_net_init() returns -ENOMEM. +It will always fail when the kernel is compiled without proc_fs, +because, proc_create_net() for example always returns NULL. + +The calling order that starts in af_packet.c is as follows: +packet_init() +register_pernet_subsys() +register_pernet_operations() +__register_pernet_operations() +ops_init() +ops->init() (packet_net_ops.init=packet_net_init()) +proc_create_net() + +It worked in the past because register_pernet_subsys()'s return value +wasn't checked before this Commit 36096f2f4fa0 ("packet: Fix error path in +packet_init."). +It always returned an error, but was not checked before, so everything +was working even when CONFIG_PROC_FS=n. + +The fix here is simply to add the necessary #ifdef. + +This also fixes a similar error in tls_proc.c, that was found by Jakub +Kicinski. + +Fixes: d26b698dd3cd ("net/tls: add skeleton of MIB statistics") +Fixes: 36096f2f4fa0 ("packet: Fix error path in packet_init") +Signed-off-by: Yonatan Linik +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/packet/af_packet.c | 2 ++ + net/tls/tls_proc.c | 3 +++ + 2 files changed, 5 insertions(+) + +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c +index 7a18ffff85514..a0121e7c98b14 100644 +--- a/net/packet/af_packet.c ++++ b/net/packet/af_packet.c +@@ -4615,9 +4615,11 @@ static int __net_init packet_net_init(struct net *net) + mutex_init(&net->packet.sklist_lock); + INIT_HLIST_HEAD(&net->packet.sklist); + ++#ifdef CONFIG_PROC_FS + if (!proc_create_net("packet", 0, net->proc_net, &packet_seq_ops, + sizeof(struct seq_net_private))) + return -ENOMEM; ++#endif /* CONFIG_PROC_FS */ + + return 0; + } +diff --git a/net/tls/tls_proc.c b/net/tls/tls_proc.c +index 3a5dd1e072332..feeceb0e4cb48 100644 +--- a/net/tls/tls_proc.c ++++ b/net/tls/tls_proc.c +@@ -37,9 +37,12 @@ static int tls_statistics_seq_show(struct seq_file *seq, void *v) + + int __net_init tls_proc_init(struct net *net) + { ++#ifdef CONFIG_PROC_FS + if (!proc_create_net_single("tls_stat", 0444, net->proc_net, + tls_statistics_seq_show, NULL)) + return -ENOMEM; ++#endif /* CONFIG_PROC_FS */ ++ + return 0; + } + +-- +2.27.0 + diff --git a/queue-5.10/net-openvswitch-fix-ttl-decrement-exception-action-e.patch b/queue-5.10/net-openvswitch-fix-ttl-decrement-exception-action-e.patch new file mode 100644 index 00000000000..2341e57ee3c --- /dev/null +++ b/queue-5.10/net-openvswitch-fix-ttl-decrement-exception-action-e.patch @@ -0,0 +1,68 @@ +From 8cf7fe79e6b2173f0c2742a0a748e904bfcdbfdb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 7 Dec 2020 05:08:39 -0500 +Subject: net: openvswitch: fix TTL decrement exception action execution + +From: Eelco Chaudron + +[ Upstream commit 09d6217254c004f6237cc2c2bfe604af58e9a8c5 ] + +Currently, the exception actions are not processed correctly as the wrong +dataset is passed. This change fixes this, including the misleading +comment. + +In addition, a check was added to make sure we work on an IPv4 packet, +and not just assume if it's not IPv6 it's IPv4. + +This was all tested using OVS with patch, +https://patchwork.ozlabs.org/project/openvswitch/list/?series=21639, +applied and sending packets with a TTL of 1 (and 0), both with IPv4 +and IPv6. + +Fixes: 69929d4c49e1 ("net: openvswitch: fix TTL decrement action netlink message format") +Signed-off-by: Eelco Chaudron +Link: https://lore.kernel.org/r/160733569860.3007.12938188180387116741.stgit@wsfd-netdev64.ntdv.lab.eng.bos.redhat.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/openvswitch/actions.c | 15 ++++++--------- + 1 file changed, 6 insertions(+), 9 deletions(-) + +diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c +index c3a664871cb5a..e8902a7e60f24 100644 +--- a/net/openvswitch/actions.c ++++ b/net/openvswitch/actions.c +@@ -959,16 +959,13 @@ static int dec_ttl_exception_handler(struct datapath *dp, struct sk_buff *skb, + struct sw_flow_key *key, + const struct nlattr *attr, bool last) + { +- /* The first action is always 'OVS_DEC_TTL_ATTR_ARG'. */ +- struct nlattr *dec_ttl_arg = nla_data(attr); ++ /* The first attribute is always 'OVS_DEC_TTL_ATTR_ACTION'. */ ++ struct nlattr *actions = nla_data(attr); + +- if (nla_len(dec_ttl_arg)) { +- struct nlattr *actions = nla_data(dec_ttl_arg); ++ if (nla_len(actions)) ++ return clone_execute(dp, skb, key, 0, nla_data(actions), ++ nla_len(actions), last, false); + +- if (actions) +- return clone_execute(dp, skb, key, 0, nla_data(actions), +- nla_len(actions), last, false); +- } + consume_skb(skb); + return 0; + } +@@ -1212,7 +1209,7 @@ static int execute_dec_ttl(struct sk_buff *skb, struct sw_flow_key *key) + return -EHOSTUNREACH; + + key->ip.ttl = --nh->hop_limit; +- } else { ++ } else if (skb->protocol == htons(ETH_P_IP)) { + struct iphdr *nh; + u8 old_ttl; + +-- +2.27.0 + diff --git a/queue-5.10/net-qrtr-fix-port-id-for-control-messages.patch b/queue-5.10/net-qrtr-fix-port-id-for-control-messages.patch new file mode 100644 index 00000000000..4fe3d56ec3a --- /dev/null +++ b/queue-5.10/net-qrtr-fix-port-id-for-control-messages.patch @@ -0,0 +1,37 @@ +From 15c8f2382ae8ff0e236a3da479f8f1b68e08051e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 6 Nov 2020 18:33:26 +0100 +Subject: net: qrtr: Fix port ID for control messages + +From: Loic Poulain + +[ Upstream commit ae068f561baa003d260475c3e441ca454b186726 ] + +The port ID for control messages was uncorrectly set with broadcast +node ID value, causing message to be dropped on remote side since +not passing packet filtering (cb->dst_port != QRTR_PORT_CTRL). + +Fixes: d27e77a3de28 ("net: qrtr: Reset the node and port ID of broadcast messages") +Signed-off-by: Loic Poulain +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/qrtr/qrtr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c +index 957aa9263ba4c..d7134c558993c 100644 +--- a/net/qrtr/qrtr.c ++++ b/net/qrtr/qrtr.c +@@ -347,7 +347,7 @@ static int qrtr_node_enqueue(struct qrtr_node *node, struct sk_buff *skb, + hdr->src_port_id = cpu_to_le32(from->sq_port); + if (to->sq_port == QRTR_PORT_CTRL) { + hdr->dst_node_id = cpu_to_le32(node->nid); +- hdr->dst_port_id = cpu_to_le32(QRTR_NODE_BCAST); ++ hdr->dst_port_id = cpu_to_le32(QRTR_PORT_CTRL); + } else { + hdr->dst_node_id = cpu_to_le32(to->sq_node); + hdr->dst_port_id = cpu_to_le32(to->sq_port); +-- +2.27.0 + diff --git a/queue-5.10/net-sched-fix-miss-init-the-mru-in-qdisc_skb_cb.patch b/queue-5.10/net-sched-fix-miss-init-the-mru-in-qdisc_skb_cb.patch new file mode 100644 index 00000000000..c8f8a8b361f --- /dev/null +++ b/queue-5.10/net-sched-fix-miss-init-the-mru-in-qdisc_skb_cb.patch @@ -0,0 +1,43 @@ +From 6dcdc18b6ca9dbab51612bb78619507141739e6d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 25 Nov 2020 12:01:21 +0800 +Subject: net/sched: fix miss init the mru in qdisc_skb_cb + +From: wenxu + +[ Upstream commit aadaca9e7c392dbf877af8cefb156199f1a67bbe ] + +The mru in the qdisc_skb_cb should be init as 0. Only defrag packets in the +act_ct will set the value. + +Fixes: 038ebb1a713d ("net/sched: act_ct: fix miss set mru for ovs after defrag in act_ct") +Signed-off-by: wenxu +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/core/dev.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/net/core/dev.c b/net/core/dev.c +index da85cb9398693..210d0fce58e17 100644 +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -3867,6 +3867,7 @@ sch_handle_egress(struct sk_buff *skb, int *ret, struct net_device *dev) + return skb; + + /* qdisc_skb_cb(skb)->pkt_len was already set by the caller. */ ++ qdisc_skb_cb(skb)->mru = 0; + mini_qdisc_bstats_cpu_update(miniq, skb); + + switch (tcf_classify(skb, miniq->filter_list, &cl_res, false)) { +@@ -4950,6 +4951,7 @@ sch_handle_ingress(struct sk_buff *skb, struct packet_type **pt_prev, int *ret, + } + + qdisc_skb_cb(skb)->pkt_len = skb->len; ++ qdisc_skb_cb(skb)->mru = 0; + skb->tc_at_ingress = 1; + mini_qdisc_bstats_cpu_update(miniq, skb); + +-- +2.27.0 + diff --git a/queue-5.10/net-sched-incorrect-kconfig-dependencies-on-netfilte.patch b/queue-5.10/net-sched-incorrect-kconfig-dependencies-on-netfilte.patch new file mode 100644 index 00000000000..3067c1a1694 --- /dev/null +++ b/queue-5.10/net-sched-incorrect-kconfig-dependencies-on-netfilte.patch @@ -0,0 +1,59 @@ +From 0016dc7c5829f8418bf0c4c540a231585b2f5451 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 8 Dec 2020 21:47:07 +0100 +Subject: net: sched: incorrect Kconfig dependencies on Netfilter modules + +From: Pablo Neira Ayuso + +[ Upstream commit 102e2c07239c07144d9c7338ec09b9d47f2e5f79 ] + +- NET_ACT_CONNMARK and NET_ACT_CTINFO only require conntrack support. +- NET_ACT_IPT only requires NETFILTER_XTABLES symbols, not + IP_NF_IPTABLES. After this patch, NET_ACT_IPT becomes consistent + with NET_EMATCH_IPT. NET_ACT_IPT dependency on IP_NF_IPTABLES predates + Linux-2.6.12-rc2 (initial git repository build). + +Fixes: 22a5dc0e5e3e ("net: sched: Introduce connmark action") +Fixes: 24ec483cec98 ("net: sched: Introduce act_ctinfo action") +Signed-off-by: Pablo Neira Ayuso +Link: https://lore.kernel.org/r/20201208204707.11268-1-pablo@netfilter.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/sched/Kconfig | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/net/sched/Kconfig b/net/sched/Kconfig +index a3b37d88800eb..d762e89ab74f7 100644 +--- a/net/sched/Kconfig ++++ b/net/sched/Kconfig +@@ -813,7 +813,7 @@ config NET_ACT_SAMPLE + + config NET_ACT_IPT + tristate "IPtables targets" +- depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES ++ depends on NET_CLS_ACT && NETFILTER && NETFILTER_XTABLES + help + Say Y here to be able to invoke iptables targets after successful + classification. +@@ -912,7 +912,7 @@ config NET_ACT_BPF + + config NET_ACT_CONNMARK + tristate "Netfilter Connection Mark Retriever" +- depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES ++ depends on NET_CLS_ACT && NETFILTER + depends on NF_CONNTRACK && NF_CONNTRACK_MARK + help + Say Y here to allow retrieving of conn mark +@@ -924,7 +924,7 @@ config NET_ACT_CONNMARK + + config NET_ACT_CTINFO + tristate "Netfilter Connection Mark Actions" +- depends on NET_CLS_ACT && NETFILTER && IP_NF_IPTABLES ++ depends on NET_CLS_ACT && NETFILTER + depends on NF_CONNTRACK && NF_CONNTRACK_MARK + help + Say Y here to allow transfer of a connmark stored information. +-- +2.27.0 + diff --git a/queue-5.10/series b/queue-5.10/series index 68b0e831a98..dd71c6992af 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -4,3 +4,12 @@ vdpa_sim-store-parsed-mac-address-in-a-buffer.patch vdpa_sim-make-config-generic-and-usable-for-any-device-type.patch vdpa_sim-add-get_config-callback-in-vdpasim_dev_attr.patch ib-isert-add-module-param-to-set-sg_tablesize-for-io.patch +net-qrtr-fix-port-id-for-control-messages.patch +mptcp-skip-to-next-candidate-if-subflow-has-unacked-.patch +net-sched-fix-miss-init-the-mru-in-qdisc_skb_cb.patch +mt76-mt7915-fix-endian-issues.patch +mt76-mt7615-fix-rdd-mcu-cmd-endianness.patch +net-sched-incorrect-kconfig-dependencies-on-netfilte.patch +net-openvswitch-fix-ttl-decrement-exception-action-e.patch +net-bridge-fix-a-warning-when-del-bridge-sysfs.patch +net-fix-proc_fs-init-handling-in-af_packet-and-tls.patch