From: Sasha Levin Date: Sun, 12 Feb 2023 19:48:34 +0000 (-0500) Subject: Fixes for 5.10 X-Git-Tag: v6.1.12~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=93c4a719d3b0d8a79304a928756e0fa02ec85efb;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/alsa-pci-lx6464es-fix-a-debug-loop.patch b/queue-5.10/alsa-pci-lx6464es-fix-a-debug-loop.patch new file mode 100644 index 00000000000..a6f72ad7235 --- /dev/null +++ b/queue-5.10/alsa-pci-lx6464es-fix-a-debug-loop.patch @@ -0,0 +1,52 @@ +From 3db161906e77077f83ee853dcc16c770f5ce1b73 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 31 Jan 2023 13:02:13 +0300 +Subject: ALSA: pci: lx6464es: fix a debug loop + +From: Dan Carpenter + +[ Upstream commit 5dac9f8dc25fefd9d928b98f6477ff3daefd73e3 ] + +This loop accidentally reuses the "i" iterator for both the inside and +the outside loop. The value of MAX_STREAM_BUFFER is 5. I believe that +chip->rmh.stat_len is in the 2-12 range. If the value of .stat_len is +4 or more then it will loop exactly one time, but if it's less then it +is a forever loop. + +It looks like it was supposed to combined into one loop where +conditions are checked. + +Fixes: 8e6320064c33 ("ALSA: lx_core: Remove useless #if 0 .. #endif") +Signed-off-by: Dan Carpenter +Link: https://lore.kernel.org/r/Y9jnJTis/mRFJAQp@kili +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/pci/lx6464es/lx_core.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c +index f884f5a6a61c2..a49a3254f9677 100644 +--- a/sound/pci/lx6464es/lx_core.c ++++ b/sound/pci/lx6464es/lx_core.c +@@ -493,12 +493,11 @@ int lx_buffer_ask(struct lx6464es *chip, u32 pipe, int is_capture, + dev_dbg(chip->card->dev, + "CMD_08_ASK_BUFFERS: needed %d, freed %d\n", + *r_needed, *r_freed); +- for (i = 0; i < MAX_STREAM_BUFFER; ++i) { +- for (i = 0; i != chip->rmh.stat_len; ++i) +- dev_dbg(chip->card->dev, +- " stat[%d]: %x, %x\n", i, +- chip->rmh.stat[i], +- chip->rmh.stat[i] & MASK_DATA_SIZE); ++ for (i = 0; i < MAX_STREAM_BUFFER && i < chip->rmh.stat_len; ++ ++i) { ++ dev_dbg(chip->card->dev, " stat[%d]: %x, %x\n", i, ++ chip->rmh.stat[i], ++ chip->rmh.stat[i] & MASK_DATA_SIZE); + } + } + +-- +2.39.0 + diff --git a/queue-5.10/bonding-fix-error-checking-in-bond_debug_reregister.patch b/queue-5.10/bonding-fix-error-checking-in-bond_debug_reregister.patch new file mode 100644 index 00000000000..ba9e44126a5 --- /dev/null +++ b/queue-5.10/bonding-fix-error-checking-in-bond_debug_reregister.patch @@ -0,0 +1,40 @@ +From 9bdf2e635e9c681b59032c94b786ed3b3f5041cb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 2 Feb 2023 17:32:55 +0800 +Subject: bonding: fix error checking in bond_debug_reregister() + +From: Qi Zheng + +[ Upstream commit cbe83191d40d8925b7a99969d037d2a0caf69294 ] + +Since commit ff9fb72bc077 ("debugfs: return error values, +not NULL") changed return value of debugfs_rename() in +error cases from %NULL to %ERR_PTR(-ERROR), we should +also check error values instead of NULL. + +Fixes: ff9fb72bc077 ("debugfs: return error values, not NULL") +Signed-off-by: Qi Zheng +Acked-by: Jay Vosburgh +Link: https://lore.kernel.org/r/20230202093256.32458-1-zhengqi.arch@bytedance.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/bonding/bond_debugfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c +index f3f86ef68ae0c..8b6cf2bf9025a 100644 +--- a/drivers/net/bonding/bond_debugfs.c ++++ b/drivers/net/bonding/bond_debugfs.c +@@ -76,7 +76,7 @@ void bond_debug_reregister(struct bonding *bond) + + d = debugfs_rename(bonding_debug_root, bond->debug_dir, + bonding_debug_root, bond->dev->name); +- if (d) { ++ if (!IS_ERR(d)) { + bond->debug_dir = d; + } else { + netdev_warn(bond->dev, "failed to reregister, so just unregister old one\n"); +-- +2.39.0 + diff --git a/queue-5.10/ib-hfi1-restore-allocated-resources-on-failed-copyou.patch b/queue-5.10/ib-hfi1-restore-allocated-resources-on-failed-copyou.patch new file mode 100644 index 00000000000..2978ae149b9 --- /dev/null +++ b/queue-5.10/ib-hfi1-restore-allocated-resources-on-failed-copyou.patch @@ -0,0 +1,46 @@ +From 1d3035f7026cbe2ca14361b60c5309473e497bdf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 12 Jan 2023 13:16:02 -0500 +Subject: IB/hfi1: Restore allocated resources on failed copyout + +From: Dean Luick + +[ Upstream commit 6601fc0d15ffc20654e39486f9bef35567106d68 ] + +Fix a resource leak if an error occurs. + +Fixes: f404ca4c7ea8 ("IB/hfi1: Refactor hfi_user_exp_rcv_setup() IOCTL") +Signed-off-by: Dean Luick +Signed-off-by: Dennis Dalessandro +Link: https://lore.kernel.org/r/167354736291.2132367.10894218740150168180.stgit@awfm-02.cornelisnetworks.com +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/hfi1/file_ops.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c +index d84b1098762c1..7828fb5931203 100644 +--- a/drivers/infiniband/hw/hfi1/file_ops.c ++++ b/drivers/infiniband/hw/hfi1/file_ops.c +@@ -1359,12 +1359,15 @@ static int user_exp_rcv_setup(struct hfi1_filedata *fd, unsigned long arg, + addr = arg + offsetof(struct hfi1_tid_info, tidcnt); + if (copy_to_user((void __user *)addr, &tinfo.tidcnt, + sizeof(tinfo.tidcnt))) +- return -EFAULT; ++ ret = -EFAULT; + + addr = arg + offsetof(struct hfi1_tid_info, length); +- if (copy_to_user((void __user *)addr, &tinfo.length, ++ if (!ret && copy_to_user((void __user *)addr, &tinfo.length, + sizeof(tinfo.length))) + ret = -EFAULT; ++ ++ if (ret) ++ hfi1_user_exp_rcv_invalid(fd, &tinfo); + } + + return ret; +-- +2.39.0 + diff --git a/queue-5.10/ib-ipoib-fix-legacy-ipoib-due-to-wrong-number-of-que.patch b/queue-5.10/ib-ipoib-fix-legacy-ipoib-due-to-wrong-number-of-que.patch new file mode 100644 index 00000000000..28948b164a7 --- /dev/null +++ b/queue-5.10/ib-ipoib-fix-legacy-ipoib-due-to-wrong-number-of-que.patch @@ -0,0 +1,98 @@ +From d948fb1507524b34a962c7c188bcf72182fc6351 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 24 Jan 2023 20:24:18 +0200 +Subject: IB/IPoIB: Fix legacy IPoIB due to wrong number of queues + +From: Dragos Tatulea + +[ Upstream commit e632291a2dbce45a24cddeb5fe28fe71d724ba43 ] + +The cited commit creates child PKEY interfaces over netlink will +multiple tx and rx queues, but some devices doesn't support more than 1 +tx and 1 rx queues. This causes to a crash when traffic is sent over the +PKEY interface due to the parent having a single queue but the child +having multiple queues. + +This patch fixes the number of queues to 1 for legacy IPoIB at the +earliest possible point in time. + +BUG: kernel NULL pointer dereference, address: 000000000000036b +PGD 0 P4D 0 +Oops: 0000 [#1] SMP +CPU: 4 PID: 209665 Comm: python3 Not tainted 6.1.0_for_upstream_min_debug_2022_12_12_17_02 #1 +Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 +RIP: 0010:kmem_cache_alloc+0xcb/0x450 +Code: ce 7e 49 8b 50 08 49 83 78 10 00 4d 8b 28 0f 84 cb 02 00 00 4d 85 ed 0f 84 c2 02 00 00 41 8b 44 24 28 48 8d 4a +01 49 8b 3c 24 <49> 8b 5c 05 00 4c 89 e8 65 48 0f c7 0f 0f 94 c0 84 c0 74 b8 41 8b +RSP: 0018:ffff88822acbbab8 EFLAGS: 00010202 +RAX: 0000000000000070 RBX: ffff8881c28e3e00 RCX: 00000000064f8dae +RDX: 00000000064f8dad RSI: 0000000000000a20 RDI: 0000000000030d00 +RBP: 0000000000000a20 R08: ffff8882f5d30d00 R09: ffff888104032f40 +R10: ffff88810fade828 R11: 736f6d6570736575 R12: ffff88810081c000 +R13: 00000000000002fb R14: ffffffff817fc865 R15: 0000000000000000 +FS: 00007f9324ff9700(0000) GS:ffff8882f5d00000(0000) knlGS:0000000000000000 +CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +CR2: 000000000000036b CR3: 00000001125af004 CR4: 0000000000370ea0 +DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +Call Trace: + + skb_clone+0x55/0xd0 + ip6_finish_output2+0x3fe/0x690 + ip6_finish_output+0xfa/0x310 + ip6_send_skb+0x1e/0x60 + udp_v6_send_skb+0x1e5/0x420 + udpv6_sendmsg+0xb3c/0xe60 + ? ip_mc_finish_output+0x180/0x180 + ? __switch_to_asm+0x3a/0x60 + ? __switch_to_asm+0x34/0x60 + sock_sendmsg+0x33/0x40 + __sys_sendto+0x103/0x160 + ? _copy_to_user+0x21/0x30 + ? kvm_clock_get_cycles+0xd/0x10 + ? ktime_get_ts64+0x49/0xe0 + __x64_sys_sendto+0x25/0x30 + do_syscall_64+0x3d/0x90 + entry_SYSCALL_64_after_hwframe+0x46/0xb0 +RIP: 0033:0x7f9374f1ed14 +Code: 42 41 f8 ff 44 8b 4c 24 2c 4c 8b 44 24 20 89 c5 44 8b 54 24 28 48 8b 54 24 18 b8 2c 00 00 00 48 8b 74 24 10 8b +7c 24 08 0f 05 <48> 3d 00 f0 ff ff 77 34 89 ef 48 89 44 24 08 e8 68 41 f8 ff 48 8b +RSP: 002b:00007f9324ff7bd0 EFLAGS: 00000293 ORIG_RAX: 000000000000002c +RAX: ffffffffffffffda RBX: 00007f9324ff7cc8 RCX: 00007f9374f1ed14 +RDX: 00000000000002fb RSI: 00007f93000052f0 RDI: 0000000000000030 +RBP: 0000000000000000 R08: 00007f9324ff7d40 R09: 000000000000001c +R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 +R13: 000000012a05f200 R14: 0000000000000001 R15: 00007f9374d57bdc + + +Fixes: dbc94a0fb817 ("IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces") +Signed-off-by: Dragos Tatulea +Link: https://lore.kernel.org/r/95eb6b74c7cf49fa46281f9d056d685c9fa11d38.1674584576.git.leon@kernel.org +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +--- + drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c +index abfab89423f41..35322d23fc340 100644 +--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c ++++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c +@@ -2188,6 +2188,14 @@ int ipoib_intf_init(struct ib_device *hca, u8 port, const char *name, + rn->attach_mcast = ipoib_mcast_attach; + rn->detach_mcast = ipoib_mcast_detach; + rn->hca = hca; ++ ++ rc = netif_set_real_num_tx_queues(dev, 1); ++ if (rc) ++ goto out; ++ ++ rc = netif_set_real_num_rx_queues(dev, 1); ++ if (rc) ++ goto out; + } + + priv->rn_ops = dev->netdev_ops; +-- +2.39.0 + diff --git a/queue-5.10/ice-do-not-use-wq_mem_reclaim-flag-for-workqueue.patch b/queue-5.10/ice-do-not-use-wq_mem_reclaim-flag-for-workqueue.patch new file mode 100644 index 00000000000..ed993ee8081 --- /dev/null +++ b/queue-5.10/ice-do-not-use-wq_mem_reclaim-flag-for-workqueue.patch @@ -0,0 +1,111 @@ +From fcd4c8de1f6e5c2fa79a254fa3012a43b7cfdde7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 30 Jan 2023 14:06:40 -0800 +Subject: ice: Do not use WQ_MEM_RECLAIM flag for workqueue + +From: Anirudh Venkataramanan + +[ Upstream commit 4d159f7884f78b1aacb99b4fc37d1e3cb1194e39 ] + +When both ice and the irdma driver are loaded, a warning in +check_flush_dependency is being triggered. This is due to ice driver +workqueue being allocated with the WQ_MEM_RECLAIM flag and the irdma one +is not. + +According to kernel documentation, this flag should be set if the +workqueue will be involved in the kernel's memory reclamation flow. +Since it is not, there is no need for the ice driver's WQ to have this +flag set so remove it. + +Example trace: + +[ +0.000004] workqueue: WQ_MEM_RECLAIM ice:ice_service_task [ice] is flushing !WQ_MEM_RECLAIM infiniband:0x0 +[ +0.000139] WARNING: CPU: 0 PID: 728 at kernel/workqueue.c:2632 check_flush_dependency+0x178/0x1a0 +[ +0.000011] Modules linked in: bonding tls xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 nft_compat nft_cha +in_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink bridge stp llc rfkill vfat fat intel_rapl_msr intel +_rapl_common isst_if_common skx_edac nfit libnvdimm x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct1 +0dif_pclmul crc32_pclmul ghash_clmulni_intel rapl intel_cstate rpcrdma sunrpc rdma_ucm ib_srpt ib_isert iscsi_target_mod target_ +core_mod ib_iser libiscsi scsi_transport_iscsi rdma_cm ib_cm iw_cm iTCO_wdt iTCO_vendor_support ipmi_ssif irdma mei_me ib_uverbs +ib_core intel_uncore joydev pcspkr i2c_i801 acpi_ipmi mei lpc_ich i2c_smbus intel_pch_thermal ioatdma ipmi_si acpi_power_meter +acpi_pad xfs libcrc32c sd_mod t10_pi crc64_rocksoft crc64 sg ahci ixgbe libahci ice i40e igb crc32c_intel mdio i2c_algo_bit liba +ta dca wmi dm_mirror dm_region_hash dm_log dm_mod ipmi_devintf ipmi_msghandler fuse +[ +0.000161] [last unloaded: bonding] +[ +0.000006] CPU: 0 PID: 728 Comm: kworker/0:2 Tainted: G S 6.2.0-rc2_next-queue-13jan-00458-gc20aabd57164 #1 +[ +0.000006] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0010.010620200716 01/06/2020 +[ +0.000003] Workqueue: ice ice_service_task [ice] +[ +0.000127] RIP: 0010:check_flush_dependency+0x178/0x1a0 +[ +0.000005] Code: 89 8e 02 01 e8 49 3d 40 00 49 8b 55 18 48 8d 8d d0 00 00 00 48 8d b3 d0 00 00 00 4d 89 e0 48 c7 c7 e0 3b 08 +9f e8 bb d3 07 01 <0f> 0b e9 be fe ff ff 80 3d 24 89 8e 02 00 0f 85 6b ff ff ff e9 06 +[ +0.000004] RSP: 0018:ffff88810a39f990 EFLAGS: 00010282 +[ +0.000005] RAX: 0000000000000000 RBX: ffff888141bc2400 RCX: 0000000000000000 +[ +0.000004] RDX: 0000000000000001 RSI: dffffc0000000000 RDI: ffffffffa1213a80 +[ +0.000003] RBP: ffff888194bf3400 R08: ffffed117b306112 R09: ffffed117b306112 +[ +0.000003] R10: ffff888bd983088b R11: ffffed117b306111 R12: 0000000000000000 +[ +0.000003] R13: ffff888111f84d00 R14: ffff88810a3943ac R15: ffff888194bf3400 +[ +0.000004] FS: 0000000000000000(0000) GS:ffff888bd9800000(0000) knlGS:0000000000000000 +[ +0.000003] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 +[ +0.000003] CR2: 000056035b208b60 CR3: 000000017795e005 CR4: 00000000007706f0 +[ +0.000003] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 +[ +0.000003] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 +[ +0.000002] PKRU: 55555554 +[ +0.000003] Call Trace: +[ +0.000002] +[ +0.000003] __flush_workqueue+0x203/0x840 +[ +0.000006] ? mutex_unlock+0x84/0xd0 +[ +0.000008] ? __pfx_mutex_unlock+0x10/0x10 +[ +0.000004] ? __pfx___flush_workqueue+0x10/0x10 +[ +0.000006] ? mutex_lock+0xa3/0xf0 +[ +0.000005] ib_cache_cleanup_one+0x39/0x190 [ib_core] +[ +0.000174] __ib_unregister_device+0x84/0xf0 [ib_core] +[ +0.000094] ib_unregister_device+0x25/0x30 [ib_core] +[ +0.000093] irdma_ib_unregister_device+0x97/0xc0 [irdma] +[ +0.000064] ? __pfx_irdma_ib_unregister_device+0x10/0x10 [irdma] +[ +0.000059] ? up_write+0x5c/0x90 +[ +0.000005] irdma_remove+0x36/0x90 [irdma] +[ +0.000062] auxiliary_bus_remove+0x32/0x50 +[ +0.000007] device_release_driver_internal+0xfa/0x1c0 +[ +0.000005] bus_remove_device+0x18a/0x260 +[ +0.000007] device_del+0x2e5/0x650 +[ +0.000005] ? __pfx_device_del+0x10/0x10 +[ +0.000003] ? mutex_unlock+0x84/0xd0 +[ +0.000004] ? __pfx_mutex_unlock+0x10/0x10 +[ +0.000004] ? _raw_spin_unlock+0x18/0x40 +[ +0.000005] ice_unplug_aux_dev+0x52/0x70 [ice] +[ +0.000160] ice_service_task+0x1309/0x14f0 [ice] +[ +0.000134] ? __pfx___schedule+0x10/0x10 +[ +0.000006] process_one_work+0x3b1/0x6c0 +[ +0.000008] worker_thread+0x69/0x670 +[ +0.000005] ? __kthread_parkme+0xec/0x110 +[ +0.000007] ? __pfx_worker_thread+0x10/0x10 +[ +0.000005] kthread+0x17f/0x1b0 +[ +0.000005] ? __pfx_kthread+0x10/0x10 +[ +0.000004] ret_from_fork+0x29/0x50 +[ +0.000009] + +Fixes: 940b61af02f4 ("ice: Initialize PF and setup miscellaneous interrupt") +Signed-off-by: Anirudh Venkataramanan +Signed-off-by: Marcin Szycik +Tested-by: Jakub Andrysiak +Signed-off-by: Tony Nguyen +Reviewed-by: Leon Romanovsky +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/intel/ice/ice_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c +index f193709c8efc6..c1465096239b6 100644 +--- a/drivers/net/ethernet/intel/ice/ice_main.c ++++ b/drivers/net/ethernet/intel/ice/ice_main.c +@@ -4853,7 +4853,7 @@ static int __init ice_module_init(void) + pr_info("%s\n", ice_driver_string); + pr_info("%s\n", ice_copyright); + +- ice_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, KBUILD_MODNAME); ++ ice_wq = alloc_workqueue("%s", 0, 0, KBUILD_MODNAME); + if (!ice_wq) { + pr_err("Failed to create workqueue\n"); + return -ENOMEM; +-- +2.39.0 + diff --git a/queue-5.10/ionic-clean-interrupt-before-enabling-queue-to-avoid.patch b/queue-5.10/ionic-clean-interrupt-before-enabling-queue-to-avoid.patch new file mode 100644 index 00000000000..36be2387170 --- /dev/null +++ b/queue-5.10/ionic-clean-interrupt-before-enabling-queue-to-avoid.patch @@ -0,0 +1,67 @@ +From d883e3834ec8a919ca8f1c9f07bfba48941ac3a3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 2 Feb 2023 13:55:35 -0800 +Subject: ionic: clean interrupt before enabling queue to avoid credit race + +From: Neel Patel + +[ Upstream commit e8797a058466b60fc5a3291b92430c93ba90eaff ] + +Clear the interrupt credits before enabling the queue rather +than after to be sure that the enabled queue starts at 0 and +that we don't wipe away possible credits after enabling the +queue. + +Fixes: 0f3154e6bcb3 ("ionic: Add Tx and Rx handling") +Signed-off-by: Neel Patel +Signed-off-by: Shannon Nelson +Reviewed-by: Leon Romanovsky +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index cb12d0171517e..fcd4213c99b83 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -257,6 +257,7 @@ static int ionic_qcq_enable(struct ionic_qcq *qcq) + .oper = IONIC_Q_ENABLE, + }, + }; ++ int ret; + + idev = &lif->ionic->idev; + dev = lif->ionic->dev; +@@ -264,16 +265,24 @@ static int ionic_qcq_enable(struct ionic_qcq *qcq) + dev_dbg(dev, "q_enable.index %d q_enable.qtype %d\n", + ctx.cmd.q_control.index, ctx.cmd.q_control.type); + ++ if (qcq->flags & IONIC_QCQ_F_INTR) ++ ionic_intr_clean(idev->intr_ctrl, qcq->intr.index); ++ ++ ret = ionic_adminq_post_wait(lif, &ctx); ++ if (ret) ++ return ret; ++ ++ if (qcq->napi.poll) ++ napi_enable(&qcq->napi); ++ + if (qcq->flags & IONIC_QCQ_F_INTR) { + irq_set_affinity_hint(qcq->intr.vector, + &qcq->intr.affinity_mask); +- napi_enable(&qcq->napi); +- ionic_intr_clean(idev->intr_ctrl, qcq->intr.index); + ionic_intr_mask(idev->intr_ctrl, qcq->intr.index, + IONIC_INTR_MASK_CLEAR); + } + +- return ionic_adminq_post_wait(lif, &ctx); ++ return 0; + } + + static int ionic_qcq_disable(struct ionic_qcq *qcq, bool send_to_hw) +-- +2.39.0 + diff --git a/queue-5.10/net-mlx5-fw_tracer-clear-load-bit-when-freeing-strin.patch b/queue-5.10/net-mlx5-fw_tracer-clear-load-bit-when-freeing-strin.patch new file mode 100644 index 00000000000..b364ddc3d11 --- /dev/null +++ b/queue-5.10/net-mlx5-fw_tracer-clear-load-bit-when-freeing-strin.patch @@ -0,0 +1,40 @@ +From fdb7e38670dd1e8cb6a539639e16aa94d52f1d92 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 9 Jan 2023 15:27:40 +0200 +Subject: net/mlx5: fw_tracer, Clear load bit when freeing string DBs buffers + +From: Shay Drory + +[ Upstream commit db561fed6b8fa3878e74d5df6512a4a38152b63e ] + +Whenever the driver is reading the string DBs into buffers, the driver +is setting the load bit, but the driver never clears this bit. +As a result, in case load bit is on and the driver query the device for +new string DBs, the driver won't read again the string DBs. +Fix it by clearing the load bit when query the device for new string +DBs. + +Fixes: 2d69356752ff ("net/mlx5: Add support for fw live patch event") +Signed-off-by: Shay Drory +Reviewed-by: Moshe Shemesh +Signed-off-by: Saeed Mahameed +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +index f800e1ca5ba62..76232abfc7863 100644 +--- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +@@ -64,6 +64,7 @@ static int mlx5_query_mtrc_caps(struct mlx5_fw_tracer *tracer) + MLX5_GET(mtrc_cap, out, num_string_trace); + tracer->str_db.num_string_db = MLX5_GET(mtrc_cap, out, num_string_db); + tracer->owner = !!MLX5_GET(mtrc_cap, out, trace_owner); ++ tracer->str_db.loaded = false; + + for (i = 0; i < tracer->str_db.num_string_db; i++) { + mtrc_cap_sp = MLX5_ADDR_OF(mtrc_cap, out, string_db_param[i]); +-- +2.39.0 + diff --git a/queue-5.10/net-mlx5-fw_tracer-zero-consumer-index-when-reloadin.patch b/queue-5.10/net-mlx5-fw_tracer-zero-consumer-index-when-reloadin.patch new file mode 100644 index 00000000000..a7c7e95e384 --- /dev/null +++ b/queue-5.10/net-mlx5-fw_tracer-zero-consumer-index-when-reloadin.patch @@ -0,0 +1,45 @@ +From d56199516f084425536daaffc01469ccc7bcd129 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 25 Jan 2023 17:39:36 +0200 +Subject: net/mlx5: fw_tracer, Zero consumer index when reloading the tracer + +From: Shay Drory + +[ Upstream commit 184e1e4474dbcfebc4dbd1fa823a329978f25506 ] + +When tracer is reloaded, the device will log the traces at the +beginning of the log buffer. Also, driver is reading the log buffer in +chunks in accordance to the consumer index. +Hence, zero consumer index when reloading the tracer. + +Fixes: 4383cfcc65e7 ("net/mlx5: Add devlink reload") +Signed-off-by: Shay Drory +Signed-off-by: Saeed Mahameed +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +index 76232abfc7863..40d7bfca37499 100644 +--- a/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c +@@ -757,6 +757,7 @@ static int mlx5_fw_tracer_set_mtrc_conf(struct mlx5_fw_tracer *tracer) + if (err) + mlx5_core_warn(dev, "FWTracer: Failed to set tracer configurations %d\n", err); + ++ tracer->buff.consumer_index = 0; + return err; + } + +@@ -821,7 +822,6 @@ static void mlx5_fw_tracer_ownership_change(struct work_struct *work) + mlx5_core_dbg(tracer->dev, "FWTracer: ownership changed, current=(%d)\n", tracer->owner); + if (tracer->owner) { + tracer->owner = false; +- tracer->buff.consumer_index = 0; + return; + } + +-- +2.39.0 + diff --git a/queue-5.10/net-mlx5e-ipoib-show-unknown-speed-instead-of-error.patch b/queue-5.10/net-mlx5e-ipoib-show-unknown-speed-instead-of-error.patch new file mode 100644 index 00000000000..99053659bf0 --- /dev/null +++ b/queue-5.10/net-mlx5e-ipoib-show-unknown-speed-instead-of-error.patch @@ -0,0 +1,96 @@ +From a14e1791988986caff27f409f2f3e6dbf90a7678 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 23 Jan 2023 16:06:32 +0200 +Subject: net/mlx5e: IPoIB, Show unknown speed instead of error + +From: Dragos Tatulea + +[ Upstream commit 8aa5f171d51c1cb69e5e3106df4dd1a446102823 ] + +ethtool is returning an error for unknown speeds for the IPoIB interface: + +$ ethtool ib0 +netlink error: failed to retrieve link settings +netlink error: Invalid argument +netlink error: failed to retrieve link settings +netlink error: Invalid argument +Settings for ib0: +Link detected: no + +After this change, ethtool will return success and show "unknown speed": + +$ ethtool ib0 +Settings for ib0: +Supported ports: [ ] +Supported link modes: Not reported +Supported pause frame use: No +Supports auto-negotiation: No +Supported FEC modes: Not reported +Advertised link modes: Not reported +Advertised pause frame use: No +Advertised auto-negotiation: No +Advertised FEC modes: Not reported +Speed: Unknown! +Duplex: Full +Auto-negotiation: off +Port: Other +PHYAD: 0 +Transceiver: internal +Link detected: no + +Fixes: eb234ee9d541 ("net/mlx5e: IPoIB, Add support for get_link_ksettings in ethtool") +Signed-off-by: Dragos Tatulea +Reviewed-by: Gal Pressman +Reviewed-by: Tariq Toukan +Signed-off-by: Saeed Mahameed +Signed-off-by: Sasha Levin +--- + .../net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c +index cac8f085b16d7..2cf7f0fc170b8 100644 +--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c +@@ -166,16 +166,16 @@ static inline int mlx5_ptys_rate_enum_to_int(enum mlx5_ptys_rate rate) + } + } + +-static int mlx5i_get_speed_settings(u16 ib_link_width_oper, u16 ib_proto_oper) ++static u32 mlx5i_get_speed_settings(u16 ib_link_width_oper, u16 ib_proto_oper) + { + int rate, width; + + rate = mlx5_ptys_rate_enum_to_int(ib_proto_oper); + if (rate < 0) +- return -EINVAL; ++ return SPEED_UNKNOWN; + width = mlx5_ptys_width_enum_to_int(ib_link_width_oper); + if (width < 0) +- return -EINVAL; ++ return SPEED_UNKNOWN; + + return rate * width; + } +@@ -198,16 +198,13 @@ static int mlx5i_get_link_ksettings(struct net_device *netdev, + ethtool_link_ksettings_zero_link_mode(link_ksettings, advertising); + + speed = mlx5i_get_speed_settings(ib_link_width_oper, ib_proto_oper); +- if (speed < 0) +- return -EINVAL; ++ link_ksettings->base.speed = speed; ++ link_ksettings->base.duplex = speed == SPEED_UNKNOWN ? DUPLEX_UNKNOWN : DUPLEX_FULL; + +- link_ksettings->base.duplex = DUPLEX_FULL; + link_ksettings->base.port = PORT_OTHER; + + link_ksettings->base.autoneg = AUTONEG_DISABLE; + +- link_ksettings->base.speed = speed; +- + return 0; + } + +-- +2.39.0 + diff --git a/queue-5.10/net-mscc-ocelot-fix-vcap-filters-not-matching-on-mac.patch b/queue-5.10/net-mscc-ocelot-fix-vcap-filters-not-matching-on-mac.patch new file mode 100644 index 00000000000..6fb81356dde --- /dev/null +++ b/queue-5.10/net-mscc-ocelot-fix-vcap-filters-not-matching-on-mac.patch @@ -0,0 +1,113 @@ +From 800a5635a239622348cb71e7794aaee07b1e1c50 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 5 Feb 2023 21:24:08 +0200 +Subject: net: mscc: ocelot: fix VCAP filters not matching on MAC with + "protocol 802.1Q" + +From: Vladimir Oltean + +[ Upstream commit f964f8399df29d3e3ced77177cf35131cd2491bf ] + +Alternative short title: don't instruct the hardware to match on +EtherType with "protocol 802.1Q" flower filters. It doesn't work for the +reasons detailed below. + +With a command such as the following: + +tc filter add dev $swp1 ingress chain $(IS1 2) pref 3 \ + protocol 802.1Q flower skip_sw vlan_id 200 src_mac $h1_mac \ + action vlan modify id 300 \ + action goto chain $(IS2 0 0) + +the created filter is set by ocelot_flower_parse_key() to be of type +OCELOT_VCAP_KEY_ETYPE, and etype is set to {value=0x8100, mask=0xffff}. +This gets propagated all the way to is1_entry_set() which commits it to +hardware (the VCAP_IS1_HK_ETYPE field of the key). Compare this to the +case where src_mac isn't specified - the key type is OCELOT_VCAP_KEY_ANY, +and is1_entry_set() doesn't populate VCAP_IS1_HK_ETYPE. + +The problem is that for VLAN-tagged frames, the hardware interprets the +ETYPE field as holding the encapsulated VLAN protocol. So the above +filter will only match those packets which have an encapsulated protocol +of 0x8100, rather than all packets with VLAN ID 200 and the given src_mac. + +The reason why this is allowed to occur is because, although we have a +block of code in ocelot_flower_parse_key() which sets "match_protocol" +to false when VLAN keys are present, that code executes too late. +There is another block of code, which executes for Ethernet addresses, +and has a "goto finished_key_parsing" and skips the VLAN header parsing. +By skipping it, "match_protocol" remains with the value it was +initialized with, i.e. "true", and "proto" is set to f->common.protocol, +or 0x8100. + +The concept of ignoring some keys rather than erroring out when they are +present but can't be offloaded is dubious in itself, but is present +since the initial commit fe3490e6107e ("net: mscc: ocelot: Hardware +ofload for tc flower filter"), and it's outside of the scope of this +patch to change that. + +The problem was introduced when the driver started to interpret the +flower filter's protocol, and populate the VCAP filter's ETYPE field +based on it. + +To fix this, it is sufficient to move the code that parses the VLAN keys +earlier than the "goto finished_key_parsing" instruction. This will +ensure that if we have a flower filter with both VLAN and Ethernet +address keys, it won't match on ETYPE 0x8100, because the VLAN key +parsing sets "match_protocol = false". + +Fixes: 86b956de119c ("net: mscc: ocelot: support matching on EtherType") +Signed-off-by: Vladimir Oltean +Reviewed-by: Simon Horman +Link: https://lore.kernel.org/r/20230205192409.1796428-1-vladimir.oltean@nxp.com +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/mscc/ocelot_flower.c | 24 +++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/drivers/net/ethernet/mscc/ocelot_flower.c b/drivers/net/ethernet/mscc/ocelot_flower.c +index b221b83ec5a6f..e56e540ce05c3 100644 +--- a/drivers/net/ethernet/mscc/ocelot_flower.c ++++ b/drivers/net/ethernet/mscc/ocelot_flower.c +@@ -468,6 +468,18 @@ ocelot_flower_parse_key(struct ocelot *ocelot, int port, bool ingress, + flow_rule_match_control(rule, &match); + } + ++ if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { ++ struct flow_match_vlan match; ++ ++ flow_rule_match_vlan(rule, &match); ++ filter->key_type = OCELOT_VCAP_KEY_ANY; ++ filter->vlan.vid.value = match.key->vlan_id; ++ filter->vlan.vid.mask = match.mask->vlan_id; ++ filter->vlan.pcp.value[0] = match.key->vlan_priority; ++ filter->vlan.pcp.mask[0] = match.mask->vlan_priority; ++ match_protocol = false; ++ } ++ + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { + struct flow_match_eth_addrs match; + +@@ -600,18 +612,6 @@ ocelot_flower_parse_key(struct ocelot *ocelot, int port, bool ingress, + match_protocol = false; + } + +- if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { +- struct flow_match_vlan match; +- +- flow_rule_match_vlan(rule, &match); +- filter->key_type = OCELOT_VCAP_KEY_ANY; +- filter->vlan.vid.value = match.key->vlan_id; +- filter->vlan.vid.mask = match.mask->vlan_id; +- filter->vlan.pcp.value[0] = match.key->vlan_priority; +- filter->vlan.pcp.mask[0] = match.mask->vlan_priority; +- match_protocol = false; +- } +- + finished_key_parsing: + if (match_protocol && proto != ETH_P_ALL) { + if (filter->block_id == VCAP_ES0) { +-- +2.39.0 + diff --git a/queue-5.10/net-phy-meson-gxl-use-mmd-access-dummy-stubs-for-gxl.patch b/queue-5.10/net-phy-meson-gxl-use-mmd-access-dummy-stubs-for-gxl.patch new file mode 100644 index 00000000000..f5b76cccd64 --- /dev/null +++ b/queue-5.10/net-phy-meson-gxl-use-mmd-access-dummy-stubs-for-gxl.patch @@ -0,0 +1,40 @@ +From f7104d4cdcc762c29ad13895884663ec942aecdc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 2 Feb 2023 21:45:36 +0100 +Subject: net: phy: meson-gxl: use MMD access dummy stubs for GXL, internal PHY + +From: Heiner Kallweit + +[ Upstream commit 69ff53e4a4c9498eeed7d1441f68a1481dc69251 ] + +Jerome provided the information that also the GXL internal PHY doesn't +support MMD register access and EEE. MMD reads return 0xffff, what +results in e.g. completely wrong ethtool --show-eee output. +Therefore use the MMD dummy stubs. + +Fixes: d853d145ea3e ("net: phy: add an option to disable EEE advertisement") +Suggested-by: Jerome Brunet +Signed-off-by: Heiner Kallweit +Link: https://lore.kernel.org/r/84432fe4-0be4-bc82-4e5c-557206b40f56@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/phy/meson-gxl.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c +index f7a9e6599a642..39151ec6f65e2 100644 +--- a/drivers/net/phy/meson-gxl.c ++++ b/drivers/net/phy/meson-gxl.c +@@ -235,6 +235,8 @@ static struct phy_driver meson_gxl_phy[] = { + .config_intr = meson_gxl_config_intr, + .suspend = genphy_suspend, + .resume = genphy_resume, ++ .read_mmd = genphy_read_mmd_unsupported, ++ .write_mmd = genphy_write_mmd_unsupported, + }, { + PHY_ID_MATCH_EXACT(0x01803301), + .name = "Meson G12A Internal PHY", +-- +2.39.0 + diff --git a/queue-5.10/rdma-usnic-use-iommu_map_atomic-under-spin_lock.patch b/queue-5.10/rdma-usnic-use-iommu_map_atomic-under-spin_lock.patch new file mode 100644 index 00000000000..f06d6895045 --- /dev/null +++ b/queue-5.10/rdma-usnic-use-iommu_map_atomic-under-spin_lock.patch @@ -0,0 +1,51 @@ +From e927dacec0e2d7a7b930b919f5c884b035e91d34 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 29 Jan 2023 17:37:57 +0800 +Subject: RDMA/usnic: use iommu_map_atomic() under spin_lock() + +From: Yang Yingliang + +[ Upstream commit b7e08a5a63a11627601915473c3b569c1f6c6c06 ] + +usnic_uiom_map_sorted_intervals() is called under spin_lock(), iommu_map() +might sleep, use iommu_map_atomic() to avoid potential sleep in atomic +context. + +Fixes: e3cf00d0a87f ("IB/usnic: Add Cisco VIC low-level hardware driver") +Signed-off-by: Yang Yingliang +Link: https://lore.kernel.org/r/20230129093757.637354-1-yangyingliang@huawei.com +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/usnic/usnic_uiom.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/infiniband/hw/usnic/usnic_uiom.c b/drivers/infiniband/hw/usnic/usnic_uiom.c +index 760b254ba42d6..48a57568cad69 100644 +--- a/drivers/infiniband/hw/usnic/usnic_uiom.c ++++ b/drivers/infiniband/hw/usnic/usnic_uiom.c +@@ -281,8 +281,8 @@ static int usnic_uiom_map_sorted_intervals(struct list_head *intervals, + size = pa_end - pa_start + PAGE_SIZE; + usnic_dbg("va 0x%lx pa %pa size 0x%zx flags 0x%x", + va_start, &pa_start, size, flags); +- err = iommu_map(pd->domain, va_start, pa_start, +- size, flags); ++ err = iommu_map_atomic(pd->domain, va_start, ++ pa_start, size, flags); + if (err) { + usnic_err("Failed to map va 0x%lx pa %pa size 0x%zx with err %d\n", + va_start, &pa_start, size, err); +@@ -298,8 +298,8 @@ static int usnic_uiom_map_sorted_intervals(struct list_head *intervals, + size = pa - pa_start + PAGE_SIZE; + usnic_dbg("va 0x%lx pa %pa size 0x%zx flags 0x%x\n", + va_start, &pa_start, size, flags); +- err = iommu_map(pd->domain, va_start, pa_start, +- size, flags); ++ err = iommu_map_atomic(pd->domain, va_start, ++ pa_start, size, flags); + if (err) { + usnic_err("Failed to map va 0x%lx pa %pa size 0x%zx with err %d\n", + va_start, &pa_start, size, err); +-- +2.39.0 + diff --git a/queue-5.10/rds-rds_rm_zerocopy_callback-use-list_first_entry.patch b/queue-5.10/rds-rds_rm_zerocopy_callback-use-list_first_entry.patch new file mode 100644 index 00000000000..58340c95365 --- /dev/null +++ b/queue-5.10/rds-rds_rm_zerocopy_callback-use-list_first_entry.patch @@ -0,0 +1,44 @@ +From 6269ed951cc7dea4cdd561fada78b9bcdb55d0c7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 7 Feb 2023 18:26:34 +0000 +Subject: rds: rds_rm_zerocopy_callback() use list_first_entry() + +From: Pietro Borrello + +[ Upstream commit f753a68980cf4b59a80fe677619da2b1804f526d ] + +rds_rm_zerocopy_callback() uses list_entry() on the head of a list +causing a type confusion. +Use list_first_entry() to actually access the first element of the +rs_zcookie_queue list. + +Fixes: 9426bbc6de99 ("rds: use list structure to track information for zerocopy completion notification") +Reviewed-by: Willem de Bruijn +Signed-off-by: Pietro Borrello +Link: https://lore.kernel.org/r/20230202-rds-zerocopy-v3-1-83b0df974f9a@diag.uniroma1.it +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + net/rds/message.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/net/rds/message.c b/net/rds/message.c +index 799034e0f513d..b363ef13c75ef 100644 +--- a/net/rds/message.c ++++ b/net/rds/message.c +@@ -104,9 +104,9 @@ static void rds_rm_zerocopy_callback(struct rds_sock *rs, + spin_lock_irqsave(&q->lock, flags); + head = &q->zcookie_head; + if (!list_empty(head)) { +- info = list_entry(head, struct rds_msg_zcopy_info, +- rs_zcookie_next); +- if (info && rds_zcookie_add(info, cookie)) { ++ info = list_first_entry(head, struct rds_msg_zcopy_info, ++ rs_zcookie_next); ++ if (rds_zcookie_add(info, cookie)) { + spin_unlock_irqrestore(&q->lock, flags); + kfree(rds_info_from_znotifier(znotif)); + /* caller invokes rds_wake_sk_sleep() */ +-- +2.39.0 + diff --git a/queue-5.10/selftests-forwarding-lib-quote-the-sysctl-values.patch b/queue-5.10/selftests-forwarding-lib-quote-the-sysctl-values.patch new file mode 100644 index 00000000000..dbb2d114f6b --- /dev/null +++ b/queue-5.10/selftests-forwarding-lib-quote-the-sysctl-values.patch @@ -0,0 +1,46 @@ +From 89888543a5e43241645ecb335f84dbd8f18f518c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 8 Feb 2023 11:21:10 +0800 +Subject: selftests: forwarding: lib: quote the sysctl values + +From: Hangbin Liu + +[ Upstream commit 3a082086aa200852545cf15159213582c0c80eba ] + +When set/restore sysctl value, we should quote the value as some keys +may have multi values, e.g. net.ipv4.ping_group_range + +Fixes: f5ae57784ba8 ("selftests: forwarding: lib: Add sysctl_set(), sysctl_restore()") +Signed-off-by: Hangbin Liu +Reviewed-by: Petr Machata +Link: https://lore.kernel.org/r/20230208032110.879205-1-liuhangbin@gmail.com +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/net/forwarding/lib.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh +index 54020d05a62b8..9605e158a0bfc 100644 +--- a/tools/testing/selftests/net/forwarding/lib.sh ++++ b/tools/testing/selftests/net/forwarding/lib.sh +@@ -731,14 +731,14 @@ sysctl_set() + local value=$1; shift + + SYSCTL_ORIG[$key]=$(sysctl -n $key) +- sysctl -qw $key=$value ++ sysctl -qw $key="$value" + } + + sysctl_restore() + { + local key=$1; shift + +- sysctl -qw $key=${SYSCTL_ORIG["$key"]} ++ sysctl -qw $key="${SYSCTL_ORIG[$key]}" + } + + forwarding_enable() +-- +2.39.0 + diff --git a/queue-5.10/series b/queue-5.10/series index 32feda5db8f..fe453864bd4 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -103,3 +103,21 @@ alsa-hda-realtek-fix-the-speaker-output-on-samsung-galaxy-book2-pro-360.patch tracing-fix-poll-and-select-do-not-work-on-per_cpu-trace_pipe-and-trace_pipe_raw.patch of-address-return-an-error-when-no-valid-dma-ranges-are-found.patch can-j1939-do-not-wait-250-ms-if-the-same-addr-was-already-claimed.patch +xfrm-compat-change-expression-for-switch-in-xfrm_xla.patch +ib-hfi1-restore-allocated-resources-on-failed-copyou.patch +xfrm-compat-prevent-potential-spectre-v1-gadget-in-x.patch +ib-ipoib-fix-legacy-ipoib-due-to-wrong-number-of-que.patch +rdma-usnic-use-iommu_map_atomic-under-spin_lock.patch +xfrm-fix-bug-with-dscp-copy-to-v6-from-v4-tunnel.patch +bonding-fix-error-checking-in-bond_debug_reregister.patch +net-phy-meson-gxl-use-mmd-access-dummy-stubs-for-gxl.patch +ionic-clean-interrupt-before-enabling-queue-to-avoid.patch +uapi-add-missing-ip-ipv6-header-dependencies-for-lin.patch +ice-do-not-use-wq_mem_reclaim-flag-for-workqueue.patch +net-mscc-ocelot-fix-vcap-filters-not-matching-on-mac.patch +net-mlx5e-ipoib-show-unknown-speed-instead-of-error.patch +net-mlx5-fw_tracer-clear-load-bit-when-freeing-strin.patch +net-mlx5-fw_tracer-zero-consumer-index-when-reloadin.patch +rds-rds_rm_zerocopy_callback-use-list_first_entry.patch +selftests-forwarding-lib-quote-the-sysctl-values.patch +alsa-pci-lx6464es-fix-a-debug-loop.patch diff --git a/queue-5.10/uapi-add-missing-ip-ipv6-header-dependencies-for-lin.patch b/queue-5.10/uapi-add-missing-ip-ipv6-header-dependencies-for-lin.patch new file mode 100644 index 00000000000..4f83e14ad22 --- /dev/null +++ b/queue-5.10/uapi-add-missing-ip-ipv6-header-dependencies-for-lin.patch @@ -0,0 +1,70 @@ +From 3e9ee9e2719539d466c1cd1e5507b90055756ab4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 3 Feb 2023 13:04:48 -0300 +Subject: uapi: add missing ip/ipv6 header dependencies for linux/stddef.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Herton R. Krzesinski + +[ Upstream commit 03702d4d29be4e2510ec80b248dbbde4e57030d9 ] + +Since commit 58e0be1ef6118 ("net: use struct_group to copy ip/ipv6 +header addresses"), ip and ipv6 headers started to use the __struct_group +definition, which is defined at include/uapi/linux/stddef.h. However, +linux/stddef.h isn't explicitly included in include/uapi/linux/{ip,ipv6}.h, +which breaks build of xskxceiver bpf selftest if you install the uapi +headers in the system: + +$ make V=1 xskxceiver -C tools/testing/selftests/bpf +... +make: Entering directory '(...)/tools/testing/selftests/bpf' +gcc -g -O0 -rdynamic -Wall -Werror (...) +In file included from xskxceiver.c:79: +/usr/include/linux/ip.h:103:9: error: expected specifier-qualifier-list before ‘__struct_group’ + 103 | __struct_group(/* no tag */, addrs, /* no attrs */, + | ^~~~~~~~~~~~~~ +... + +Include the missing dependency in ip.h and do the +same for the ipv6.h header. + +Fixes: 58e0be1ef611 ("net: use struct_group to copy ip/ipv6 header addresses") +Signed-off-by: Herton R. Krzesinski +Reviewed-by: Carlos O'Donell +Tested-by: Carlos O'Donell +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + include/uapi/linux/ip.h | 1 + + include/uapi/linux/ipv6.h | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h +index d2f143393780c..860bbf6bf29cb 100644 +--- a/include/uapi/linux/ip.h ++++ b/include/uapi/linux/ip.h +@@ -18,6 +18,7 @@ + #ifndef _UAPI_LINUX_IP_H + #define _UAPI_LINUX_IP_H + #include ++#include + #include + + #define IPTOS_TOS_MASK 0x1E +diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h +index 766ab5c8ee655..d44d0483fd73f 100644 +--- a/include/uapi/linux/ipv6.h ++++ b/include/uapi/linux/ipv6.h +@@ -4,6 +4,7 @@ + + #include + #include ++#include + #include + #include + +-- +2.39.0 + diff --git a/queue-5.10/xfrm-compat-change-expression-for-switch-in-xfrm_xla.patch b/queue-5.10/xfrm-compat-change-expression-for-switch-in-xfrm_xla.patch new file mode 100644 index 00000000000..08dfecda8c7 --- /dev/null +++ b/queue-5.10/xfrm-compat-change-expression-for-switch-in-xfrm_xla.patch @@ -0,0 +1,41 @@ +From 3531b9d6f4f703818daa221a1598f0ec3863521a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 10 Jan 2023 12:14:50 +0300 +Subject: xfrm: compat: change expression for switch in xfrm_xlate64 + +From: Anastasia Belova + +[ Upstream commit eb6c59b735aa6cca77cdbb59cc69d69a0d63d986 ] + +Compare XFRM_MSG_NEWSPDINFO (value from netlink +configuration messages enum) with nlh_src->nlmsg_type +instead of nlh_src->nlmsg_type - XFRM_MSG_BASE. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Fixes: 4e9505064f58 ("net/xfrm/compat: Copy xfrm_spdattr_type_t atributes") +Signed-off-by: Anastasia Belova +Acked-by: Dmitry Safonov <0x7f454c46@gmail.com> +Tested-by: Dmitry Safonov <0x7f454c46@gmail.com> +Signed-off-by: Steffen Klassert +Signed-off-by: Sasha Levin +--- + net/xfrm/xfrm_compat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/xfrm/xfrm_compat.c b/net/xfrm/xfrm_compat.c +index a0f62fa02e06e..12405aa5bce84 100644 +--- a/net/xfrm/xfrm_compat.c ++++ b/net/xfrm/xfrm_compat.c +@@ -302,7 +302,7 @@ static int xfrm_xlate64(struct sk_buff *dst, const struct nlmsghdr *nlh_src) + nla_for_each_attr(nla, attrs, len, remaining) { + int err; + +- switch (type) { ++ switch (nlh_src->nlmsg_type) { + case XFRM_MSG_NEWSPDINFO: + err = xfrm_nla_cpy(dst, nla, nla_len(nla)); + break; +-- +2.39.0 + diff --git a/queue-5.10/xfrm-compat-prevent-potential-spectre-v1-gadget-in-x.patch b/queue-5.10/xfrm-compat-prevent-potential-spectre-v1-gadget-in-x.patch new file mode 100644 index 00000000000..e40fe58dd69 --- /dev/null +++ b/queue-5.10/xfrm-compat-prevent-potential-spectre-v1-gadget-in-x.patch @@ -0,0 +1,58 @@ +From 3e195d43b8cbaff55fd0c2a2156664dfa3d5d085 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 20 Jan 2023 13:02:49 +0000 +Subject: xfrm/compat: prevent potential spectre v1 gadget in + xfrm_xlate32_attr() + +From: Eric Dumazet + +[ Upstream commit b6ee896385380aa621102e8ea402ba12db1cabff ] + + int type = nla_type(nla); + + if (type > XFRMA_MAX) { + return -EOPNOTSUPP; + } + +@type is then used as an array index and can be used +as a Spectre v1 gadget. + + if (nla_len(nla) < compat_policy[type].len) { + +array_index_nospec() can be used to prevent leaking +content of kernel memory to malicious users. + +Fixes: 5106f4a8acff ("xfrm/compat: Add 32=>64-bit messages translator") +Signed-off-by: Eric Dumazet +Cc: Dmitry Safonov +Cc: Steffen Klassert +Reviewed-by: Dmitry Safonov +Signed-off-by: Steffen Klassert +Signed-off-by: Sasha Levin +--- + net/xfrm/xfrm_compat.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/net/xfrm/xfrm_compat.c b/net/xfrm/xfrm_compat.c +index 12405aa5bce84..8cbf45a8bcdc2 100644 +--- a/net/xfrm/xfrm_compat.c ++++ b/net/xfrm/xfrm_compat.c +@@ -5,6 +5,7 @@ + * Based on code and translator idea by: Florian Westphal + */ + #include ++#include + #include + #include + +@@ -437,6 +438,7 @@ static int xfrm_xlate32_attr(void *dst, const struct nlattr *nla, + NL_SET_ERR_MSG(extack, "Bad attribute"); + return -EOPNOTSUPP; + } ++ type = array_index_nospec(type, XFRMA_MAX + 1); + if (nla_len(nla) < compat_policy[type].len) { + NL_SET_ERR_MSG(extack, "Attribute bad length"); + return -EOPNOTSUPP; +-- +2.39.0 + diff --git a/queue-5.10/xfrm-fix-bug-with-dscp-copy-to-v6-from-v4-tunnel.patch b/queue-5.10/xfrm-fix-bug-with-dscp-copy-to-v6-from-v4-tunnel.patch new file mode 100644 index 00000000000..ce7802bed63 --- /dev/null +++ b/queue-5.10/xfrm-fix-bug-with-dscp-copy-to-v6-from-v4-tunnel.patch @@ -0,0 +1,39 @@ +From 3ecbf0ac2f059838a370b84b23d36f43499ac1bf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Jan 2023 11:33:50 -0500 +Subject: xfrm: fix bug with DSCP copy to v6 from v4 tunnel + +From: Christian Hopps + +[ Upstream commit 6028da3f125fec34425dbd5fec18e85d372b2af6 ] + +When copying the DSCP bits for decap-dscp into IPv6 don't assume the +outer encap is always IPv6. Instead, as with the inner IPv4 case, copy +the DSCP bits from the correctly saved "tos" value in the control block. + +Fixes: 227620e29509 ("[IPSEC]: Separate inner/outer mode processing on input") +Signed-off-by: Christian Hopps +Acked-by: Herbert Xu +Signed-off-by: Steffen Klassert +Signed-off-by: Sasha Levin +--- + net/xfrm/xfrm_input.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c +index 77e82033ad700..fef99a1c5df10 100644 +--- a/net/xfrm/xfrm_input.c ++++ b/net/xfrm/xfrm_input.c +@@ -277,8 +277,7 @@ static int xfrm6_remove_tunnel_encap(struct xfrm_state *x, struct sk_buff *skb) + goto out; + + if (x->props.flags & XFRM_STATE_DECAP_DSCP) +- ipv6_copy_dscp(ipv6_get_dsfield(ipv6_hdr(skb)), +- ipipv6_hdr(skb)); ++ ipv6_copy_dscp(XFRM_MODE_SKB_CB(skb)->tos, ipipv6_hdr(skb)); + if (!(x->props.flags & XFRM_STATE_NOECN)) + ipip6_ecn_decapsulate(skb); + +-- +2.39.0 +