From: Sasha Levin Date: Wed, 10 Apr 2024 15:57:05 +0000 (-0400) Subject: Fixes for 5.10 X-Git-Tag: v4.19.312~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=df989b74f7ef327557db2f3b346207cda9b5fa16;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/arm64-dts-rockchip-fix-rk3328-hdmi-ports-node.patch b/queue-5.10/arm64-dts-rockchip-fix-rk3328-hdmi-ports-node.patch new file mode 100644 index 00000000000..0c8b72654bd --- /dev/null +++ b/queue-5.10/arm64-dts-rockchip-fix-rk3328-hdmi-ports-node.patch @@ -0,0 +1,49 @@ +From aec1fdb8687f42ac7a3d02567eeec777b4ed9644 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 22:17:08 +0100 +Subject: arm64: dts: rockchip: fix rk3328 hdmi ports node + +From: Johan Jonker + +[ Upstream commit 1d00ba4700d1e0f88ae70d028d2e17e39078fa1c ] + +Fix rk3328 hdmi ports node so that it matches the +rockchip,dw-hdmi.yaml binding. + +Signed-off-by: Johan Jonker +Link: https://lore.kernel.org/r/e5dea3b7-bf84-4474-9530-cc2da3c41104@gmail.com +Signed-off-by: Heiko Stuebner +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/rockchip/rk3328.dtsi | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi +index 72112fe05a5c4..10df6636a6b6c 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi +@@ -732,11 +732,20 @@ hdmi: hdmi@ff3c0000 { + status = "disabled"; + + ports { +- hdmi_in: port { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ hdmi_in: port@0 { ++ reg = <0>; ++ + hdmi_in_vop: endpoint { + remote-endpoint = <&vop_out_hdmi>; + }; + }; ++ ++ hdmi_out: port@1 { ++ reg = <1>; ++ }; + }; + }; + +-- +2.43.0 + diff --git a/queue-5.10/arm64-dts-rockchip-fix-rk3399-hdmi-ports-node.patch b/queue-5.10/arm64-dts-rockchip-fix-rk3399-hdmi-ports-node.patch new file mode 100644 index 00000000000..69184dd758a --- /dev/null +++ b/queue-5.10/arm64-dts-rockchip-fix-rk3399-hdmi-ports-node.patch @@ -0,0 +1,65 @@ +From 02eae99d29d86ef6867e134f9ce0584bcbf7b6b8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 22:17:31 +0100 +Subject: arm64: dts: rockchip: fix rk3399 hdmi ports node + +From: Johan Jonker + +[ Upstream commit f051b6ace7ffcc48d6d1017191f167c0a85799f6 ] + +Fix rk3399 hdmi ports node so that it matches the +rockchip,dw-hdmi.yaml binding. + +Signed-off-by: Johan Jonker +Link: https://lore.kernel.org/r/a6ab6f75-3b80-40b1-bd30-3113e14becdd@gmail.com +Signed-off-by: Heiko Stuebner +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/rockchip/rk3399.dtsi | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi +index 3180f576ed02e..e2515218ff734 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi +@@ -1769,6 +1769,7 @@ simple-audio-card,codec { + hdmi: hdmi@ff940000 { + compatible = "rockchip,rk3399-dw-hdmi"; + reg = <0x0 0xff940000 0x0 0x20000>; ++ reg-io-width = <4>; + interrupts = ; + clocks = <&cru PCLK_HDMI_CTRL>, + <&cru SCLK_HDMI_SFR>, +@@ -1777,13 +1778,16 @@ hdmi: hdmi@ff940000 { + <&cru PLL_VPLL>; + clock-names = "iahb", "isfr", "cec", "grf", "vpll"; + power-domains = <&power RK3399_PD_HDCP>; +- reg-io-width = <4>; + rockchip,grf = <&grf>; + #sound-dai-cells = <0>; + status = "disabled"; + + ports { +- hdmi_in: port { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ hdmi_in: port@0 { ++ reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + +@@ -1796,6 +1800,10 @@ hdmi_in_vopl: endpoint@1 { + remote-endpoint = <&vopl_out_hdmi>; + }; + }; ++ ++ hdmi_out: port@1 { ++ reg = <1>; ++ }; + }; + }; + +-- +2.43.0 + diff --git a/queue-5.10/batman-adv-improve-exception-handling-in-batadv_thro.patch b/queue-5.10/batman-adv-improve-exception-handling-in-batadv_thro.patch new file mode 100644 index 00000000000..a8a822f82a7 --- /dev/null +++ b/queue-5.10/batman-adv-improve-exception-handling-in-batadv_thro.patch @@ -0,0 +1,71 @@ +From f21c3a842cbe852e4e3e703adf28c928de47e26f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 2 Jan 2024 07:52:21 +0100 +Subject: batman-adv: Improve exception handling in batadv_throw_uevent() + +From: Markus Elfring + +[ Upstream commit 5593e9abf1cf2bf096366d8c7fd933bc69d561ce ] + +The kfree() function was called in up to three cases by +the batadv_throw_uevent() function during error handling +even if the passed variable contained a null pointer. +This issue was detected by using the Coccinelle software. + +* Thus adjust jump targets. + +* Reorder kfree() calls at the end. + +Signed-off-by: Markus Elfring +Acked-by: Sven Eckelmann +Signed-off-by: Simon Wunderlich +Signed-off-by: Sasha Levin +--- + net/batman-adv/main.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c +index 9f267b190779f..ac3ebdba83040 100644 +--- a/net/batman-adv/main.c ++++ b/net/batman-adv/main.c +@@ -732,29 +732,31 @@ int batadv_throw_uevent(struct batadv_priv *bat_priv, enum batadv_uev_type type, + "%s%s", BATADV_UEV_TYPE_VAR, + batadv_uev_type_str[type]); + if (!uevent_env[0]) +- goto out; ++ goto report_error; + + uevent_env[1] = kasprintf(GFP_ATOMIC, + "%s%s", BATADV_UEV_ACTION_VAR, + batadv_uev_action_str[action]); + if (!uevent_env[1]) +- goto out; ++ goto free_first_env; + + /* If the event is DEL, ignore the data field */ + if (action != BATADV_UEV_DEL) { + uevent_env[2] = kasprintf(GFP_ATOMIC, + "%s%s", BATADV_UEV_DATA_VAR, data); + if (!uevent_env[2]) +- goto out; ++ goto free_second_env; + } + + ret = kobject_uevent_env(bat_kobj, KOBJ_CHANGE, uevent_env); +-out: +- kfree(uevent_env[0]); +- kfree(uevent_env[1]); + kfree(uevent_env[2]); ++free_second_env: ++ kfree(uevent_env[1]); ++free_first_env: ++ kfree(uevent_env[0]); + + if (ret) ++report_error: + batadv_dbg(BATADV_DBG_BATMAN, bat_priv, + "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n", + batadv_uev_type_str[type], +-- +2.43.0 + diff --git a/queue-5.10/batman-adv-return-directly-after-a-failed-batadv_dat.patch b/queue-5.10/batman-adv-return-directly-after-a-failed-batadv_dat.patch new file mode 100644 index 00000000000..2320da11460 --- /dev/null +++ b/queue-5.10/batman-adv-return-directly-after-a-failed-batadv_dat.patch @@ -0,0 +1,55 @@ +From 8be77f80682c2a81fad3ba80e7c28b9a49ace237 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 2 Jan 2024 07:27:45 +0100 +Subject: batman-adv: Return directly after a failed + batadv_dat_select_candidates() in batadv_dat_forward_data() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Markus Elfring + +[ Upstream commit ffc15626c861f811f9778914be004fcf43810a91 ] + +The kfree() function was called in one case by +the batadv_dat_forward_data() function during error handling +even if the passed variable contained a null pointer. +This issue was detected by using the Coccinelle software. + +* Thus return directly after a batadv_dat_select_candidates() call failed + at the beginning. + +* Delete the label “out” which became unnecessary with this refactoring. + +Signed-off-by: Markus Elfring +Acked-by: Sven Eckelmann +Signed-off-by: Simon Wunderlich +Signed-off-by: Sasha Levin +--- + net/batman-adv/distributed-arp-table.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c +index ddd3b4c70a516..b1cb6ecffceb9 100644 +--- a/net/batman-adv/distributed-arp-table.c ++++ b/net/batman-adv/distributed-arp-table.c +@@ -687,7 +687,7 @@ static bool batadv_dat_forward_data(struct batadv_priv *bat_priv, + + cand = batadv_dat_select_candidates(bat_priv, ip, vid); + if (!cand) +- goto out; ++ return ret; + + batadv_dbg(BATADV_DBG_DAT, bat_priv, "DHT_SEND for %pI4\n", &ip); + +@@ -731,7 +731,6 @@ static bool batadv_dat_forward_data(struct batadv_priv *bat_priv, + batadv_orig_node_put(cand[i].orig_node); + } + +-out: + kfree(cand); + return ret; + } +-- +2.43.0 + diff --git a/queue-5.10/block-prevent-division-by-zero-in-blk_rq_stat_sum.patch b/queue-5.10/block-prevent-division-by-zero-in-blk_rq_stat_sum.patch new file mode 100644 index 00000000000..72f4c5136fa --- /dev/null +++ b/queue-5.10/block-prevent-division-by-zero-in-blk_rq_stat_sum.patch @@ -0,0 +1,40 @@ +From df68959866776a022d7a6a12245e5052d37ce593 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 5 Mar 2024 16:45:09 +0300 +Subject: block: prevent division by zero in blk_rq_stat_sum() + +From: Roman Smirnov + +[ Upstream commit 93f52fbeaf4b676b21acfe42a5152620e6770d02 ] + +The expression dst->nr_samples + src->nr_samples may +have zero value on overflow. It is necessary to add +a check to avoid division by zero. + +Found by Linux Verification Center (linuxtesting.org) with Svace. + +Signed-off-by: Roman Smirnov +Reviewed-by: Sergey Shtylyov +Link: https://lore.kernel.org/r/20240305134509.23108-1-r.smirnov@omp.ru +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + block/blk-stat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/block/blk-stat.c b/block/blk-stat.c +index ae3dd1fb8e61d..6e602f9b966e4 100644 +--- a/block/blk-stat.c ++++ b/block/blk-stat.c +@@ -28,7 +28,7 @@ void blk_rq_stat_init(struct blk_rq_stat *stat) + /* src is a per-cpu stat, mean isn't initialized */ + void blk_rq_stat_sum(struct blk_rq_stat *dst, struct blk_rq_stat *src) + { +- if (!src->nr_samples) ++ if (dst->nr_samples + src->nr_samples <= dst->nr_samples) + return; + + dst->min = min(dst->min, src->min); +-- +2.43.0 + diff --git a/queue-5.10/bluetooth-btintel-fix-null-ptr-deref-in-btintel_read.patch b/queue-5.10/bluetooth-btintel-fix-null-ptr-deref-in-btintel_read.patch new file mode 100644 index 00000000000..8b4b9ad242c --- /dev/null +++ b/queue-5.10/bluetooth-btintel-fix-null-ptr-deref-in-btintel_read.patch @@ -0,0 +1,36 @@ +From 8c56ef7b3d8a5cb775c158f692662b2688efc730 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 18 Jan 2024 12:40:34 +0800 +Subject: Bluetooth: btintel: Fix null ptr deref in btintel_read_version + +From: Edward Adam Davis + +[ Upstream commit b79e040910101b020931ba0c9a6b77e81ab7f645 ] + +If hci_cmd_sync_complete() is triggered and skb is NULL, then +hdev->req_skb is NULL, which will cause this issue. + +Reported-and-tested-by: syzbot+830d9e3fa61968246abd@syzkaller.appspotmail.com +Signed-off-by: Edward Adam Davis +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Sasha Levin +--- + drivers/bluetooth/btintel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c +index 88ce5f0ffc4ba..e1daf6ebd3ada 100644 +--- a/drivers/bluetooth/btintel.c ++++ b/drivers/bluetooth/btintel.c +@@ -344,7 +344,7 @@ int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver) + struct sk_buff *skb; + + skb = __hci_cmd_sync(hdev, 0xfc05, 0, NULL, HCI_CMD_TIMEOUT); +- if (IS_ERR(skb)) { ++ if (IS_ERR_OR_NULL(skb)) { + bt_dev_err(hdev, "Reading Intel version information failed (%ld)", + PTR_ERR(skb)); + return PTR_ERR(skb); +-- +2.43.0 + diff --git a/queue-5.10/btrfs-export-handle-invalid-inode-or-root-reference-.patch b/queue-5.10/btrfs-export-handle-invalid-inode-or-root-reference-.patch new file mode 100644 index 00000000000..2bad71d41ff --- /dev/null +++ b/queue-5.10/btrfs-export-handle-invalid-inode-or-root-reference-.patch @@ -0,0 +1,48 @@ +From 12ed198bd7f763e25056ae6ec47021e45bc163a9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 Jan 2024 21:19:18 +0100 +Subject: btrfs: export: handle invalid inode or root reference in + btrfs_get_parent() + +From: David Sterba + +[ Upstream commit 26b66d1d366a375745755ca7365f67110bbf6bd5 ] + +The get_parent handler looks up a parent of a given dentry, this can be +either a subvolume or a directory. The search is set up with offset -1 +but it's never expected to find such item, as it would break allowed +range of inode number or a root id. This means it's a corruption (ext4 +also returns this error code). + +Reviewed-by: Josef Bacik +Reviewed-by: Anand Jain +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/export.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c +index bfa2bf44529c2..d908afa1f313c 100644 +--- a/fs/btrfs/export.c ++++ b/fs/btrfs/export.c +@@ -161,8 +161,15 @@ struct dentry *btrfs_get_parent(struct dentry *child) + ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); + if (ret < 0) + goto fail; ++ if (ret == 0) { ++ /* ++ * Key with offset of -1 found, there would have to exist an ++ * inode with such number or a root with such id. ++ */ ++ ret = -EUCLEAN; ++ goto fail; ++ } + +- BUG_ON(ret == 0); /* Key with offset of -1 found */ + if (path->slots[0] == 0) { + ret = -ENOENT; + goto fail; +-- +2.43.0 + diff --git a/queue-5.10/btrfs-handle-chunk-tree-lookup-error-in-btrfs_reloca.patch b/queue-5.10/btrfs-handle-chunk-tree-lookup-error-in-btrfs_reloca.patch new file mode 100644 index 00000000000..fb796defeee --- /dev/null +++ b/queue-5.10/btrfs-handle-chunk-tree-lookup-error-in-btrfs_reloca.patch @@ -0,0 +1,56 @@ +From eebd09941f051e3ec848d5e9186e27a868287d09 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 Jan 2024 23:42:29 +0100 +Subject: btrfs: handle chunk tree lookup error in btrfs_relocate_sys_chunks() + +From: David Sterba + +[ Upstream commit 7411055db5ce64f836aaffd422396af0075fdc99 ] + +The unhandled case in btrfs_relocate_sys_chunks() loop is a corruption, +as it could be caused only by two impossible conditions: + +- at first the search key is set up to look for a chunk tree item, with + offset -1, this is an inexact search and the key->offset will contain + the correct offset upon a successful search, a valid chunk tree item + cannot have an offset -1 + +- after first successful search, the found_key corresponds to a chunk + item, the offset is decremented by 1 before the next loop, it's + impossible to find a chunk item there due to alignment and size + constraints + +Reviewed-by: Josef Bacik +Reviewed-by: Anand Jain +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/volumes.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c +index 9a05313c69f33..09c23626feba4 100644 +--- a/fs/btrfs/volumes.c ++++ b/fs/btrfs/volumes.c +@@ -3178,7 +3178,17 @@ static int btrfs_relocate_sys_chunks(struct btrfs_fs_info *fs_info) + mutex_unlock(&fs_info->delete_unused_bgs_mutex); + goto error; + } +- BUG_ON(ret == 0); /* Corruption */ ++ if (ret == 0) { ++ /* ++ * On the first search we would find chunk tree with ++ * offset -1, which is not possible. On subsequent ++ * loops this would find an existing item on an invalid ++ * offset (one less than the previous one, wrong ++ * alignment and size). ++ */ ++ ret = -EUCLEAN; ++ goto error; ++ } + + ret = btrfs_previous_item(chunk_root, path, key.objectid, + key.type); +-- +2.43.0 + diff --git a/queue-5.10/btrfs-send-handle-path-ref-underflow-in-header-itera.patch b/queue-5.10/btrfs-send-handle-path-ref-underflow-in-header-itera.patch new file mode 100644 index 00000000000..5748bcdaef5 --- /dev/null +++ b/queue-5.10/btrfs-send-handle-path-ref-underflow-in-header-itera.patch @@ -0,0 +1,43 @@ +From 51059b8206260fa88c2f8c9c1bbe0aa67be8c0c0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Feb 2024 22:47:13 +0100 +Subject: btrfs: send: handle path ref underflow in header iterate_inode_ref() + +From: David Sterba + +[ Upstream commit 3c6ee34c6f9cd12802326da26631232a61743501 ] + +Change BUG_ON to proper error handling if building the path buffer +fails. The pointers are not printed so we don't accidentally leak kernel +addresses. + +Signed-off-by: David Sterba +Signed-off-by: Sasha Levin +--- + fs/btrfs/send.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c +index 0b04adfd4a4a4..0519a3557697a 100644 +--- a/fs/btrfs/send.c ++++ b/fs/btrfs/send.c +@@ -966,7 +966,15 @@ static int iterate_inode_ref(struct btrfs_root *root, struct btrfs_path *path, + ret = PTR_ERR(start); + goto out; + } +- BUG_ON(start < p->buf); ++ if (unlikely(start < p->buf)) { ++ btrfs_err(root->fs_info, ++ "send: path ref buffer underflow for key (%llu %u %llu)", ++ found_key->objectid, ++ found_key->type, ++ found_key->offset); ++ ret = -EINVAL; ++ goto out; ++ } + } + p->start = start; + } else { +-- +2.43.0 + diff --git a/queue-5.10/drivers-nvme-add-quirks-for-device-126f-2262.patch b/queue-5.10/drivers-nvme-add-quirks-for-device-126f-2262.patch new file mode 100644 index 00000000000..5c4f4e8de13 --- /dev/null +++ b/queue-5.10/drivers-nvme-add-quirks-for-device-126f-2262.patch @@ -0,0 +1,52 @@ +From a50be28e77ff05383f2c237f2ef85e3f89f7c9c8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 16 Mar 2024 03:27:49 +0800 +Subject: drivers/nvme: Add quirks for device 126f:2262 + +From: Jiawei Fu (iBug) + +[ Upstream commit e89086c43f0500bc7c4ce225495b73b8ce234c1f ] + +This commit adds NVME_QUIRK_NO_DEEPEST_PS and NVME_QUIRK_BOGUS_NID for +device [126f:2262], which appears to be a generic VID:PID pair used for +many SSDs based on the Silicon Motion SM2262/SM2262EN controller. + +Two of my SSDs with this VID:PID pair exhibit the same behavior: + + * They frequently have trouble exiting the deepest power state (5), + resulting in the entire disk unresponsive. + Verified by setting nvme_core.default_ps_max_latency_us=10000 and + observing them behaving normally. + * They produce all-zero nguid and eui64 with `nvme id-ns` command. + +The offending products are: + + * HP SSD EX950 1TB + * HIKVISION C2000Pro 2TB + +Signed-off-by: Jiawei Fu +Reviewed-by: Christoph Hellwig +Reviewed-by: Sagi Grimberg +Signed-off-by: Keith Busch +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/pci.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c +index 970a1b374a669..5242feda5471a 100644 +--- a/drivers/nvme/host/pci.c ++++ b/drivers/nvme/host/pci.c +@@ -3199,6 +3199,9 @@ static const struct pci_device_id nvme_id_table[] = { + NVME_QUIRK_BOGUS_NID, }, + { PCI_VDEVICE(REDHAT, 0x0010), /* Qemu emulated controller */ + .driver_data = NVME_QUIRK_BOGUS_NID, }, ++ { PCI_DEVICE(0x126f, 0x2262), /* Silicon Motion generic */ ++ .driver_data = NVME_QUIRK_NO_DEEPEST_PS | ++ NVME_QUIRK_BOGUS_NID, }, + { PCI_DEVICE(0x126f, 0x2263), /* Silicon Motion unidentified */ + .driver_data = NVME_QUIRK_NO_NS_DESC_LIST, }, + { PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */ +-- +2.43.0 + diff --git a/queue-5.10/drm-amd-display-fix-nanosec-stat-overflow.patch b/queue-5.10/drm-amd-display-fix-nanosec-stat-overflow.patch new file mode 100644 index 00000000000..8fe4846eff2 --- /dev/null +++ b/queue-5.10/drm-amd-display-fix-nanosec-stat-overflow.patch @@ -0,0 +1,45 @@ +From eb3350f354ce5776b0bc88ad36302edf42f197c2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 29 Aug 2019 11:53:52 -0400 +Subject: drm/amd/display: Fix nanosec stat overflow + +From: Aric Cyr + +[ Upstream commit 14d68acfd04b39f34eea7bea65dda652e6db5bf6 ] + +[Why] +Nanosec stats can overflow on long running systems potentially causing +statistic logging issues. + +[How] +Use 64bit types for nanosec stats to ensure no overflow. + +Reviewed-by: Rodrigo Siqueira +Tested-by: Daniel Wheeler +Signed-off-by: Aric Cyr +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/display/modules/inc/mod_stats.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/modules/inc/mod_stats.h b/drivers/gpu/drm/amd/display/modules/inc/mod_stats.h +index 4220fd8fdd60c..54cd86060f4d6 100644 +--- a/drivers/gpu/drm/amd/display/modules/inc/mod_stats.h ++++ b/drivers/gpu/drm/amd/display/modules/inc/mod_stats.h +@@ -57,10 +57,10 @@ void mod_stats_update_event(struct mod_stats *mod_stats, + unsigned int length); + + void mod_stats_update_flip(struct mod_stats *mod_stats, +- unsigned long timestamp_in_ns); ++ unsigned long long timestamp_in_ns); + + void mod_stats_update_vupdate(struct mod_stats *mod_stats, +- unsigned long timestamp_in_ns); ++ unsigned long long timestamp_in_ns); + + void mod_stats_update_freesync(struct mod_stats *mod_stats, + unsigned int v_total_min, +-- +2.43.0 + diff --git a/queue-5.10/ext4-add-a-hint-for-block-bitmap-corrupt-state-in-mb.patch b/queue-5.10/ext4-add-a-hint-for-block-bitmap-corrupt-state-in-mb.patch new file mode 100644 index 00000000000..18df6a0544a --- /dev/null +++ b/queue-5.10/ext4-add-a-hint-for-block-bitmap-corrupt-state-in-mb.patch @@ -0,0 +1,44 @@ +From 9b2bbd653b87e93daa9f6c29e8f8df02786c230a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 Jan 2024 14:11:54 +0800 +Subject: ext4: add a hint for block bitmap corrupt state in mb_groups + +From: Zhang Yi + +[ Upstream commit 68ee261fb15457ecb17e3683cb4e6a4792ca5b71 ] + +If one group is marked as block bitmap corrupted, its free blocks cannot +be used and its free count is also deducted from the global +sbi->s_freeclusters_counter. User might be confused about the absent +free space because we can't query the information about corrupted block +groups except unreliable error messages in syslog. So add a hint to show +block bitmap corrupted groups in mb_groups. + +Signed-off-by: Zhang Yi +Reviewed-by: Jan Kara +Link: https://lore.kernel.org/r/20240119061154.1525781-1-yi.zhang@huaweicloud.com +Signed-off-by: Theodore Ts'o +Signed-off-by: Sasha Levin +--- + fs/ext4/mballoc.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c +index 6ce59e2ac2d47..c1d632725c2c0 100644 +--- a/fs/ext4/mballoc.c ++++ b/fs/ext4/mballoc.c +@@ -2591,7 +2591,10 @@ static int ext4_mb_seq_groups_show(struct seq_file *seq, void *v) + for (i = 0; i <= 13; i++) + seq_printf(seq, " %-5u", i <= blocksize_bits + 1 ? + sg.info.bb_counters[i] : 0); +- seq_puts(seq, " ]\n"); ++ seq_puts(seq, " ]"); ++ if (EXT4_MB_GRP_BBITMAP_CORRUPT(&sg.info)) ++ seq_puts(seq, " Block bitmap corrupted!"); ++ seq_puts(seq, "\n"); + + return 0; + } +-- +2.43.0 + diff --git a/queue-5.10/ext4-forbid-commit-inconsistent-quota-data-when-erro.patch b/queue-5.10/ext4-forbid-commit-inconsistent-quota-data-when-erro.patch new file mode 100644 index 00000000000..918e6bfbd6f --- /dev/null +++ b/queue-5.10/ext4-forbid-commit-inconsistent-quota-data-when-erro.patch @@ -0,0 +1,70 @@ +From 6b62378519202052dd5f4b173e492c39bc02daab Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 19 Jan 2024 14:29:08 +0800 +Subject: ext4: forbid commit inconsistent quota data when errors=remount-ro + +From: Ye Bin + +[ Upstream commit d8b945fa475f13d787df00c26a6dc45a3e2e1d1d ] + +There's issue as follows When do IO fault injection test: +Quota error (device dm-3): find_block_dqentry: Quota for id 101 referenced but not present +Quota error (device dm-3): qtree_read_dquot: Can't read quota structure for id 101 +Quota error (device dm-3): do_check_range: Getting block 2021161007 out of range 1-186 +Quota error (device dm-3): qtree_read_dquot: Can't read quota structure for id 661 + +Now, ext4_write_dquot()/ext4_acquire_dquot()/ext4_release_dquot() may commit +inconsistent quota data even if process failed. This may lead to filesystem +corruption. +To ensure filesystem consistent when errors=remount-ro there is need to call +ext4_handle_error() to abort journal. + +Signed-off-by: Ye Bin +Reviewed-by: Jan Kara +Link: https://lore.kernel.org/r/20240119062908.3598806-1-yebin10@huawei.com +Signed-off-by: Theodore Ts'o +Signed-off-by: Sasha Levin +--- + fs/ext4/super.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/fs/ext4/super.c b/fs/ext4/super.c +index e386d67cff9d1..0149d3c2cfd78 100644 +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -6205,6 +6205,10 @@ static int ext4_write_dquot(struct dquot *dquot) + if (IS_ERR(handle)) + return PTR_ERR(handle); + ret = dquot_commit(dquot); ++ if (ret < 0) ++ ext4_error_err(dquot->dq_sb, -ret, ++ "Failed to commit dquot type %d", ++ dquot->dq_id.type); + err = ext4_journal_stop(handle); + if (!ret) + ret = err; +@@ -6221,6 +6225,10 @@ static int ext4_acquire_dquot(struct dquot *dquot) + if (IS_ERR(handle)) + return PTR_ERR(handle); + ret = dquot_acquire(dquot); ++ if (ret < 0) ++ ext4_error_err(dquot->dq_sb, -ret, ++ "Failed to acquire dquot type %d", ++ dquot->dq_id.type); + err = ext4_journal_stop(handle); + if (!ret) + ret = err; +@@ -6240,6 +6248,10 @@ static int ext4_release_dquot(struct dquot *dquot) + return PTR_ERR(handle); + } + ret = dquot_release(dquot); ++ if (ret < 0) ++ ext4_error_err(dquot->dq_sb, -ret, ++ "Failed to release dquot type %d", ++ dquot->dq_id.type); + err = ext4_journal_stop(handle); + if (!ret) + ret = err; +-- +2.43.0 + diff --git a/queue-5.10/fbdev-viafb-fix-typo-in-hw_bitblt_1-and-hw_bitblt_2.patch b/queue-5.10/fbdev-viafb-fix-typo-in-hw_bitblt_1-and-hw_bitblt_2.patch new file mode 100644 index 00000000000..694d18b97f5 --- /dev/null +++ b/queue-5.10/fbdev-viafb-fix-typo-in-hw_bitblt_1-and-hw_bitblt_2.patch @@ -0,0 +1,47 @@ +From a6937776b04e437e810df9bb196bbd23036d06b6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 1 Mar 2024 14:35:43 +0300 +Subject: fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2 + +From: Aleksandr Burakov + +[ Upstream commit bc87bb342f106a0402186bcb588fcbe945dced4b ] + +There are some actions with value 'tmp' but 'dst_addr' is checked instead. +It is obvious that a copy-paste error was made here and the value +of variable 'tmp' should be checked here. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Signed-off-by: Aleksandr Burakov +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/via/accel.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/video/fbdev/via/accel.c b/drivers/video/fbdev/via/accel.c +index 0a1bc7a4d7853..1e04026f08091 100644 +--- a/drivers/video/fbdev/via/accel.c ++++ b/drivers/video/fbdev/via/accel.c +@@ -115,7 +115,7 @@ static int hw_bitblt_1(void __iomem *engine, u8 op, u32 width, u32 height, + + if (op != VIA_BITBLT_FILL) { + tmp = src_mem ? 0 : src_addr; +- if (dst_addr & 0xE0000007) { ++ if (tmp & 0xE0000007) { + printk(KERN_WARNING "hw_bitblt_1: Unsupported source " + "address %X\n", tmp); + return -EINVAL; +@@ -260,7 +260,7 @@ static int hw_bitblt_2(void __iomem *engine, u8 op, u32 width, u32 height, + writel(tmp, engine + 0x18); + + tmp = src_mem ? 0 : src_addr; +- if (dst_addr & 0xE0000007) { ++ if (tmp & 0xE0000007) { + printk(KERN_WARNING "hw_bitblt_2: Unsupported source " + "address %X\n", tmp); + return -EINVAL; +-- +2.43.0 + diff --git a/queue-5.10/fbmon-prevent-division-by-zero-in-fb_videomode_from_.patch b/queue-5.10/fbmon-prevent-division-by-zero-in-fb_videomode_from_.patch new file mode 100644 index 00000000000..0b052ed70bb --- /dev/null +++ b/queue-5.10/fbmon-prevent-division-by-zero-in-fb_videomode_from_.patch @@ -0,0 +1,51 @@ +From d37b1da044a5eb7196a249c3ff6718537d9fcb9b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Mar 2024 11:13:44 +0300 +Subject: fbmon: prevent division by zero in fb_videomode_from_videomode() + +From: Roman Smirnov + +[ Upstream commit c2d953276b8b27459baed1277a4fdd5dd9bd4126 ] + +The expression htotal * vtotal can have a zero value on +overflow. It is necessary to prevent division by zero like in +fb_var_to_videomode(). + +Found by Linux Verification Center (linuxtesting.org) with Svace. + +Signed-off-by: Roman Smirnov +Reviewed-by: Sergey Shtylyov +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/core/fbmon.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c +index 1bf82dbc9e3cf..3c29a5eb43805 100644 +--- a/drivers/video/fbdev/core/fbmon.c ++++ b/drivers/video/fbdev/core/fbmon.c +@@ -1311,7 +1311,7 @@ int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, struct fb_inf + int fb_videomode_from_videomode(const struct videomode *vm, + struct fb_videomode *fbmode) + { +- unsigned int htotal, vtotal; ++ unsigned int htotal, vtotal, total; + + fbmode->xres = vm->hactive; + fbmode->left_margin = vm->hback_porch; +@@ -1344,8 +1344,9 @@ int fb_videomode_from_videomode(const struct videomode *vm, + vtotal = vm->vactive + vm->vfront_porch + vm->vback_porch + + vm->vsync_len; + /* prevent division by zero */ +- if (htotal && vtotal) { +- fbmode->refresh = vm->pixelclock / (htotal * vtotal); ++ total = htotal * vtotal; ++ if (total) { ++ fbmode->refresh = vm->pixelclock / total; + /* a mode must have htotal and vtotal != 0 or it is invalid */ + } else { + fbmode->refresh = 0; +-- +2.43.0 + diff --git a/queue-5.10/input-allocate-keycode-for-display-refresh-rate-togg.patch b/queue-5.10/input-allocate-keycode-for-display-refresh-rate-togg.patch new file mode 100644 index 00000000000..b55717eda31 --- /dev/null +++ b/queue-5.10/input-allocate-keycode-for-display-refresh-rate-togg.patch @@ -0,0 +1,43 @@ +From e724d0e5cb8f701c92be8ce40bde24e15d42609a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 10 Mar 2024 12:31:41 +0100 +Subject: Input: allocate keycode for Display refresh rate toggle +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Gergo Koteles + +[ Upstream commit cfeb98b95fff25c442f78a6f616c627bc48a26b7 ] + +Newer Lenovo Yogas and Legions with 60Hz/90Hz displays send a wmi event +when Fn + R is pressed. This is intended for use to switch between the +two refresh rates. + +Allocate a new KEY_REFRESH_RATE_TOGGLE keycode for it. + +Signed-off-by: Gergo Koteles +Acked-by: Dmitry Torokhov +Link: https://lore.kernel.org/r/15a5d08c84cf4d7b820de34ebbcf8ae2502fb3ca.1710065750.git.soyer@irl.hu +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Sasha Levin +--- + include/uapi/linux/input-event-codes.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h +index 7989d9483ea75..bed20a89c14c1 100644 +--- a/include/uapi/linux/input-event-codes.h ++++ b/include/uapi/linux/input-event-codes.h +@@ -602,6 +602,7 @@ + + #define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ + #define KEY_ROTATE_LOCK_TOGGLE 0x231 /* Display rotation lock */ ++#define KEY_REFRESH_RATE_TOGGLE 0x232 /* Display refresh rate toggle */ + + #define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */ + #define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */ +-- +2.43.0 + diff --git a/queue-5.10/input-synaptics-rmi4-fail-probing-if-memory-allocati.patch b/queue-5.10/input-synaptics-rmi4-fail-probing-if-memory-allocati.patch new file mode 100644 index 00000000000..a7633bf2591 --- /dev/null +++ b/queue-5.10/input-synaptics-rmi4-fail-probing-if-memory-allocati.patch @@ -0,0 +1,42 @@ +From 2c258d357ce76a397e991d1d4be5d8747239bae1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 18 Jan 2024 11:37:59 -0800 +Subject: Input: synaptics-rmi4 - fail probing if memory allocation for "phys" + fails + +From: Kunwu Chan + +[ Upstream commit bc4996184d56cfaf56d3811ac2680c8a0e2af56e ] + +While input core can work with input->phys set to NULL userspace might +depend on it, so better fail probing if allocation fails. The system must +be in a pretty bad shape for it to happen anyway. + +Signed-off-by: Kunwu Chan +Link: https://lore.kernel.org/r/20240117073124.143636-1-chentao@kylinos.cn +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/rmi4/rmi_driver.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c +index 258d5fe3d395c..aa32371f04af6 100644 +--- a/drivers/input/rmi4/rmi_driver.c ++++ b/drivers/input/rmi4/rmi_driver.c +@@ -1196,7 +1196,11 @@ static int rmi_driver_probe(struct device *dev) + } + rmi_driver_set_input_params(rmi_dev, data->input); + data->input->phys = devm_kasprintf(dev, GFP_KERNEL, +- "%s/input0", dev_name(dev)); ++ "%s/input0", dev_name(dev)); ++ if (!data->input->phys) { ++ retval = -ENOMEM; ++ goto err; ++ } + } + + retval = rmi_init_functions(data); +-- +2.43.0 + diff --git a/queue-5.10/ionic-set-adminq-irq-affinity.patch b/queue-5.10/ionic-set-adminq-irq-affinity.patch new file mode 100644 index 00000000000..5684628ca78 --- /dev/null +++ b/queue-5.10/ionic-set-adminq-irq-affinity.patch @@ -0,0 +1,43 @@ +From fbccb7796a20867db4ac082c4c51863de982ba0b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Feb 2024 09:59:01 -0800 +Subject: ionic: set adminq irq affinity + +From: Shannon Nelson + +[ Upstream commit c699f35d658f3c21b69ed24e64b2ea26381e941d ] + +We claim to have the AdminQ on our irq0 and thus cpu id 0, +but we need to be sure we set the affinity hint to try to +keep it there. + +Signed-off-by: Shannon Nelson +Reviewed-by: Brett Creeley +Reviewed-by: Jacob Keller +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index 49c28134ac2cc..a37ca4b1e5665 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -2708,9 +2708,12 @@ static int ionic_lif_adminq_init(struct ionic_lif *lif) + + napi_enable(&qcq->napi); + +- if (qcq->flags & IONIC_QCQ_F_INTR) ++ if (qcq->flags & IONIC_QCQ_F_INTR) { ++ irq_set_affinity_hint(qcq->intr.vector, ++ &qcq->intr.affinity_mask); + ionic_intr_mask(idev->intr_ctrl, qcq->intr.index, + IONIC_INTR_MASK_CLEAR); ++ } + + qcq->flags |= IONIC_QCQ_F_INITED; + +-- +2.43.0 + diff --git a/queue-5.10/isofs-handle-cds-with-bad-root-inode-but-good-joliet.patch b/queue-5.10/isofs-handle-cds-with-bad-root-inode-but-good-joliet.patch new file mode 100644 index 00000000000..462c853da27 --- /dev/null +++ b/queue-5.10/isofs-handle-cds-with-bad-root-inode-but-good-joliet.patch @@ -0,0 +1,60 @@ +From 299228c9538ed0e93aea5834aa57696316a270f9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 7 Feb 2024 19:21:32 -0700 +Subject: isofs: handle CDs with bad root inode but good Joliet root directory + +From: Alex Henrie + +[ Upstream commit 4243bf80c79211a8ca2795401add9c4a3b1d37ca ] + +I have a CD copy of the original Tom Clancy's Ghost Recon game from +2001. The disc mounts without error on Windows, but on Linux mounting +fails with the message "isofs_fill_super: get root inode failed". The +error originates in isofs_read_inode, which returns -EIO because de_len +is 0. The superblock on this disc appears to be intentionally corrupt as +a form of copy protection. + +When the root inode is unusable, instead of giving up immediately, try +to continue with the Joliet file table. This fixes the Ghost Recon CD +and probably other copy-protected CDs too. + +Signed-off-by: Alex Henrie +Signed-off-by: Jan Kara +Message-Id: <20240208022134.451490-1-alexhenrie24@gmail.com> +Signed-off-by: Sasha Levin +--- + fs/isofs/inode.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c +index f62b5a5015668..4c763f573faf3 100644 +--- a/fs/isofs/inode.c ++++ b/fs/isofs/inode.c +@@ -907,8 +907,22 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent) + * we then decide whether to use the Joliet descriptor. + */ + inode = isofs_iget(s, sbi->s_firstdatazone, 0); +- if (IS_ERR(inode)) +- goto out_no_root; ++ ++ /* ++ * Fix for broken CDs with a corrupt root inode but a correct Joliet ++ * root directory. ++ */ ++ if (IS_ERR(inode)) { ++ if (joliet_level && sbi->s_firstdatazone != first_data_zone) { ++ printk(KERN_NOTICE ++ "ISOFS: root inode is unusable. " ++ "Disabling Rock Ridge and switching to Joliet."); ++ sbi->s_rock = 0; ++ inode = NULL; ++ } else { ++ goto out_no_root; ++ } ++ } + + /* + * Fix for broken CDs with Rock Ridge and empty ISO root directory but +-- +2.43.0 + diff --git a/queue-5.10/ktest-force-buildonly-1-for-make_warnings_file-test-.patch b/queue-5.10/ktest-force-buildonly-1-for-make_warnings_file-test-.patch new file mode 100644 index 00000000000..ac3c8469316 --- /dev/null +++ b/queue-5.10/ktest-force-buildonly-1-for-make_warnings_file-test-.patch @@ -0,0 +1,41 @@ +From 137640e1dc932a5b38ff529229dc23f8c44beca3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 15 Mar 2024 12:28:08 -0300 +Subject: ktest: force $buildonly = 1 for 'make_warnings_file' test type + +From: Ricardo B. Marliere + +[ Upstream commit 07283c1873a4d0eaa0e822536881bfdaea853910 ] + +The test type "make_warnings_file" should have no mandatory configuration +parameters other than the ones required by the "build" test type, because +its purpose is to create a file with build warnings that may or may not be +used by other subsequent tests. Currently, the only way to use it as a +stand-alone test is by setting POWER_CYCLE, CONSOLE, SSH_USER, +BUILD_TARGET, TARGET_IMAGE, REBOOT_TYPE and GRUB_MENU. + +Link: https://lkml.kernel.org/r/20240315-ktest-v2-1-c5c20a75f6a3@marliere.net + +Cc: John Hawley +Signed-off-by: Ricardo B. Marliere +Signed-off-by: Steven Rostedt +Signed-off-by: Sasha Levin +--- + tools/testing/ktest/ktest.pl | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl +index ea26f2b0c1bc2..f72da30795dd6 100755 +--- a/tools/testing/ktest/ktest.pl ++++ b/tools/testing/ktest/ktest.pl +@@ -773,6 +773,7 @@ sub set_value { + if ($lvalue =~ /^(TEST|BISECT|CONFIG_BISECT)_TYPE(\[.*\])?$/ && + $prvalue !~ /^(config_|)bisect$/ && + $prvalue !~ /^build$/ && ++ $prvalue !~ /^make_warnings_file$/ && + $buildonly) { + + # Note if a test is something other than build, then we +-- +2.43.0 + diff --git a/queue-5.10/libperf-evlist-avoid-out-of-bounds-access.patch b/queue-5.10/libperf-evlist-avoid-out-of-bounds-access.patch new file mode 100644 index 00000000000..2164238541e --- /dev/null +++ b/queue-5.10/libperf-evlist-avoid-out-of-bounds-access.patch @@ -0,0 +1,125 @@ +From 13b070e22c4366652d1661cf590757b89e75c701 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Feb 2024 23:07:57 -0800 +Subject: libperf evlist: Avoid out-of-bounds access + +From: Ian Rogers + +[ Upstream commit 1947b92464c3268381604bbe2ac977a3fd78192f ] + +Parallel testing appears to show a race between allocating and setting +evsel ids. As there is a bounds check on the xyarray it yields a segv +like: + +``` +AddressSanitizer:DEADLYSIGNAL + +================================================================= + +==484408==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 + +==484408==The signal is caused by a WRITE memory access. + +==484408==Hint: address points to the zero page. + + #0 0x55cef5d4eff4 in perf_evlist__id_hash tools/lib/perf/evlist.c:256 + #1 0x55cef5d4f132 in perf_evlist__id_add tools/lib/perf/evlist.c:274 + #2 0x55cef5d4f545 in perf_evlist__id_add_fd tools/lib/perf/evlist.c:315 + #3 0x55cef5a1923f in store_evsel_ids util/evsel.c:3130 + #4 0x55cef5a19400 in evsel__store_ids util/evsel.c:3147 + #5 0x55cef5888204 in __run_perf_stat tools/perf/builtin-stat.c:832 + #6 0x55cef5888c06 in run_perf_stat tools/perf/builtin-stat.c:960 + #7 0x55cef58932db in cmd_stat tools/perf/builtin-stat.c:2878 +... +``` + +Avoid this crash by early exiting the perf_evlist__id_add_fd and +perf_evlist__id_add is the access is out-of-bounds. + +Signed-off-by: Ian Rogers +Cc: Yang Jihong +Signed-off-by: Namhyung Kim +Link: https://lore.kernel.org/r/20240229070757.796244-1-irogers@google.com +Signed-off-by: Sasha Levin +--- + tools/lib/perf/evlist.c | 18 ++++++++++++------ + tools/lib/perf/include/internal/evlist.h | 4 ++-- + 2 files changed, 14 insertions(+), 8 deletions(-) + +diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c +index f76b1a9d5a6e1..53cff32b2cb80 100644 +--- a/tools/lib/perf/evlist.c ++++ b/tools/lib/perf/evlist.c +@@ -226,10 +226,10 @@ u64 perf_evlist__read_format(struct perf_evlist *evlist) + + static void perf_evlist__id_hash(struct perf_evlist *evlist, + struct perf_evsel *evsel, +- int cpu, int thread, u64 id) ++ int cpu_map_idx, int thread, u64 id) + { + int hash; +- struct perf_sample_id *sid = SID(evsel, cpu, thread); ++ struct perf_sample_id *sid = SID(evsel, cpu_map_idx, thread); + + sid->id = id; + sid->evsel = evsel; +@@ -239,21 +239,27 @@ static void perf_evlist__id_hash(struct perf_evlist *evlist, + + void perf_evlist__id_add(struct perf_evlist *evlist, + struct perf_evsel *evsel, +- int cpu, int thread, u64 id) ++ int cpu_map_idx, int thread, u64 id) + { +- perf_evlist__id_hash(evlist, evsel, cpu, thread, id); ++ if (!SID(evsel, cpu_map_idx, thread)) ++ return; ++ ++ perf_evlist__id_hash(evlist, evsel, cpu_map_idx, thread, id); + evsel->id[evsel->ids++] = id; + } + + int perf_evlist__id_add_fd(struct perf_evlist *evlist, + struct perf_evsel *evsel, +- int cpu, int thread, int fd) ++ int cpu_map_idx, int thread, int fd) + { + u64 read_data[4] = { 0, }; + int id_idx = 1; /* The first entry is the counter value */ + u64 id; + int ret; + ++ if (!SID(evsel, cpu_map_idx, thread)) ++ return -1; ++ + ret = ioctl(fd, PERF_EVENT_IOC_ID, &id); + if (!ret) + goto add; +@@ -282,7 +288,7 @@ int perf_evlist__id_add_fd(struct perf_evlist *evlist, + id = read_data[id_idx]; + + add: +- perf_evlist__id_add(evlist, evsel, cpu, thread, id); ++ perf_evlist__id_add(evlist, evsel, cpu_map_idx, thread, id); + return 0; + } + +diff --git a/tools/lib/perf/include/internal/evlist.h b/tools/lib/perf/include/internal/evlist.h +index 2d0fa02b036f6..8999f2cc8ee44 100644 +--- a/tools/lib/perf/include/internal/evlist.h ++++ b/tools/lib/perf/include/internal/evlist.h +@@ -118,10 +118,10 @@ u64 perf_evlist__read_format(struct perf_evlist *evlist); + + void perf_evlist__id_add(struct perf_evlist *evlist, + struct perf_evsel *evsel, +- int cpu, int thread, u64 id); ++ int cpu_map_idx, int thread, u64 id); + + int perf_evlist__id_add_fd(struct perf_evlist *evlist, + struct perf_evsel *evsel, +- int cpu, int thread, int fd); ++ int cpu_map_idx, int thread, int fd); + + #endif /* __LIBPERF_INTERNAL_EVLIST_H */ +-- +2.43.0 + diff --git a/queue-5.10/media-sta2x11-fix-irq-handler-cast.patch b/queue-5.10/media-sta2x11-fix-irq-handler-cast.patch new file mode 100644 index 00000000000..4bef48b04b1 --- /dev/null +++ b/queue-5.10/media-sta2x11-fix-irq-handler-cast.patch @@ -0,0 +1,62 @@ +From db6a6284286bbbe40816a686a89ea98c0c254072 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 10:54:47 +0100 +Subject: media: sta2x11: fix irq handler cast + +From: Arnd Bergmann + +[ Upstream commit 3de49ae81c3a0f83a554ecbce4c08e019f30168e ] + +clang-16 warns about casting incompatible function pointers: + +drivers/media/pci/sta2x11/sta2x11_vip.c:1057:6: error: cast from 'irqreturn_t (*)(int, struct sta2x11_vip *)' (aka 'enum irqreturn (*)(int, struct sta2x11_vip *)') to 'irq_handler_t' (aka 'enum irqreturn (*)(int, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] + +Change the prototype of the irq handler to the regular version with a +local variable to adjust the argument type. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Hans Verkuil +[hverkuil: update argument documentation] +Signed-off-by: Sasha Levin +--- + drivers/media/pci/sta2x11/sta2x11_vip.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c +index 336df65c8af11..01ca940aecc2d 100644 +--- a/drivers/media/pci/sta2x11/sta2x11_vip.c ++++ b/drivers/media/pci/sta2x11/sta2x11_vip.c +@@ -760,7 +760,7 @@ static const struct video_device video_dev_template = { + /** + * vip_irq - interrupt routine + * @irq: Number of interrupt ( not used, correct number is assumed ) +- * @vip: local data structure containing all information ++ * @data: local data structure containing all information + * + * check for both frame interrupts set ( top and bottom ). + * check FIFO overflow, but limit number of log messages after open. +@@ -770,8 +770,9 @@ static const struct video_device video_dev_template = { + * + * IRQ_HANDLED, interrupt done. + */ +-static irqreturn_t vip_irq(int irq, struct sta2x11_vip *vip) ++static irqreturn_t vip_irq(int irq, void *data) + { ++ struct sta2x11_vip *vip = data; + unsigned int status; + + status = reg_read(vip, DVP_ITS); +@@ -1053,9 +1054,7 @@ static int sta2x11_vip_init_one(struct pci_dev *pdev, + + spin_lock_init(&vip->slock); + +- ret = request_irq(pdev->irq, +- (irq_handler_t) vip_irq, +- IRQF_SHARED, KBUILD_MODNAME, vip); ++ ret = request_irq(pdev->irq, vip_irq, IRQF_SHARED, KBUILD_MODNAME, vip); + if (ret) { + dev_err(&pdev->dev, "request_irq failed\n"); + ret = -ENODEV; +-- +2.43.0 + diff --git a/queue-5.10/net-smc-reduce-rtnl-pressure-in-smc_pnet_create_pnet.patch b/queue-5.10/net-smc-reduce-rtnl-pressure-in-smc_pnet_create_pnet.patch new file mode 100644 index 00000000000..f7d1de9b836 --- /dev/null +++ b/queue-5.10/net-smc-reduce-rtnl-pressure-in-smc_pnet_create_pnet.patch @@ -0,0 +1,96 @@ +From 90b467e8eb0ed366ed3ded703dcebdfa68c6fbc2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 2 Mar 2024 10:07:44 +0000 +Subject: net/smc: reduce rtnl pressure in smc_pnet_create_pnetids_list() + +From: Eric Dumazet + +[ Upstream commit 00af2aa93b76b1bade471ad0d0525d4d29ca5cc0 ] + +Many syzbot reports show extreme rtnl pressure, and many of them hint +that smc acquires rtnl in netns creation for no good reason [1] + +This patch returns early from smc_pnet_net_init() +if there is no netdevice yet. + +I am not even sure why smc_pnet_create_pnetids_list() even exists, +because smc_pnet_netdev_event() is also calling +smc_pnet_add_base_pnetid() when handling NETDEV_UP event. + +[1] extract of typical syzbot reports + +2 locks held by syz-executor.3/12252: + #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491 + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline] + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878 +2 locks held by syz-executor.4/12253: + #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491 + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline] + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878 +2 locks held by syz-executor.1/12257: + #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491 + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline] + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878 +2 locks held by syz-executor.2/12261: + #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491 + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline] + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878 +2 locks held by syz-executor.0/12265: + #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491 + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline] + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878 +2 locks held by syz-executor.3/12268: + #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491 + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline] + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878 +2 locks held by syz-executor.4/12271: + #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491 + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline] + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878 +2 locks held by syz-executor.1/12274: + #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491 + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline] + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878 +2 locks held by syz-executor.2/12280: + #0: ffffffff8f369610 (pernet_ops_rwsem){++++}-{3:3}, at: copy_net_ns+0x4c7/0x7b0 net/core/net_namespace.c:491 + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_create_pnetids_list net/smc/smc_pnet.c:809 [inline] + #1: ffffffff8f375b88 (rtnl_mutex){+.+.}-{3:3}, at: smc_pnet_net_init+0x10a/0x1e0 net/smc/smc_pnet.c:878 + +Signed-off-by: Eric Dumazet +Cc: Wenjia Zhang +Cc: Jan Karcher +Cc: "D. Wythe" +Cc: Tony Lu +Cc: Wen Gu +Reviewed-by: Wenjia Zhang +Link: https://lore.kernel.org/r/20240302100744.3868021-1-edumazet@google.com +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + net/smc/smc_pnet.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c +index 30bae60d626c6..ed9cfa11b589f 100644 +--- a/net/smc/smc_pnet.c ++++ b/net/smc/smc_pnet.c +@@ -797,6 +797,16 @@ static void smc_pnet_create_pnetids_list(struct net *net) + u8 ndev_pnetid[SMC_MAX_PNETID_LEN]; + struct net_device *dev; + ++ /* Newly created netns do not have devices. ++ * Do not even acquire rtnl. ++ */ ++ if (list_empty(&net->dev_base_head)) ++ return; ++ ++ /* Note: This might not be needed, because smc_pnet_netdev_event() ++ * is also calling smc_pnet_add_base_pnetid() when handling ++ * NETDEV_UP event. ++ */ + rtnl_lock(); + for_each_netdev(net, dev) + smc_pnet_add_base_pnetid(net, dev, ndev_pnetid); +-- +2.43.0 + diff --git a/queue-5.10/netfilter-nf_tables-discard-table-flag-update-with-p.patch b/queue-5.10/netfilter-nf_tables-discard-table-flag-update-with-p.patch new file mode 100644 index 00000000000..7eef48d3c3e --- /dev/null +++ b/queue-5.10/netfilter-nf_tables-discard-table-flag-update-with-p.patch @@ -0,0 +1,63 @@ +From f191d12b3e5d7a98d183efc28396ee3358f25b45 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Apr 2024 23:20:42 +0200 +Subject: netfilter: nf_tables: discard table flag update with pending + basechain deletion + +From: Pablo Neira Ayuso + +commit 1bc83a019bbe268be3526406245ec28c2458a518 upstream. + +Hook unregistration is deferred to the commit phase, same occurs with +hook updates triggered by the table dormant flag. When both commands are +combined, this results in deleting a basechain while leaving its hook +still registered in the core. + +Fixes: 179d9ba5559a ("netfilter: nf_tables: fix table flag updates") +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Sasha Levin +--- + net/netfilter/nf_tables_api.c | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c +index ef271628975a9..ab7f7e45b9846 100644 +--- a/net/netfilter/nf_tables_api.c ++++ b/net/netfilter/nf_tables_api.c +@@ -1084,6 +1084,24 @@ static void nf_tables_table_disable(struct net *net, struct nft_table *table) + #define __NFT_TABLE_F_UPDATE (__NFT_TABLE_F_WAS_DORMANT | \ + __NFT_TABLE_F_WAS_AWAKEN) + ++static bool nft_table_pending_update(const struct nft_ctx *ctx) ++{ ++ struct nftables_pernet *nft_net = net_generic(ctx->net, nf_tables_net_id); ++ struct nft_trans *trans; ++ ++ if (ctx->table->flags & __NFT_TABLE_F_UPDATE) ++ return true; ++ ++ list_for_each_entry(trans, &nft_net->commit_list, list) { ++ if (trans->ctx.table == ctx->table && ++ trans->msg_type == NFT_MSG_DELCHAIN && ++ nft_is_base_chain(trans->ctx.chain)) ++ return true; ++ } ++ ++ return false; ++} ++ + static int nf_tables_updtable(struct nft_ctx *ctx) + { + struct nft_trans *trans; +@@ -1101,7 +1119,7 @@ static int nf_tables_updtable(struct nft_ctx *ctx) + return 0; + + /* No dormant off/on/off/on games in single transaction */ +- if (ctx->table->flags & __NFT_TABLE_F_UPDATE) ++ if (nft_table_pending_update(ctx)) + return -EINVAL; + + trans = nft_trans_alloc(ctx, NFT_MSG_NEWTABLE, +-- +2.43.0 + diff --git a/queue-5.10/netfilter-nf_tables-release-batch-on-table-validatio.patch b/queue-5.10/netfilter-nf_tables-release-batch-on-table-validatio.patch new file mode 100644 index 00000000000..42a95a69753 --- /dev/null +++ b/queue-5.10/netfilter-nf_tables-release-batch-on-table-validatio.patch @@ -0,0 +1,84 @@ +From fcb65b0248c60470dc5a6444fd47287f5b595a17 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Apr 2024 23:20:40 +0200 +Subject: netfilter: nf_tables: release batch on table validation from abort + path + +From: Pablo Neira Ayuso + +commit a45e6889575c2067d3c0212b6bc1022891e65b91 upstream. + +Unlike early commit path stage which triggers a call to abort, an +explicit release of the batch is required on abort, otherwise mutex is +released and commit_list remains in place. + +Add WARN_ON_ONCE to ensure commit_list is empty from the abort path +before releasing the mutex. + +After this patch, commit_list is always assumed to be empty before +grabbing the mutex, therefore + + 03c1f1ef1584 ("netfilter: Cleanup nft_net->module_list from nf_tables_exit_net()") + +only needs to release the pending modules for registration. + +Cc: stable@vger.kernel.org +Fixes: c0391b6ab810 ("netfilter: nf_tables: missing validation from the abort path") +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Sasha Levin +--- + net/netfilter/nf_tables_api.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c +index dd440d7910a62..6c5de620da9f1 100644 +--- a/net/netfilter/nf_tables_api.c ++++ b/net/netfilter/nf_tables_api.c +@@ -8800,10 +8800,11 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action) + struct nft_trans *trans, *next; + LIST_HEAD(set_update_list); + struct nft_trans_elem *te; ++ int err = 0; + + if (action == NFNL_ABORT_VALIDATE && + nf_tables_validate(net) < 0) +- return -EAGAIN; ++ err = -EAGAIN; + + list_for_each_entry_safe_reverse(trans, next, &nft_net->commit_list, + list) { +@@ -8968,7 +8969,7 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action) + else + nf_tables_module_autoload_cleanup(net); + +- return 0; ++ return err; + } + + static int nf_tables_abort(struct net *net, struct sk_buff *skb, +@@ -8982,6 +8983,8 @@ static int nf_tables_abort(struct net *net, struct sk_buff *skb, + ret = __nf_tables_abort(net, action); + nft_gc_seq_end(nft_net, gc_seq); + ++ WARN_ON_ONCE(!list_empty(&nft_net->commit_list)); ++ + mutex_unlock(&nft_net->commit_mutex); + + return ret; +@@ -9716,8 +9719,11 @@ static void __net_exit nf_tables_exit_net(struct net *net) + + gc_seq = nft_gc_seq_begin(nft_net); + +- if (!list_empty(&nft_net->commit_list)) +- __nf_tables_abort(net, NFNL_ABORT_NONE); ++ WARN_ON_ONCE(!list_empty(&nft_net->commit_list)); ++ ++ if (!list_empty(&nft_net->module_list)) ++ nf_tables_module_autoload_cleanup(net); ++ + __nft_release_tables(net); + + nft_gc_seq_end(nft_net, gc_seq); +-- +2.43.0 + diff --git a/queue-5.10/netfilter-nf_tables-release-mutex-after-nft_gc_seq_e.patch b/queue-5.10/netfilter-nf_tables-release-mutex-after-nft_gc_seq_e.patch new file mode 100644 index 00000000000..91700c8d24f --- /dev/null +++ b/queue-5.10/netfilter-nf_tables-release-mutex-after-nft_gc_seq_e.patch @@ -0,0 +1,62 @@ +From a5b1156502393a2ea3e5d12b2fd693e5f2ba2c24 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Apr 2024 23:20:41 +0200 +Subject: netfilter: nf_tables: release mutex after nft_gc_seq_end from abort + path + +From: Pablo Neira Ayuso + +commit 0d459e2ffb541841714839e8228b845458ed3b27 upstream. + +The commit mutex should not be released during the critical section +between nft_gc_seq_begin() and nft_gc_seq_end(), otherwise, async GC +worker could collect expired objects and get the released commit lock +within the same GC sequence. + +nf_tables_module_autoload() temporarily releases the mutex to load +module dependencies, then it goes back to replay the transaction again. +Move it at the end of the abort phase after nft_gc_seq_end() is called. + +Cc: stable@vger.kernel.org +Fixes: 720344340fb9 ("netfilter: nf_tables: GC transaction race with abort path") +Reported-by: Kuan-Ting Chen +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Sasha Levin +--- + net/netfilter/nf_tables_api.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c +index 6c5de620da9f1..ef271628975a9 100644 +--- a/net/netfilter/nf_tables_api.c ++++ b/net/netfilter/nf_tables_api.c +@@ -8964,11 +8964,6 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action) + nf_tables_abort_release(trans); + } + +- if (action == NFNL_ABORT_AUTOLOAD) +- nf_tables_module_autoload(net); +- else +- nf_tables_module_autoload_cleanup(net); +- + return err; + } + +@@ -8985,6 +8980,14 @@ static int nf_tables_abort(struct net *net, struct sk_buff *skb, + + WARN_ON_ONCE(!list_empty(&nft_net->commit_list)); + ++ /* module autoload needs to happen after GC sequence update because it ++ * temporarily releases and grabs mutex again. ++ */ ++ if (action == NFNL_ABORT_AUTOLOAD) ++ nf_tables_module_autoload(net); ++ else ++ nf_tables_module_autoload_cleanup(net); ++ + mutex_unlock(&nft_net->commit_mutex); + + return ret; +-- +2.43.0 + diff --git a/queue-5.10/panic-flush-kernel-log-buffer-at-the-end.patch b/queue-5.10/panic-flush-kernel-log-buffer-at-the-end.patch new file mode 100644 index 00000000000..ef041333e81 --- /dev/null +++ b/queue-5.10/panic-flush-kernel-log-buffer-at-the-end.patch @@ -0,0 +1,50 @@ +From 38fb2a0935d5bd93c8115388c4b7006bd9a602a2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 7 Feb 2024 14:47:02 +0106 +Subject: panic: Flush kernel log buffer at the end + +From: John Ogness + +[ Upstream commit d988d9a9b9d180bfd5c1d353b3b176cb90d6861b ] + +If the kernel crashes in a context where printk() calls always +defer printing (such as in NMI or inside a printk_safe section) +then the final panic messages will be deferred to irq_work. But +if irq_work is not available, the messages will not get printed +unless explicitly flushed. The result is that the final +"end Kernel panic" banner does not get printed. + +Add one final flush after the last printk() call to make sure +the final panic messages make it out as well. + +Signed-off-by: John Ogness +Reviewed-by: Petr Mladek +Link: https://lore.kernel.org/r/20240207134103.1357162-14-john.ogness@linutronix.de +Signed-off-by: Petr Mladek +Signed-off-by: Sasha Levin +--- + kernel/panic.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/kernel/panic.c b/kernel/panic.c +index bc39e2b27d315..30d8da0d43d8f 100644 +--- a/kernel/panic.c ++++ b/kernel/panic.c +@@ -427,6 +427,14 @@ void panic(const char *fmt, ...) + + /* Do not scroll important messages printed above */ + suppress_printk = 1; ++ ++ /* ++ * The final messages may not have been printed if in a context that ++ * defers printing (such as NMI) and irq_work is not available. ++ * Explicitly flush the kernel log buffer one last time. ++ */ ++ console_flush_on_panic(CONSOLE_FLUSH_PENDING); ++ + local_irq_enable(); + for (i = 0; ; i += PANIC_TIMER_STEP) { + touch_softlockup_watchdog(); +-- +2.43.0 + diff --git a/queue-5.10/pinctrl-renesas-checker-limit-cfg-reg-enum-checks-to.patch b/queue-5.10/pinctrl-renesas-checker-limit-cfg-reg-enum-checks-to.patch new file mode 100644 index 00000000000..2d83f65a543 --- /dev/null +++ b/queue-5.10/pinctrl-renesas-checker-limit-cfg-reg-enum-checks-to.patch @@ -0,0 +1,49 @@ +From 710363145b6f3ec1e50b2f8f5d724b7d82ef8c74 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 22 Jan 2024 14:43:38 +0100 +Subject: pinctrl: renesas: checker: Limit cfg reg enum checks to provided IDs + +From: Geert Uytterhoeven + +[ Upstream commit 3803584a4e9b65bb5b013f862f55c5055aa86c25 ] + +If the number of provided enum IDs in a variable width config register +description does not match the expected number, the checker uses the +expected number for validating the individual enum IDs. + +However, this may cause out-of-bounds accesses on the array holding the +enum IDs, leading to bogus enum_id conflict warnings. Worse, if the bug +is an incorrect bit field description (e.g. accidentally using "12" +instead of "-12" for a reserved field), thousands of warnings may be +printed, overflowing the kernel log buffer. + +Fix this by limiting the enum ID check to the number of provided enum +IDs. + +Signed-off-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/c7385f44f2faebb8856bcbb4e908d846fc1531fb.1705930809.git.geert+renesas@glider.be +Signed-off-by: Sasha Levin +--- + drivers/pinctrl/renesas/core.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/pinctrl/renesas/core.c b/drivers/pinctrl/renesas/core.c +index 54f1a7334027a..c390854483680 100644 +--- a/drivers/pinctrl/renesas/core.c ++++ b/drivers/pinctrl/renesas/core.c +@@ -868,9 +868,11 @@ static void __init sh_pfc_check_cfg_reg(const char *drvname, + sh_pfc_err("reg 0x%x: var_field_width declares %u instead of %u bits\n", + cfg_reg->reg, rw, cfg_reg->reg_width); + +- if (n != cfg_reg->nr_enum_ids) ++ if (n != cfg_reg->nr_enum_ids) { + sh_pfc_err("reg 0x%x: enum_ids[] has %u instead of %u values\n", + cfg_reg->reg, cfg_reg->nr_enum_ids, n); ++ n = cfg_reg->nr_enum_ids; ++ } + + check_enum_ids: + sh_pfc_check_reg_enums(drvname, cfg_reg->reg, cfg_reg->enum_ids, n); +-- +2.43.0 + diff --git a/queue-5.10/platform-x86-touchscreen_dmi-add-an-extra-entry-for-.patch b/queue-5.10/platform-x86-touchscreen_dmi-add-an-extra-entry-for-.patch new file mode 100644 index 00000000000..25581f2db1e --- /dev/null +++ b/queue-5.10/platform-x86-touchscreen_dmi-add-an-extra-entry-for-.patch @@ -0,0 +1,45 @@ +From b3561e143ff4f27367b0ed9b11b0dd47b5aaf8c9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 27 Feb 2024 22:40:17 +0000 +Subject: platform/x86: touchscreen_dmi: Add an extra entry for a variant of + the Chuwi Vi8 tablet +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alban Boyé + +[ Upstream commit 1266e2efb7512dbf20eac820ca2ed34de6b1c3e7 ] + +Signed-off-by: Alban Boyé +Link: https://lore.kernel.org/r/20240227223919.11587-1-alban.boye@protonmail.com +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/touchscreen_dmi.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c +index ebe959db1eeb9..fbaa618594628 100644 +--- a/drivers/platform/x86/touchscreen_dmi.c ++++ b/drivers/platform/x86/touchscreen_dmi.c +@@ -1084,6 +1084,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = { + DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.D86JLBNR"), + }, + }, ++ { ++ /* Chuwi Vi8 dual-boot (CWI506) */ ++ .driver_data = (void *)&chuwi_vi8_data, ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Insyde"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "i86"), ++ DMI_MATCH(DMI_BIOS_VERSION, "CHUWI2.D86JHBNR02"), ++ }, ++ }, + { + /* Chuwi Vi8 Plus (CWI519) */ + .driver_data = (void *)&chuwi_vi8_plus_data, +-- +2.43.0 + diff --git a/queue-5.10/pstore-zone-add-a-null-pointer-check-to-the-psz_kmsg.patch b/queue-5.10/pstore-zone-add-a-null-pointer-check-to-the-psz_kmsg.patch new file mode 100644 index 00000000000..6e2610bf80e --- /dev/null +++ b/queue-5.10/pstore-zone-add-a-null-pointer-check-to-the-psz_kmsg.patch @@ -0,0 +1,37 @@ +From 526dde9e175cffd603c28e5931a293a02cbf439c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 18 Jan 2024 18:02:06 +0800 +Subject: pstore/zone: Add a null pointer check to the psz_kmsg_read + +From: Kunwu Chan + +[ Upstream commit 98bc7e26e14fbb26a6abf97603d59532475e97f8 ] + +kasprintf() returns a pointer to dynamically allocated memory +which can be NULL upon failure. Ensure the allocation was successful +by checking the pointer validity. + +Signed-off-by: Kunwu Chan +Link: https://lore.kernel.org/r/20240118100206.213928-1-chentao@kylinos.cn +Signed-off-by: Kees Cook +Signed-off-by: Sasha Levin +--- + fs/pstore/zone.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c +index b50fc33f2ab29..2426fb6794fd3 100644 +--- a/fs/pstore/zone.c ++++ b/fs/pstore/zone.c +@@ -973,6 +973,8 @@ static ssize_t psz_kmsg_read(struct pstore_zone *zone, + char *buf = kasprintf(GFP_KERNEL, "%s: Total %d times\n", + kmsg_dump_reason_str(record->reason), + record->count); ++ if (!buf) ++ return -ENOMEM; + hlen = strlen(buf); + record->buf = krealloc(buf, hlen + size, GFP_KERNEL); + if (!record->buf) { +-- +2.43.0 + diff --git a/queue-5.10/rdma-cm-add-timeout-to-cm_destroy_id-wait.patch b/queue-5.10/rdma-cm-add-timeout-to-cm_destroy_id-wait.patch new file mode 100644 index 00000000000..f5d6c014b1a --- /dev/null +++ b/queue-5.10/rdma-cm-add-timeout-to-cm_destroy_id-wait.patch @@ -0,0 +1,102 @@ +From 62f6b41b2e4e56cbed6354885596fd78577c0e3b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 Mar 2024 22:33:23 -0800 +Subject: RDMA/cm: add timeout to cm_destroy_id wait + +From: Manjunath Patil + +[ Upstream commit 96d9cbe2f2ff7abde021bac75eafaceabe9a51fa ] + +Add timeout to cm_destroy_id, so that userspace can trigger any data +collection that would help in analyzing the cause of delay in destroying +the cm_id. + +New noinline function helps dtrace/ebpf programs to hook on to it. +Existing functionality isn't changed except triggering a probe-able new +function at every timeout interval. + +We have seen cases where CM messages stuck with MAD layer (either due to +software bug or faulty HCA), leading to cm_id getting stuck in the +following call stack. This patch helps in resolving such issues faster. + +kernel: ... INFO: task XXXX:56778 blocked for more than 120 seconds. +... + Call Trace: + __schedule+0x2bc/0x895 + schedule+0x36/0x7c + schedule_timeout+0x1f6/0x31f + ? __slab_free+0x19c/0x2ba + wait_for_completion+0x12b/0x18a + ? wake_up_q+0x80/0x73 + cm_destroy_id+0x345/0x610 [ib_cm] + ib_destroy_cm_id+0x10/0x20 [ib_cm] + rdma_destroy_id+0xa8/0x300 [rdma_cm] + ucma_destroy_id+0x13e/0x190 [rdma_ucm] + ucma_write+0xe0/0x160 [rdma_ucm] + __vfs_write+0x3a/0x16d + vfs_write+0xb2/0x1a1 + ? syscall_trace_enter+0x1ce/0x2b8 + SyS_write+0x5c/0xd3 + do_syscall_64+0x79/0x1b9 + entry_SYSCALL_64_after_hwframe+0x16d/0x0 + +Signed-off-by: Manjunath Patil +Link: https://lore.kernel.org/r/20240309063323.458102-1-manjunath.b.patil@oracle.com +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +--- + drivers/infiniband/core/cm.c | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c +index db1a25fbe2fa9..2a30b25c5e7e5 100644 +--- a/drivers/infiniband/core/cm.c ++++ b/drivers/infiniband/core/cm.c +@@ -33,6 +33,7 @@ MODULE_AUTHOR("Sean Hefty"); + MODULE_DESCRIPTION("InfiniBand CM"); + MODULE_LICENSE("Dual BSD/GPL"); + ++#define CM_DESTROY_ID_WAIT_TIMEOUT 10000 /* msecs */ + static const char * const ibcm_rej_reason_strs[] = { + [IB_CM_REJ_NO_QP] = "no QP", + [IB_CM_REJ_NO_EEC] = "no EEC", +@@ -1056,10 +1057,20 @@ static void cm_reset_to_idle(struct cm_id_private *cm_id_priv) + } + } + ++static noinline void cm_destroy_id_wait_timeout(struct ib_cm_id *cm_id) ++{ ++ struct cm_id_private *cm_id_priv; ++ ++ cm_id_priv = container_of(cm_id, struct cm_id_private, id); ++ pr_err("%s: cm_id=%p timed out. state=%d refcnt=%d\n", __func__, ++ cm_id, cm_id->state, refcount_read(&cm_id_priv->refcount)); ++} ++ + static void cm_destroy_id(struct ib_cm_id *cm_id, int err) + { + struct cm_id_private *cm_id_priv; + struct cm_work *work; ++ int ret; + + cm_id_priv = container_of(cm_id, struct cm_id_private, id); + spin_lock_irq(&cm_id_priv->lock); +@@ -1171,7 +1182,14 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err) + + xa_erase(&cm.local_id_table, cm_local_id(cm_id->local_id)); + cm_deref_id(cm_id_priv); +- wait_for_completion(&cm_id_priv->comp); ++ do { ++ ret = wait_for_completion_timeout(&cm_id_priv->comp, ++ msecs_to_jiffies( ++ CM_DESTROY_ID_WAIT_TIMEOUT)); ++ if (!ret) /* timeout happened */ ++ cm_destroy_id_wait_timeout(cm_id); ++ } while (!ret); ++ + while ((work = cm_dequeue_work(cm_id_priv)) != NULL) + cm_free_work(work); + +-- +2.43.0 + diff --git a/queue-5.10/revert-acpi-pm-block-asus-b1400ceae-from-suspend-to-.patch b/queue-5.10/revert-acpi-pm-block-asus-b1400ceae-from-suspend-to-.patch new file mode 100644 index 00000000000..df78e8a6c1b --- /dev/null +++ b/queue-5.10/revert-acpi-pm-block-asus-b1400ceae-from-suspend-to-.patch @@ -0,0 +1,58 @@ +From 2c4d6b7becc680e19c38621edcde92025d06bf2b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 28 Feb 2024 08:53:16 +0100 +Subject: Revert "ACPI: PM: Block ASUS B1400CEAE from suspend to idle by + default" + +From: Daniel Drake + +[ Upstream commit cb98555fcd8eee98c30165537c7e394f3a66e809 ] + +This reverts commit d52848620de00cde4a3a5df908e231b8c8868250, which was +originally put in place to work around a s2idle failure on this platform +where the NVMe device was inaccessible upon resume. + +After extended testing, we found that the firmware's implementation of S3 +is buggy and intermittently fails to wake up the system. We need to revert +to s2idle mode. + +The NVMe issue has now been solved more precisely in the commit titled +"PCI: Disable D3cold on Asus B1400 PCI-NVMe bridge" + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=215742 +Link: https://lore.kernel.org/r/20240228075316.7404-2-drake@endlessos.org +Signed-off-by: Daniel Drake +Signed-off-by: Bjorn Helgaas +Acked-by: Jian-Hong Pan +Acked-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + drivers/acpi/sleep.c | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c +index 097a5b5f46ab0..e79c004ca0b24 100644 +--- a/drivers/acpi/sleep.c ++++ b/drivers/acpi/sleep.c +@@ -385,18 +385,6 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = { + DMI_MATCH(DMI_PRODUCT_NAME, "20GGA00L00"), + }, + }, +- /* +- * ASUS B1400CEAE hangs on resume from suspend (see +- * https://bugzilla.kernel.org/show_bug.cgi?id=215742). +- */ +- { +- .callback = init_default_s3, +- .ident = "ASUS B1400CEAE", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), +- DMI_MATCH(DMI_PRODUCT_NAME, "ASUS EXPERTBOOK B1400CEAE"), +- }, +- }, + {}, + }; + +-- +2.43.0 + diff --git a/queue-5.10/ring-buffer-use-read_once-to-read-cpu_buffer-commit_.patch b/queue-5.10/ring-buffer-use-read_once-to-read-cpu_buffer-commit_.patch new file mode 100644 index 00000000000..7ecee79253c --- /dev/null +++ b/queue-5.10/ring-buffer-use-read_once-to-read-cpu_buffer-commit_.patch @@ -0,0 +1,42 @@ +From 258d7d26bd2e1ee4e4e33f2fea7e7d3aafdebe9f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 2 Mar 2024 12:42:21 +0800 +Subject: ring-buffer: use READ_ONCE() to read cpu_buffer->commit_page in + concurrent environment + +From: linke li + +[ Upstream commit f1e30cb6369251c03f63c564006f96a54197dcc4 ] + +In function ring_buffer_iter_empty(), cpu_buffer->commit_page is read +while other threads may change it. It may cause the time_stamp that read +in the next line come from a different page. Use READ_ONCE() to avoid +having to reason about compiler optimizations now and in future. + +Link: https://lore.kernel.org/linux-trace-kernel/tencent_DFF7D3561A0686B5E8FC079150A02505180A@qq.com + +Cc: Masami Hiramatsu +Cc: Mathieu Desnoyers +Signed-off-by: linke li +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Sasha Levin +--- + kernel/trace/ring_buffer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c +index fb87def73a3a4..2df8e13a29e57 100644 +--- a/kernel/trace/ring_buffer.c ++++ b/kernel/trace/ring_buffer.c +@@ -4211,7 +4211,7 @@ int ring_buffer_iter_empty(struct ring_buffer_iter *iter) + cpu_buffer = iter->cpu_buffer; + reader = cpu_buffer->reader_page; + head_page = cpu_buffer->head_page; +- commit_page = cpu_buffer->commit_page; ++ commit_page = READ_ONCE(cpu_buffer->commit_page); + commit_ts = commit_page->page->time_stamp; + + /* +-- +2.43.0 + diff --git a/queue-5.10/scsi-lpfc-fix-possible-memory-leak-in-lpfc_rcv_padis.patch b/queue-5.10/scsi-lpfc-fix-possible-memory-leak-in-lpfc_rcv_padis.patch new file mode 100644 index 00000000000..b16a81fdc4c --- /dev/null +++ b/queue-5.10/scsi-lpfc-fix-possible-memory-leak-in-lpfc_rcv_padis.patch @@ -0,0 +1,45 @@ +From 849023216f43f5f0c10a9c4b69b4c04bd1c6ad86 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 31 Jan 2024 10:50:57 -0800 +Subject: scsi: lpfc: Fix possible memory leak in lpfc_rcv_padisc() + +From: Justin Tee + +[ Upstream commit 2ae917d4bcab80ab304b774d492e2fcd6c52c06b ] + +The call to lpfc_sli4_resume_rpi() in lpfc_rcv_padisc() may return an +unsuccessful status. In such cases, the elsiocb is not issued, the +completion is not called, and thus the elsiocb resource is leaked. + +Check return value after calling lpfc_sli4_resume_rpi() and conditionally +release the elsiocb resource. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20240131185112.149731-3-justintee8345@gmail.com +Reviewed-by: Himanshu Madhani +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/lpfc/lpfc_nportdisc.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c +index 1e22364a31fcf..d6287c58d5045 100644 +--- a/drivers/scsi/lpfc/lpfc_nportdisc.c ++++ b/drivers/scsi/lpfc/lpfc_nportdisc.c +@@ -784,8 +784,10 @@ lpfc_rcv_padisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, + /* Save the ELS cmd */ + elsiocb->drvrTimeout = cmd; + +- lpfc_sli4_resume_rpi(ndlp, +- lpfc_mbx_cmpl_resume_rpi, elsiocb); ++ if (lpfc_sli4_resume_rpi(ndlp, ++ lpfc_mbx_cmpl_resume_rpi, ++ elsiocb)) ++ kfree(elsiocb); + goto out; + } + } +-- +2.43.0 + diff --git a/queue-5.10/series b/queue-5.10/series index b095d77b1f0..c734c6652ab 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -240,3 +240,45 @@ x86-retpoline-do-the-necessary-fixup-to-the-zen3-4-srso-return-thunk-for-srso.pa mptcp-don-t-account-accept-of-non-mpc-client-as-fallback-to-tcp.patch x86-cpufeatures-add-cpuid_lnx_5-to-track-recently-added-linux-defined-word.patch objtool-add-asm-version-of-stack_frame_non_standard.patch +wifi-ath9k-fix-lna-selection-in-ath_ant_try_scan.patch +batman-adv-return-directly-after-a-failed-batadv_dat.patch +batman-adv-improve-exception-handling-in-batadv_thro.patch +vmci-fix-memcpy-run-time-warning-in-dg_dispatch_as_h.patch +panic-flush-kernel-log-buffer-at-the-end.patch +arm64-dts-rockchip-fix-rk3328-hdmi-ports-node.patch +arm64-dts-rockchip-fix-rk3399-hdmi-ports-node.patch +ionic-set-adminq-irq-affinity.patch +pstore-zone-add-a-null-pointer-check-to-the-psz_kmsg.patch +tools-power-x86_energy_perf_policy-fix-file-leak-in-.patch +btrfs-handle-chunk-tree-lookup-error-in-btrfs_reloca.patch +btrfs-export-handle-invalid-inode-or-root-reference-.patch +btrfs-send-handle-path-ref-underflow-in-header-itera.patch +net-smc-reduce-rtnl-pressure-in-smc_pnet_create_pnet.patch +bluetooth-btintel-fix-null-ptr-deref-in-btintel_read.patch +input-synaptics-rmi4-fail-probing-if-memory-allocati.patch +pinctrl-renesas-checker-limit-cfg-reg-enum-checks-to.patch +sysv-don-t-call-sb_bread-with-pointers_lock-held.patch +scsi-lpfc-fix-possible-memory-leak-in-lpfc_rcv_padis.patch +isofs-handle-cds-with-bad-root-inode-but-good-joliet.patch +media-sta2x11-fix-irq-handler-cast.patch +ext4-add-a-hint-for-block-bitmap-corrupt-state-in-mb.patch +ext4-forbid-commit-inconsistent-quota-data-when-erro.patch +drm-amd-display-fix-nanosec-stat-overflow.patch +sunrpc-increase-size-of-rpc_wait_queue.qlen-from-uns.patch +revert-acpi-pm-block-asus-b1400ceae-from-suspend-to-.patch +libperf-evlist-avoid-out-of-bounds-access.patch +block-prevent-division-by-zero-in-blk_rq_stat_sum.patch +rdma-cm-add-timeout-to-cm_destroy_id-wait.patch +input-allocate-keycode-for-display-refresh-rate-togg.patch +platform-x86-touchscreen_dmi-add-an-extra-entry-for-.patch +ktest-force-buildonly-1-for-make_warnings_file-test-.patch +ring-buffer-use-read_once-to-read-cpu_buffer-commit_.patch +tools-iio-replace-seekdir-in-iio_generic_buffer.patch +usb-typec-tcpci-add-generic-tcpci-fallback-compatibl.patch +usb-sl811-hcd-only-defined-function-checkdone-if-qui.patch +fbdev-viafb-fix-typo-in-hw_bitblt_1-and-hw_bitblt_2.patch +drivers-nvme-add-quirks-for-device-126f-2262.patch +fbmon-prevent-division-by-zero-in-fb_videomode_from_.patch +netfilter-nf_tables-release-batch-on-table-validatio.patch +netfilter-nf_tables-release-mutex-after-nft_gc_seq_e.patch +netfilter-nf_tables-discard-table-flag-update-with-p.patch diff --git a/queue-5.10/sunrpc-increase-size-of-rpc_wait_queue.qlen-from-uns.patch b/queue-5.10/sunrpc-increase-size-of-rpc_wait_queue.qlen-from-uns.patch new file mode 100644 index 00000000000..35ade9526bf --- /dev/null +++ b/queue-5.10/sunrpc-increase-size-of-rpc_wait_queue.qlen-from-uns.patch @@ -0,0 +1,87 @@ +From ba5c7fcfa56cea5af36ba3709650b42cb6c68208 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 Jan 2024 11:38:25 -0800 +Subject: SUNRPC: increase size of rpc_wait_queue.qlen from unsigned short to + unsigned int + +From: Dai Ngo + +[ Upstream commit 2c35f43b5a4b9cdfaa6fdd946f5a212615dac8eb ] + +When the NFS client is under extreme load the rpc_wait_queue.qlen counter +can be overflowed. Here is an instant of the backlog queue overflow in a +real world environment shown by drgn helper: + +rpc_task_stats(rpc_clnt): +------------------------- +rpc_clnt: 0xffff92b65d2bae00 +rpc_xprt: 0xffff9275db64f000 + Queue: sending[64887] pending[524] backlog[30441] binding[0] +XMIT task: 0xffff925c6b1d8e98 + WRITE: 750654 + __dta_call_status_580: 65463 + __dta_call_transmit_status_579: 1 + call_reserveresult: 685189 + nfs_client_init_is_complete: 1 + COMMIT: 584 + call_reserveresult: 573 + __dta_call_status_580: 11 + ACCESS: 1 + __dta_call_status_580: 1 + GETATTR: 10 + __dta_call_status_580: 4 + call_reserveresult: 6 +751249 tasks for server 111.222.333.444 +Total tasks: 751249 + +count_rpc_wait_queues(xprt): +---------------------------- +**** rpc_xprt: 0xffff9275db64f000 num_reqs: 65511 +wait_queue: xprt_binding[0] cnt: 0 +wait_queue: xprt_binding[1] cnt: 0 +wait_queue: xprt_binding[2] cnt: 0 +wait_queue: xprt_binding[3] cnt: 0 +rpc_wait_queue[xprt_binding].qlen: 0 maxpriority: 0 +wait_queue: xprt_sending[0] cnt: 0 +wait_queue: xprt_sending[1] cnt: 64887 +wait_queue: xprt_sending[2] cnt: 0 +wait_queue: xprt_sending[3] cnt: 0 +rpc_wait_queue[xprt_sending].qlen: 64887 maxpriority: 3 +wait_queue: xprt_pending[0] cnt: 524 +wait_queue: xprt_pending[1] cnt: 0 +wait_queue: xprt_pending[2] cnt: 0 +wait_queue: xprt_pending[3] cnt: 0 +rpc_wait_queue[xprt_pending].qlen: 524 maxpriority: 0 +wait_queue: xprt_backlog[0] cnt: 0 +wait_queue: xprt_backlog[1] cnt: 685801 +wait_queue: xprt_backlog[2] cnt: 0 +wait_queue: xprt_backlog[3] cnt: 0 +rpc_wait_queue[xprt_backlog].qlen: 30441 maxpriority: 3 [task cnt mismatch] + +There is no effect on operations when this overflow occurs. However +it causes confusion when trying to diagnose the performance problem. + +Signed-off-by: Dai Ngo +Reviewed-by: Jeff Layton +Signed-off-by: Trond Myklebust +Signed-off-by: Sasha Levin +--- + include/linux/sunrpc/sched.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h +index 256dff36cf720..0527a4bc9a36f 100644 +--- a/include/linux/sunrpc/sched.h ++++ b/include/linux/sunrpc/sched.h +@@ -197,7 +197,7 @@ struct rpc_wait_queue { + unsigned char maxpriority; /* maximum priority (0 if queue is not a priority queue) */ + unsigned char priority; /* current priority */ + unsigned char nr; /* # tasks remaining for cookie */ +- unsigned short qlen; /* total # tasks waiting in queue */ ++ unsigned int qlen; /* total # tasks waiting in queue */ + struct rpc_timer timer_list; + #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) || IS_ENABLED(CONFIG_TRACEPOINTS) + const char * name; +-- +2.43.0 + diff --git a/queue-5.10/sysv-don-t-call-sb_bread-with-pointers_lock-held.patch b/queue-5.10/sysv-don-t-call-sb_bread-with-pointers_lock-held.patch new file mode 100644 index 00000000000..eb9675894f7 --- /dev/null +++ b/queue-5.10/sysv-don-t-call-sb_bread-with-pointers_lock-held.patch @@ -0,0 +1,94 @@ +From f52d40d6fd8e2ee731f3deba92b5a3ce051cbc18 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 10 Apr 2023 21:04:50 +0900 +Subject: sysv: don't call sb_bread() with pointers_lock held + +From: Tetsuo Handa + +[ Upstream commit f123dc86388cb669c3d6322702dc441abc35c31e ] + +syzbot is reporting sleep in atomic context in SysV filesystem [1], for +sb_bread() is called with rw_spinlock held. + +A "write_lock(&pointers_lock) => read_lock(&pointers_lock) deadlock" bug +and a "sb_bread() with write_lock(&pointers_lock)" bug were introduced by +"Replace BKL for chain locking with sysvfs-private rwlock" in Linux 2.5.12. + +Then, "[PATCH] err1-40: sysvfs locking fix" in Linux 2.6.8 fixed the +former bug by moving pointers_lock lock to the callers, but instead +introduced a "sb_bread() with read_lock(&pointers_lock)" bug (which made +this problem easier to hit). + +Al Viro suggested that why not to do like get_branch()/get_block()/ +find_shared() in Minix filesystem does. And doing like that is almost a +revert of "[PATCH] err1-40: sysvfs locking fix" except that get_branch() + from with find_shared() is called without write_lock(&pointers_lock). + +Reported-by: syzbot +Link: https://syzkaller.appspot.com/bug?extid=69b40dc5fd40f32c199f +Suggested-by: Al Viro +Signed-off-by: Tetsuo Handa +Link: https://lore.kernel.org/r/0d195f93-a22a-49a2-0020-103534d6f7f6@I-love.SAKURA.ne.jp +Signed-off-by: Christian Brauner +Signed-off-by: Sasha Levin +--- + fs/sysv/itree.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/fs/sysv/itree.c b/fs/sysv/itree.c +index e3d1673b8ec97..ef9bcfeec21ad 100644 +--- a/fs/sysv/itree.c ++++ b/fs/sysv/itree.c +@@ -82,9 +82,6 @@ static inline sysv_zone_t *block_end(struct buffer_head *bh) + return (sysv_zone_t*)((char*)bh->b_data + bh->b_size); + } + +-/* +- * Requires read_lock(&pointers_lock) or write_lock(&pointers_lock) +- */ + static Indirect *get_branch(struct inode *inode, + int depth, + int offsets[], +@@ -104,15 +101,18 @@ static Indirect *get_branch(struct inode *inode, + bh = sb_bread(sb, block); + if (!bh) + goto failure; ++ read_lock(&pointers_lock); + if (!verify_chain(chain, p)) + goto changed; + add_chain(++p, bh, (sysv_zone_t*)bh->b_data + *++offsets); ++ read_unlock(&pointers_lock); + if (!p->key) + goto no_block; + } + return NULL; + + changed: ++ read_unlock(&pointers_lock); + brelse(bh); + *err = -EAGAIN; + goto no_block; +@@ -218,9 +218,7 @@ static int get_block(struct inode *inode, sector_t iblock, struct buffer_head *b + goto out; + + reread: +- read_lock(&pointers_lock); + partial = get_branch(inode, depth, offsets, chain, &err); +- read_unlock(&pointers_lock); + + /* Simplest case - block found, no allocation needed */ + if (!partial) { +@@ -290,9 +288,9 @@ static Indirect *find_shared(struct inode *inode, + *top = 0; + for (k = depth; k > 1 && !offsets[k-1]; k--) + ; ++ partial = get_branch(inode, k, offsets, chain, &err); + + write_lock(&pointers_lock); +- partial = get_branch(inode, k, offsets, chain, &err); + if (!partial) + partial = chain + k-1; + /* +-- +2.43.0 + diff --git a/queue-5.10/tools-iio-replace-seekdir-in-iio_generic_buffer.patch b/queue-5.10/tools-iio-replace-seekdir-in-iio_generic_buffer.patch new file mode 100644 index 00000000000..a8ceb1d4b98 --- /dev/null +++ b/queue-5.10/tools-iio-replace-seekdir-in-iio_generic_buffer.patch @@ -0,0 +1,45 @@ +From 348d11ac3e14adc10427f0100bdf1a9484804562 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 8 Jan 2024 12:32:20 +0200 +Subject: tools: iio: replace seekdir() in iio_generic_buffer + +From: Petre Rodan + +[ Upstream commit 4e6500bfa053dc133021f9c144261b77b0ba7dc8 ] + +Replace seekdir() with rewinddir() in order to fix a localized glibc bug. + +One of the glibc patches that stable Gentoo is using causes an improper +directory stream positioning bug on 32bit arm. That in turn ends up as a +floating point exception in iio_generic_buffer. + +The attached patch provides a fix by using an equivalent function which +should not cause trouble for other distros and is easier to reason about +in general as it obviously always goes back to to the start. + +https://sourceware.org/bugzilla/show_bug.cgi?id=31212 + +Signed-off-by: Petre Rodan +Link: https://lore.kernel.org/r/20240108103224.3986-1-petre.rodan@subdimension.ro +Signed-off-by: Jonathan Cameron +Signed-off-by: Sasha Levin +--- + tools/iio/iio_utils.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c +index 48360994c2a13..b8745873928c5 100644 +--- a/tools/iio/iio_utils.c ++++ b/tools/iio/iio_utils.c +@@ -373,7 +373,7 @@ int build_channel_array(const char *device_dir, + goto error_close_dir; + } + +- seekdir(dp, 0); ++ rewinddir(dp); + while (ent = readdir(dp), ent) { + if (strcmp(ent->d_name + strlen(ent->d_name) - strlen("_en"), + "_en") == 0) { +-- +2.43.0 + diff --git a/queue-5.10/tools-power-x86_energy_perf_policy-fix-file-leak-in-.patch b/queue-5.10/tools-power-x86_energy_perf_policy-fix-file-leak-in-.patch new file mode 100644 index 00000000000..48a9ec4532f --- /dev/null +++ b/queue-5.10/tools-power-x86_energy_perf_policy-fix-file-leak-in-.patch @@ -0,0 +1,35 @@ +From f504bc99317c6618532521c3eeedf27ad03c50e6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 13 Feb 2024 16:19:56 -0800 +Subject: tools/power x86_energy_perf_policy: Fix file leak in get_pkg_num() + +From: Samasth Norway Ananda + +[ Upstream commit f85450f134f0b4ca7e042dc3dc89155656a2299d ] + +In function get_pkg_num() if fopen_or_die() succeeds it returns a file +pointer to be used. But fclose() is never called before returning from +the function. + +Signed-off-by: Samasth Norway Ananda +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c +index ff6c6661f075f..1c80aa498d543 100644 +--- a/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c ++++ b/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c +@@ -1152,6 +1152,7 @@ unsigned int get_pkg_num(int cpu) + retval = fscanf(fp, "%d\n", &pkg); + if (retval != 1) + errx(1, "%s: failed to parse", pathname); ++ fclose(fp); + return pkg; + } + +-- +2.43.0 + diff --git a/queue-5.10/usb-sl811-hcd-only-defined-function-checkdone-if-qui.patch b/queue-5.10/usb-sl811-hcd-only-defined-function-checkdone-if-qui.patch new file mode 100644 index 00000000000..a057b436f66 --- /dev/null +++ b/queue-5.10/usb-sl811-hcd-only-defined-function-checkdone-if-qui.patch @@ -0,0 +1,47 @@ +From 5fdaa295070e72310ac6fab9581156e9a488e57d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 7 Mar 2024 11:13:51 +0000 +Subject: usb: sl811-hcd: only defined function checkdone if QUIRK2 is defined + +From: Colin Ian King + +[ Upstream commit 12f371e2b6cb4b79c788f1f073992e115f4ca918 ] + +Function checkdone is only required if QUIRK2 is defined, so add +appropriate #if / #endif around the function. + +Cleans up clang scan build warning: +drivers/usb/host/sl811-hcd.c:588:18: warning: unused function +'checkdone' [-Wunused-function] + +Signed-off-by: Colin Ian King +Link: https://lore.kernel.org/r/20240307111351.1982382-1-colin.i.king@gmail.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/host/sl811-hcd.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c +index 9465fce99c822..f803079a9f263 100644 +--- a/drivers/usb/host/sl811-hcd.c ++++ b/drivers/usb/host/sl811-hcd.c +@@ -585,6 +585,7 @@ done(struct sl811 *sl811, struct sl811h_ep *ep, u8 bank) + finish_request(sl811, ep, urb, urbstat); + } + ++#ifdef QUIRK2 + static inline u8 checkdone(struct sl811 *sl811) + { + u8 ctl; +@@ -616,6 +617,7 @@ static inline u8 checkdone(struct sl811 *sl811) + #endif + return irqstat; + } ++#endif + + static irqreturn_t sl811h_irq(struct usb_hcd *hcd) + { +-- +2.43.0 + diff --git a/queue-5.10/usb-typec-tcpci-add-generic-tcpci-fallback-compatibl.patch b/queue-5.10/usb-typec-tcpci-add-generic-tcpci-fallback-compatibl.patch new file mode 100644 index 00000000000..bd3006cae52 --- /dev/null +++ b/queue-5.10/usb-typec-tcpci-add-generic-tcpci-fallback-compatibl.patch @@ -0,0 +1,36 @@ +From ca77ee9f9c892c3f7e1c5b33f8db7dcc378313ca Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Feb 2024 22:09:01 +0100 +Subject: usb: typec: tcpci: add generic tcpci fallback compatible + +From: Marco Felsch + +[ Upstream commit 8774ea7a553e2aec323170d49365b59af0a2b7e0 ] + +The driver already support the tcpci binding for the i2c_device_id so +add the support for the of_device_id too. + +Signed-off-by: Marco Felsch +Reviewed-by: Heikki Krogerus +Link: https://lore.kernel.org/r/20240222210903.208901-3-m.felsch@pengutronix.de +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/typec/tcpm/tcpci.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c +index e34e46df80243..33c67adf7c67a 100644 +--- a/drivers/usb/typec/tcpm/tcpci.c ++++ b/drivers/usb/typec/tcpm/tcpci.c +@@ -732,6 +732,7 @@ MODULE_DEVICE_TABLE(i2c, tcpci_id); + #ifdef CONFIG_OF + static const struct of_device_id tcpci_of_match[] = { + { .compatible = "nxp,ptn5110", }, ++ { .compatible = "tcpci", }, + {}, + }; + MODULE_DEVICE_TABLE(of, tcpci_of_match); +-- +2.43.0 + diff --git a/queue-5.10/vmci-fix-memcpy-run-time-warning-in-dg_dispatch_as_h.patch b/queue-5.10/vmci-fix-memcpy-run-time-warning-in-dg_dispatch_as_h.patch new file mode 100644 index 00000000000..f7e0b7304ab --- /dev/null +++ b/queue-5.10/vmci-fix-memcpy-run-time-warning-in-dg_dispatch_as_h.patch @@ -0,0 +1,80 @@ +From 435ecfb3d99a78d0a18e1beb5964477b47b2536e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 5 Jan 2024 08:40:00 -0800 +Subject: VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host() + +From: Harshit Mogalapalli + +[ Upstream commit 19b070fefd0d024af3daa7329cbc0d00de5302ec ] + +Syzkaller hit 'WARNING in dg_dispatch_as_host' bug. + +memcpy: detected field-spanning write (size 56) of single field "&dg_info->msg" +at drivers/misc/vmw_vmci/vmci_datagram.c:237 (size 24) + +WARNING: CPU: 0 PID: 1555 at drivers/misc/vmw_vmci/vmci_datagram.c:237 +dg_dispatch_as_host+0x88e/0xa60 drivers/misc/vmw_vmci/vmci_datagram.c:237 + +Some code commentry, based on my understanding: + +544 #define VMCI_DG_SIZE(_dg) (VMCI_DG_HEADERSIZE + (size_t)(_dg)->payload_size) +/// This is 24 + payload_size + +memcpy(&dg_info->msg, dg, dg_size); + Destination = dg_info->msg ---> this is a 24 byte + structure(struct vmci_datagram) + Source = dg --> this is a 24 byte structure (struct vmci_datagram) + Size = dg_size = 24 + payload_size + +{payload_size = 56-24 =32} -- Syzkaller managed to set payload_size to 32. + + 35 struct delayed_datagram_info { + 36 struct datagram_entry *entry; + 37 struct work_struct work; + 38 bool in_dg_host_queue; + 39 /* msg and msg_payload must be together. */ + 40 struct vmci_datagram msg; + 41 u8 msg_payload[]; + 42 }; + +So those extra bytes of payload are copied into msg_payload[], a run time +warning is seen while fuzzing with Syzkaller. + +One possible way to fix the warning is to split the memcpy() into +two parts -- one -- direct assignment of msg and second taking care of payload. + +Gustavo quoted: +"Under FORTIFY_SOURCE we should not copy data across multiple members +in a structure." + +Reported-by: syzkaller +Suggested-by: Vegard Nossum +Suggested-by: Gustavo A. R. Silva +Signed-off-by: Harshit Mogalapalli +Reviewed-by: Gustavo A. R. Silva +Reviewed-by: Kees Cook +Reviewed-by: Dan Carpenter +Link: https://lore.kernel.org/r/20240105164001.2129796-2-harshit.m.mogalapalli@oracle.com +Signed-off-by: Kees Cook +Signed-off-by: Sasha Levin +--- + drivers/misc/vmw_vmci/vmci_datagram.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/misc/vmw_vmci/vmci_datagram.c b/drivers/misc/vmw_vmci/vmci_datagram.c +index f50d22882476f..d1d8224c8800c 100644 +--- a/drivers/misc/vmw_vmci/vmci_datagram.c ++++ b/drivers/misc/vmw_vmci/vmci_datagram.c +@@ -234,7 +234,8 @@ static int dg_dispatch_as_host(u32 context_id, struct vmci_datagram *dg) + + dg_info->in_dg_host_queue = true; + dg_info->entry = dst_entry; +- memcpy(&dg_info->msg, dg, dg_size); ++ dg_info->msg = *dg; ++ memcpy(&dg_info->msg_payload, dg + 1, dg->payload_size); + + INIT_WORK(&dg_info->work, dg_delayed_dispatch); + schedule_work(&dg_info->work); +-- +2.43.0 + diff --git a/queue-5.10/wifi-ath9k-fix-lna-selection-in-ath_ant_try_scan.patch b/queue-5.10/wifi-ath9k-fix-lna-selection-in-ath_ant_try_scan.patch new file mode 100644 index 00000000000..fb365c916e4 --- /dev/null +++ b/queue-5.10/wifi-ath9k-fix-lna-selection-in-ath_ant_try_scan.patch @@ -0,0 +1,43 @@ +From 84c87395200c1e106e6945de7d10ff1ebbbfa6e1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 17 Dec 2023 13:29:03 +0200 +Subject: wifi: ath9k: fix LNA selection in ath_ant_try_scan() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Dmitry Antipov + +[ Upstream commit d6b27eb997ef9a2aa51633b3111bc4a04748e6d3 ] + +In 'ath_ant_try_scan()', (most likely) the 2nd LNA's signal +strength should be used in comparison against RSSI when +selecting first LNA as the main one. Compile tested only. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Signed-off-by: Dmitry Antipov +Acked-by: Toke Høiland-Jørgensen +Signed-off-by: Kalle Valo +Link: https://msgid.link/20231211172502.25202-1-dmantipov@yandex.ru +Signed-off-by: Sasha Levin +--- + drivers/net/wireless/ath/ath9k/antenna.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c +index 988222cea9dfe..acc84e6711b0e 100644 +--- a/drivers/net/wireless/ath/ath9k/antenna.c ++++ b/drivers/net/wireless/ath/ath9k/antenna.c +@@ -643,7 +643,7 @@ static void ath_ant_try_scan(struct ath_ant_comb *antcomb, + conf->main_lna_conf = ATH_ANT_DIV_COMB_LNA1; + conf->alt_lna_conf = ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2; + } else if (antcomb->rssi_sub > +- antcomb->rssi_lna1) { ++ antcomb->rssi_lna2) { + /* set to A-B */ + conf->main_lna_conf = ATH_ANT_DIV_COMB_LNA1; + conf->alt_lna_conf = ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; +-- +2.43.0 +