6.6.94-rc1 review
Subsystems (3)
Greg Kroah-Hartman
maintainerPATCH 295/356 ptp: remove ptp->n_vclocks check logic in ptp_vclock_in_use()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeongjun Park <[email protected]>
[ Upstream commit 87f7ce260a3c838b49e1dc1ceedf1006795157a2 ]
There is no disagreement that we should check both ptp->is_virtual_clock and ptp->n_vclocks to check if the ptp virtual clock is in use.
However, when we acquire ptp->n_vclocks_mux to read ptp->n_vclocks in ptp_vclock_in_use(), we observe a recursive lock in the call trace starting from n_vclocks_store().
============================================
WARNING: possible recursive locking detected 6.15.0-rc6 #1 Not tainted
--------------------------------------------
syz.0.1540/13807 is trying to acquire lock:ffff888035a24868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:
ptp_vclock_in_use drivers/ptp/ptp_private.h:103 [inline]ffff888035a24868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:
ptp_clock_unregister+0x21/0x250 drivers/ptp/ptp_clock.c:415
but task is already holding lock:ffff888030704868 (&ptp->n_vclocks_mux){+.+.}-{4:4}, at:
n_vclocks_store+0xf1/0x6d0 drivers/ptp/ptp_sysfs.c:215
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
---- lock(&ptp->n_vclocks_mux);
lock(&ptp->n_vclocks_mux);
*** DEADLOCK ***
....
============================================
The best way to solve this is to remove the logic that checks ptp->n_vclocks in ptp_vclock_in_use().
The reason why this is appropriate is that any path that uses ptp->n_vclocks must unconditionally check if ptp->n_vclocks is greater than 0 before unregistering vclocks, and all functions are already written this way. And in the function that uses ptp->n_vclocks, we already get ptp->n_vclocks_mux before unregistering vclocks.
Therefore, we need to remove the redundant check for ptp->n_vclocks in ptp_vclock_in_use() to prevent recursive locking.
--- drivers/ptp/ptp_private.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/ptp/ptp_private.h +1 -11
@@ -89,17 +89,7 @@ static inline int queue_cnt(const struct timestamp_event_queue *q)/* Check if ptp virtual clock is in use */ static inline bool ptp_vclock_in_use (struct ptp_clock *ptp) { -bool in_use = false; - -if (mutex_lock_interruptible (&ptp->n_vclocks_mux)) -return true; - -if (!ptp->is_virtual_clock && ptp->n_vclocks) - in_use = true; - -mutex_unlock (&ptp->n_vclocks_mux); - -return in_use; +return !ptp->is_virtual_clock; }/* Check if ptp clock shall be free running */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 296/356 ath10k: snoc: fix unbalanced IRQ enable in crash recovery
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Caleb Connolly <[email protected]>
[ Upstream commit 1650d32b92b01db03a1a95d69ee74fcbc34d4b00 ]
In ath10k_snoc_hif_stop() we skip disabling the IRQs in the crash recovery flow, but we still unconditionally call enable again in ath10k_snoc_hif_start().
We can't check the ATH10K_FLAG_CRASH_FLUSH bit since it is cleared before hif_start() is called, so instead check the ATH10K_SNOC_FLAG_RECOVERY flag and skip enabling the IRQs during crash recovery.
This fixes unbalanced IRQ enable splats that happen after recovering from a crash.
--- drivers/net/wireless/ath/ath10k/snoc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/snoc.c +3 -1
@@ -937,7 +937,9 @@ static int ath10k_snoc_hif_start(struct ath10k *ar)dev_set_threaded (&ar->napi_dev, true);ath10k_core_napi_enable (ar); -ath10k_snoc_irq_enable (ar); +/* IRQs are left enabled when we restart due to a firmware crash */ +if (!test_bit (ATH10K_SNOC_FLAG_RECOVERY , &ar_snoc->flags)) +ath10k_snoc_irq_enable (ar);ath10k_snoc_rx_post (ar);clear_bit (ATH10K_SNOC_FLAG_RECOVERY , &ar_snoc->flags);
Signature · 1 line
2.39.5
Re: [PATCH 6.6 296/356] ath10k: snoc: fix unbalanced IRQ enable in crash recovery
Quoted 17 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Caleb Connolly <[email protected]>
[ Upstream commit
1650d32b92b01db03a1a95d69ee74fcbc34d4b00]In
ath10k_snoc_hif_stop()we skip disabling the IRQs in the crash recovery flow, but we still unconditionally call enable again inath10k_snoc_hif_start().We can't check the
ATH10K_FLAG_CRASH_FLUSHbit since it is cleared beforehif_start()is called, so instead check theATH10K_SNOC_FLAG_RECOVERYflag and skip enabling the IRQs during crash recovery.
Quoted 5 lines
This fixes unbalanced IRQ enable splats that happen after recovering from a crash.
Fixes 0e622f67e041 ("ath10k: add support for WCN3990 firmware crash recovery")Signed-off-by Caleb Connolly <[email protected]>
If fixing my name is acceptable, that would be appreciated...
Otherwise I believe this patch makes sense for 6.6
Thanks,
Quoted 23 lines
Tested-by Loic Poulain <[email protected]>Signed-off-by Jeff Johnson <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- drivers/net/wireless/ath/ath10k/snoc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/wireless/ath/ath10k/snoc.c +3
-1@@ -937,7 +937,9 @@ static int ath10k_snoc_hif_start(struct ath10k *ar)dev_set_threaded (&ar->napi_dev, true);ath10k_core_napi_enable (ar); -ath10k_snoc_irq_enable (ar); +/* IRQs are left enabled when we restart due to a firmware crash */ +if (!test_bit (ATH10K_SNOC_FLAG_RECOVERY , &ar_snoc->flags)) +ath10k_snoc_irq_enable (ar);ath10k_snoc_rx_post (ar);clear_bit (ATH10K_SNOC_FLAG_RECOVERY , &ar_snoc->flags);
Signature · 1 line
Casey (she/they)
Greg Kroah-Hartman
maintainerRe: [PATCH 6.6 296/356] ath10k: snoc: fix unbalanced IRQ enable in crash recovery
Quoted 20 lines · Casey Connolly
Quoted 17 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Caleb Connolly <[email protected]>
[ Upstream commit
1650d32b92b01db03a1a95d69ee74fcbc34d4b00]In
ath10k_snoc_hif_stop()we skip disabling the IRQs in the crash recovery flow, but we still unconditionally call enable again inath10k_snoc_hif_start().We can't check the
ATH10K_FLAG_CRASH_FLUSHbit since it is cleared beforehif_start()is called, so instead check theATH10K_SNOC_FLAG_RECOVERYflag and skip enabling the IRQs during crash recovery.
Quoted 7 lines
Quoted 5 lines
This fixes unbalanced IRQ enable splats that happen after recovering from a crash.
Fixes 0e622f67e041 ("ath10k: add support for WCN3990 firmware crash recovery")Signed-off-by Caleb Connolly <[email protected]>If fixing my name is acceptable, that would be appreciated...
I can, to what? This was a cherry-pick from what is in Linus's tree right now, and what was sent to the mailing list, was that incorrect?
thanks,
greg k-h
Re: [PATCH 6.6 296/356] ath10k: snoc: fix unbalanced IRQ enable in crash recovery
Quoted 24 lines · Greg Kroah-Hartman
Quoted 23 lines · Casey Connolly
Quoted 20 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Caleb Connolly <[email protected]>
[ Upstream commit
1650d32b92b01db03a1a95d69ee74fcbc34d4b00]In
ath10k_snoc_hif_stop()we skip disabling the IRQs in the crash recovery flow, but we still unconditionally call enable again inath10k_snoc_hif_start().We can't check the
ATH10K_FLAG_CRASH_FLUSHbit since it is cleared beforehif_start()is called, so instead check theATH10K_SNOC_FLAG_RECOVERYflag and skip enabling the IRQs during crash recovery.This fixes unbalanced IRQ enable splats that happen after recovering from a crash.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Fixes 0e622f67e041 ("ath10k: add support for WCN3990 firmware crash recovery")Signed-off-by Caleb Connolly <[email protected]>If fixing my name is acceptable, that would be appreciated...
I can, to what? This was a cherry-pick from what is in Linus's tree right now, and what was sent to the mailing list, was that incorrect?
s/Caleb/Casey/ I sent this patch before updating my name.
Kind regards,
Quoted 4 lines
thanks,
greg k-h
Signature · 1 line
Casey (she/they)
Greg Kroah-Hartman
maintainerRe: [PATCH 6.6 296/356] ath10k: snoc: fix unbalanced IRQ enable in crash recovery
Quoted 30 lines · Casey Connolly
Quoted 27 lines · Greg Kroah-Hartman
Quoted 26 lines · Casey Connolly
Quoted 22 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Caleb Connolly <[email protected]>
[ Upstream commit
1650d32b92b01db03a1a95d69ee74fcbc34d4b00]In
ath10k_snoc_hif_stop()we skip disabling the IRQs in the crash recovery flow, but we still unconditionally call enable again inath10k_snoc_hif_start().We can't check the
ATH10K_FLAG_CRASH_FLUSHbit since it is cleared beforehif_start()is called, so instead check theATH10K_SNOC_FLAG_RECOVERYflag and skip enabling the IRQs during crash recovery.This fixes unbalanced IRQ enable splats that happen after recovering from a crash.
Fixes 0e622f67e041 ("ath10k: add support for WCN3990 firmware crash recovery")Signed-off-by Caleb Connolly <[email protected]>
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
If fixing my name is acceptable, that would be appreciated...
I can, to what? This was a cherry-pick from what is in Linus's tree right now, and what was sent to the mailing list, was that incorrect?
s/Caleb/Casey/ I sent this patch before updating my name.
Ah, sorry, I already did the release. I would recommend sending in a .mailmap update for the kernel so this gets caught going forward.
thanks,
greg k-h
Re: [PATCH 6.6 296/356] ath10k: snoc: fix unbalanced IRQ enable in crash recovery
Quoted 33 lines · Greg Kroah-Hartman
Quoted 32 lines · Casey Connolly
Quoted 29 lines · Greg Kroah-Hartman
Quoted 27 lines · Casey Connolly
Quoted 17 lines · Greg Kroah-Hartman
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Caleb Connolly <[email protected]>
[ Upstream commit
1650d32b92b01db03a1a95d69ee74fcbc34d4b00]In
ath10k_snoc_hif_stop()we skip disabling the IRQs in the crash recovery flow, but we still unconditionally call enable again inath10k_snoc_hif_start().We can't check the
ATH10K_FLAG_CRASH_FLUSHbit since it is cleared beforehif_start()is called, so instead check theATH10K_SNOC_FLAG_RECOVERYflag and skip enabling the IRQs during crash recovery.Quoted 5 lines
This fixes unbalanced IRQ enable splats that happen after recovering from a crash.
Fixes 0e622f67e041 ("ath10k: add support for WCN3990 firmware crash recovery")Signed-off-by Caleb Connolly <[email protected]>If fixing my name is acceptable, that would be appreciated...
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
I can, to what? This was a cherry-pick from what is in Linus's tree right now, and what was sent to the mailing list, was that incorrect?
s/Caleb/Casey/ I sent this patch before updating my name.
Ah, sorry, I already did the release. I would recommend sending in a .mailmap update for the kernel so this gets caught going forward.
Ok, no worries.
I already updated mailmap and all the other references so this shouldn't happen again, just bad timing with this patch.
Kind regards,>
Quoted 3 lines
thanks,
greg k-h
Signature · 1 line
Casey (she/they)
Greg Kroah-Hartman
maintainerPATCH 297/356 wifi: ath11k: fix soc_dp_stats debugfs file permission
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Johnson <[email protected]>
[ Upstream commit fa645e663165d69f05f95a0c3aa3b3d08f4fdeda ]
Currently the soc_dp_stats debugfs file has the following permissions:
# ls -l /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats -rw------- 1 root root 0 Mar 4 15:04 /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats
However this file does not actually support write operations -- no .write() method is registered. Therefore use the correct permissions when creating the file.
After the change:
# ls -l /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats -r-------- 1 root root 0 Mar 4 15:15 /sys/kernel/debug/ath11k/pci-0000:03:00.0/soc_dp_stats
Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30
Stable-dep-of: 9f6e82d11bb9 ("wifi: ath11k: avoid burning CPU in ath11k_debugfs_fw_stats_request()")
--- drivers/net/wireless/ath/ath11k/debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/debugfs.c +2 -2
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/vmalloc.h>
@@ -980,7 +980,7 @@ int ath11k_debugfs_pdev_create(struct ath11k_base *ab)debugfs_create_file ("simulate_fw_crash" ,0600 , ab->debugfs_soc, ab, &fops_simulate_fw_crash); -debugfs_create_file ("soc_dp_stats" ,0600 , ab->debugfs_soc, ab, +debugfs_create_file ("soc_dp_stats" ,0400 , ab->debugfs_soc, ab, &fops_soc_dp_stats);if (ab->hw_params.sram_dump.start !=0 )
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 298/356 wifi: ath11k: convert timeouts to secs_to_jiffies()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Easwar Hariharan <[email protected]>
[ Upstream commit b29425972c5234a59b6fb634125420ed74266377 ]
Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication.
This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules:
@@ constant C; @@
- msecs_to_jiffies(C * 1000)
+ secs_to_jiffies(C)
@@ constant C; @@
- msecs_to_jiffies(C * MSEC_PER_SEC)
+ secs_to_jiffies(C)
Stable-dep-of: 9f6e82d11bb9 ("wifi: ath11k: avoid burning CPU in ath11k_debugfs_fw_stats_request()")
--- drivers/net/wireless/ath/ath11k/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/debugfs.c +1 -1
@@ -178,7 +178,7 @@ static int ath11k_debugfs_fw_stats_request(struct ath11k *ar,* received 'update stats' event, we keep a 3 seconds timeout in case, * fw_stats_done is not marked yet */ - timeout = jiffies +msecs_to_jiffies (3 *1000 ); + timeout = jiffies +secs_to_jiffies (3 );ath11k_debugfs_fw_stats_reset (ar);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 299/356 wifi: ath11k: avoid burning CPU in ath11k_debugfs_fw_stats_request()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baochen Qiang <[email protected]>
[ Upstream commit 9f6e82d11bb9692a90d20b10f87345598945c803 ]
We get report [1] that CPU is running a hot loop in ath11k_debugfs_fw_stats_request():
94.60% 0.00% i3status [kernel.kallsyms] [k] do_syscall_64
|
--94.60%--do_syscall_64
|
--94.55%--__sys_sendmsg
___sys_sendmsg
____sys_sendmsg
netlink_sendmsg
netlink_unicast
genl_rcv
netlink_rcv_skb
genl_rcv_msg
|
--94.55%--genl_family_rcv_msg_dumpit
__netlink_dump_start
netlink_dump
genl_dumpit
nl80211_dump_station
|
--94.55%--ieee80211_dump_station
sta_set_sinfo
|
--94.55%--ath11k_mac_op_sta_statistics
ath11k_debugfs_get_fw_stats
|
--94.55%--ath11k_debugfs_fw_stats_request
|
|--41.73%--_raw_spin_lock_bh
|
|--22.74%--__local_bh_enable_ip
|
|--9.22%--_raw_spin_unlock_bh
|
--6.66%--srso_alias_safe_retThis is because, if for whatever reason ar->fw_stats_done is not set by ath11k_update_stats_event(), ath11k_debugfs_fw_stats_request() won't yield CPU before an up to 3s timeout.
Change to completion mechanism to avoid CPU burning.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.37
--- drivers/net/wireless/ath/ath11k/core.c | 1 + drivers/net/wireless/ath/ath11k/core.h | 2 +- drivers/net/wireless/ath/ath11k/debugfs.c | 38 +++++++++-------------- drivers/net/wireless/ath/ath11k/mac.c | 2 +- drivers/net/wireless/ath/ath11k/wmi.c | 2 +- 5 files changed, 18 insertions(+), 27 deletions(-)
drivers/net/wireless/ath/ath11k/core.c +1 -0
@@ -748,6 +748,7 @@ void ath11k_fw_stats_init(struct ath11k *ar)INIT_LIST_HEAD (&ar->fw_stats.bcn);init_completion (&ar->fw_stats_complete); +init_completion (&ar->fw_stats_done); }void ath11k_fw_stats_free (struct ath11k_fw_stats *stats)
drivers/net/wireless/ath/ath11k/core.h +1 -1
@@ -732,7 +732,7 @@ struct ath11k {u8 alpha2[REG_ALPHA2_LEN +1 ];struct ath11k_fw_stats fw_stats;struct completion fw_stats_complete; -bool fw_stats_done; +struct completion fw_stats_done;/* protected by conf_mutex */ bool ps_state_enable;
drivers/net/wireless/ath/ath11k/debugfs.c +14 -24
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/vmalloc.h>
@@ -96,7 +96,6 @@ void ath11k_debugfs_add_dbring_entry(struct ath11k *ar,static void ath11k_debugfs_fw_stats_reset (struct ath11k *ar) {spin_lock_bh (&ar->data_lock); - ar->fw_stats_done = false;ath11k_fw_stats_pdevs_free (&ar->fw_stats.pdevs);ath11k_fw_stats_vdevs_free (&ar->fw_stats.vdevs);spin_unlock_bh (&ar->data_lock);
@@ -114,7 +113,7 @@ void ath11k_debugfs_fw_stats_process(struct ath11k *ar, struct ath11k_fw_stats */* WMI_REQUEST_PDEV_STAT request has been already processed */ if (stats->stats_id ==WMI_REQUEST_RSSI_PER_CHAIN_STAT ) { - ar->fw_stats_done = true; +complete (&ar->fw_stats_done);return ; }
@@ -138,7 +137,7 @@ void ath11k_debugfs_fw_stats_process(struct ath11k *ar, struct ath11k_fw_stats * &ar->fw_stats.vdevs);if (is_end) { - ar->fw_stats_done = true; +complete (&ar->fw_stats_done); num_vdev =0 ; }return ;
@@ -158,7 +157,7 @@ void ath11k_debugfs_fw_stats_process(struct ath11k *ar, struct ath11k_fw_stats * &ar->fw_stats.bcn);if (is_end) { - ar->fw_stats_done = true; +complete (&ar->fw_stats_done); num_bcn =0 ; } }
@@ -168,21 +167,15 @@ static int ath11k_debugfs_fw_stats_request(struct ath11k *ar, struct stats_request_params *req_param) {struct ath11k_base *ab = ar->ab; -unsigned long timeout, time_left; +unsigned long time_left;int ret;lockdep_assert_held (&ar->conf_mutex); -/* FW stats can get split when exceeding the stats data buffer limit. -* In that case, since there is no end marking for the back-to-back -* received 'update stats' event, we keep a 3 seconds timeout in case, -* fw_stats_done is not marked yet -*/ - timeout = jiffies +secs_to_jiffies (3 ); -ath11k_debugfs_fw_stats_reset (ar);reinit_completion (&ar->fw_stats_complete); +reinit_completion (&ar->fw_stats_done); ret =ath11k_wmi_send_stats_request_cmd (ar, req_param);
@@ -193,21 +186,18 @@ static int ath11k_debugfs_fw_stats_request(struct ath11k *ar, } time_left =wait_for_completion_timeout (&ar->fw_stats_complete,1 *HZ ); -if (!time_left)return -ETIMEDOUT ; -for (;;) { -if (time_after (jiffies, timeout)) -break ; +/* FW stats can get split when exceeding the stats data buffer limit. +* In that case, since there is no end marking for the back-to-back +* received 'update stats' event, we keep a 3 seconds timeout in case, +* fw_stats_done is not marked yet +*/ + time_left =wait_for_completion_timeout (&ar->fw_stats_done,3 *HZ ); +if (!time_left) +return -ETIMEDOUT ; -spin_lock_bh (&ar->data_lock); -if (ar->fw_stats_done) { -spin_unlock_bh (&ar->data_lock); -break ; - } -spin_unlock_bh (&ar->data_lock); - }return 0 ; }
drivers/net/wireless/ath/ath11k/mac.c +1 -1
@@ -9010,11 +9010,11 @@ static int ath11k_fw_stats_request(struct ath11k *ar,lockdep_assert_held (&ar->conf_mutex);spin_lock_bh (&ar->data_lock); - ar->fw_stats_done = false;ath11k_fw_stats_pdevs_free (&ar->fw_stats.pdevs);spin_unlock_bh (&ar->data_lock);reinit_completion (&ar->fw_stats_complete); +reinit_completion (&ar->fw_stats_done); ret =ath11k_wmi_send_stats_request_cmd (ar, req_param);if (ret) {
drivers/net/wireless/ath/ath11k/wmi.c +1 -1
@@ -8183,7 +8183,7 @@ static void ath11k_update_stats_event(struct ath11k_base *ab, struct sk_buff *sk*/ if (stats.stats_id ==WMI_REQUEST_PDEV_STAT ) {list_splice_tail_init (&stats.pdevs, &ar->fw_stats.pdevs); - ar->fw_stats_done = true; +complete (&ar->fw_stats_done); goto complete; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 300/356 wifi: ath11k: dont use static variables in ath11k_debugfs_fw_stats_process()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baochen Qiang <[email protected]>
[ Upstream commit 2bcf73b2612dda7432f2c2eaad6679bd291791f2 ]
Currently ath11k_debugfs_fw_stats_process() is using static variables to count firmware stat events. Taking num_vdev as an example, if for whatever reason ( say ar->num_started_vdevs is 0 or firmware bug etc.) the following condition
(++num_vdev) == total_vdevs_started
is not met, is_end is not set thus num_vdev won't be cleared. Next time when firmware stats is requested again, even if everything is working fine, we will fail due to the condition above will never be satisfied.
The same applies to num_bcn as well.
Change to use non-static counters so that we have a chance to clear them each time firmware stats is requested. Currently only ath11k_fw_stats_request() and ath11k_debugfs_fw_stats_request() are requesting firmware stats, so clear counters there.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.37
--- drivers/net/wireless/ath/ath11k/core.h | 2 ++ drivers/net/wireless/ath/ath11k/debugfs.c | 16 +++++++--------- drivers/net/wireless/ath/ath11k/mac.c | 2 ++ 3 files changed, 11 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +2 -0
@@ -550,6 +550,8 @@ struct ath11k_fw_stats {struct list_head pdevs;struct list_head vdevs;struct list_head bcn; +u32 num_vdev_recvd; +u32 num_bcn_recvd; };struct ath11k_dbg_htt_stats {
drivers/net/wireless/ath/ath11k/debugfs.c +7 -9
@@ -98,6 +98,8 @@ static void ath11k_debugfs_fw_stats_reset(struct ath11k *ar)spin_lock_bh (&ar->data_lock);ath11k_fw_stats_pdevs_free (&ar->fw_stats.pdevs);ath11k_fw_stats_vdevs_free (&ar->fw_stats.vdevs); + ar->fw_stats.num_vdev_recvd =0 ; + ar->fw_stats.num_bcn_recvd =0 ;spin_unlock_bh (&ar->data_lock); }
@@ -106,7 +108,6 @@ void ath11k_debugfs_fw_stats_process(struct ath11k *ar, struct ath11k_fw_stats *struct ath11k_base *ab = ar->ab;struct ath11k_pdev *pdev;bool is_end; -static unsigned int num_vdev, num_bcn;size_t total_vdevs_started =0 ;int i;
@@ -131,15 +132,14 @@ void ath11k_debugfs_fw_stats_process(struct ath11k *ar, struct ath11k_fw_stats * total_vdevs_started += ar->num_started_vdevs; } - is_end = ((++num_vdev) == total_vdevs_started); + is_end = ((++ar->fw_stats.num_vdev_recvd) == total_vdevs_started);list_splice_tail_init (&stats->vdevs, &ar->fw_stats.vdevs); -if (is_end) { +if (is_end)complete (&ar->fw_stats_done); - num_vdev =0 ; - } +return ; }
@@ -151,15 +151,13 @@ void ath11k_debugfs_fw_stats_process(struct ath11k *ar, struct ath11k_fw_stats */* Mark end until we reached the count of all started VDEVs * within the PDEV */ - is_end = ((++num_bcn) == ar->num_started_vdevs); + is_end = ((++ar->fw_stats.num_bcn_recvd) == ar->num_started_vdevs);list_splice_tail_init (&stats->bcn, &ar->fw_stats.bcn); -if (is_end) { +if (is_end)complete (&ar->fw_stats_done); - num_bcn =0 ; - } } }
drivers/net/wireless/ath/ath11k/mac.c +2 -0
@@ -9011,6 +9011,8 @@ static int ath11k_fw_stats_request(struct ath11k *ar,spin_lock_bh (&ar->data_lock);ath11k_fw_stats_pdevs_free (&ar->fw_stats.pdevs); + ar->fw_stats.num_vdev_recvd =0 ; + ar->fw_stats.num_bcn_recvd =0 ;spin_unlock_bh (&ar->data_lock);reinit_completion (&ar->fw_stats_complete);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 301/356 wifi: ath11k: dont wait when there is no vdev started
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baochen Qiang <[email protected]>
[ Upstream commit 3b6d00fa883075dcaf49221538230e038a9c0b43 ]
For WMI_REQUEST_VDEV_STAT request, firmware might split response into multiple events dut to buffer limit, hence currently in ath11k_debugfs_fw_stats_process() we wait until all events received. In case there is no vdev started, this results in that below condition would never get satisfied
((++ar->fw_stats.num_vdev_recvd) == total_vdevs_started)
finally the requestor would be blocked until wait time out.
The same applies to WMI_REQUEST_BCN_STAT request as well due to:
((++ar->fw_stats.num_bcn_recvd) == ar->num_started_vdevs)
Change to check the number of started vdev first: if it is zero, finish wait directly; if not, follow the old way.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.37
--- drivers/net/wireless/ath/ath11k/debugfs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/debugfs.c +7 -3
@@ -107,7 +107,7 @@ void ath11k_debugfs_fw_stats_process(struct ath11k *ar, struct ath11k_fw_stats * {struct ath11k_base *ab = ar->ab;struct ath11k_pdev *pdev; -bool is_end; +bool is_end = true;size_t total_vdevs_started =0 ;int i;
@@ -132,7 +132,9 @@ void ath11k_debugfs_fw_stats_process(struct ath11k *ar, struct ath11k_fw_stats * total_vdevs_started += ar->num_started_vdevs; } - is_end = ((++ar->fw_stats.num_vdev_recvd) == total_vdevs_started); +if (total_vdevs_started) + is_end = ((++ar->fw_stats.num_vdev_recvd) == + total_vdevs_started);list_splice_tail_init (&stats->vdevs, &ar->fw_stats.vdevs);
@@ -151,7 +153,9 @@ void ath11k_debugfs_fw_stats_process(struct ath11k *ar, struct ath11k_fw_stats */* Mark end until we reached the count of all started VDEVs * within the PDEV */ - is_end = ((++ar->fw_stats.num_bcn_recvd) == ar->num_started_vdevs); +if (ar->num_started_vdevs) + is_end = ((++ar->fw_stats.num_bcn_recvd) == + ar->num_started_vdevs);list_splice_tail_init (&stats->bcn, &ar->fw_stats.bcn);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 302/356 wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_ready
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rodrigo Gobbi <[email protected]>
[ Upstream commit b0d226a60856a1b765bb9a3848c7b2322fd08c47 ]
if ath11k_crypto_mode is invalid (not ATH11K_CRYPT_MODE_SW/ATH11K_CRYPT_MODE_HW), ath11k_core_qmi_firmware_ready() will not undo some actions that was previously started/configured. Do the validation as soon as possible in order to avoid undoing actions in that case and also to fix the following smatch warning:
drivers/net/wireless/ath/ath11k/core.c:2166 ath11k_core_qmi_firmware_ready()
warn: missing unwind goto?
--- drivers/net/wireless/ath/ath11k/core.c | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/net/wireless/ath/ath11k/core.c +14 -14
@@ -1638,6 +1638,20 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab) {int ret; +switch (ath11k_crypto_mode) { +case ATH11K_CRYPT_MODE_SW : +set_bit (ATH11K_FLAG_HW_CRYPTO_DISABLED , &ab->dev_flags); +set_bit (ATH11K_FLAG_RAW_MODE , &ab->dev_flags); +break ; +case ATH11K_CRYPT_MODE_HW : +clear_bit (ATH11K_FLAG_HW_CRYPTO_DISABLED , &ab->dev_flags); +clear_bit (ATH11K_FLAG_RAW_MODE , &ab->dev_flags); +break ; +default : +ath11k_info (ab,"invalid crypto_mode: %d\n" , ath11k_crypto_mode); +return -EINVAL ; + } + ret =ath11k_core_start_firmware (ab, ab->fw_mode);if (ret) {ath11k_err (ab,"failed to start firmware: %d\n" , ret);
@@ -1656,20 +1670,6 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab) goto err_firmware_stop; } -switch (ath11k_crypto_mode) { -case ATH11K_CRYPT_MODE_SW : -set_bit (ATH11K_FLAG_HW_CRYPTO_DISABLED , &ab->dev_flags); -set_bit (ATH11K_FLAG_RAW_MODE , &ab->dev_flags); -break ; -case ATH11K_CRYPT_MODE_HW : -clear_bit (ATH11K_FLAG_HW_CRYPTO_DISABLED , &ab->dev_flags); -clear_bit (ATH11K_FLAG_RAW_MODE , &ab->dev_flags); -break ; -default : -ath11k_info (ab,"invalid crypto_mode: %d\n" , ath11k_crypto_mode); -return -EINVAL ; - } -if (ath11k_frame_mode ==ATH11K_HW_TXRX_RAW )set_bit (ATH11K_FLAG_RAW_MODE , &ab->dev_flags);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 303/356 regulator: max20086: Fix refcount leak in max20086_parse_regulators_dt()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 06118ae36855b7d3d22688298e74a766ccf0cb7a ]
There is a missing call to of_node_put() if devm_kcalloc() fails. Fix this by changing the code to use cleanup.h magic to drop the refcount.
--- drivers/regulator/max20086-regulator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/max20086-regulator.c +3 -3
@@ -5,6 +5,7 @@// Copyright (C) 2022 Laurent Pinchart <[email protected]> // Copyright (C) 2018 Avnet, Inc. +#include <linux/cleanup.h> #include <linux/err.h> #include <linux/gpio/consumer.h> #include <linux/i2c.h>
@@ -133,11 +134,11 @@ static int max20086_regulators_register(struct max20086 *chip)static int max20086_parse_regulators_dt (struct max20086 *chip,bool *boot_on) {struct of_regulator_match *matches; -struct device_node *node;unsigned int i;int ret; - node =of_get_child_by_name (chip->dev->of_node,"regulators" ); + struct device_node *node __free(device_node) = +of_get_child_by_name (chip->dev->of_node,"regulators" );if (!node) {dev_err (chip->dev,"regulators node not found\n" );return -ENODEV ;
@@ -153,7 +154,6 @@ static int max20086_parse_regulators_dt(struct max20086 *chip, bool *boot_on) ret =of_regulator_match (chip->dev, node, matches, chip->info->num_outputs); -of_node_put (node);if (ret <0 ) {dev_err (chip->dev,"Failed to match regulators\n" );return -EINVAL ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 304/356 pinctrl: qcom: pinctrl-qcm2290: Add missing pins
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wojciech Slenska <[email protected]>
[ Upstream commit 315345610faee8a0568b522dba9e35067d1732ab ]
Added the missing pins to the qcm2290_pins table.
--- drivers/pinctrl/qcom/pinctrl-qcm2290.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/pinctrl/qcom/pinctrl-qcm2290.c +9 -0
@@ -165,6 +165,10 @@ static const struct pinctrl_pin_desc qcm2290_pins[] = {PINCTRL_PIN (62 ,"GPIO_62" ),PINCTRL_PIN (63 ,"GPIO_63" ),PINCTRL_PIN (64 ,"GPIO_64" ), +PINCTRL_PIN (65 ,"GPIO_65" ), +PINCTRL_PIN (66 ,"GPIO_66" ), +PINCTRL_PIN (67 ,"GPIO_67" ), +PINCTRL_PIN (68 ,"GPIO_68" ),PINCTRL_PIN (69 ,"GPIO_69" ),PINCTRL_PIN (70 ,"GPIO_70" ), PINCTRL_PIN(71, "GPIO_71"),
@@ -179,12 +183,17 @@ static const struct pinctrl_pin_desc qcm2290_pins[] = {PINCTRL_PIN (80 ,"GPIO_80" ),PINCTRL_PIN (81 ,"GPIO_81" ),PINCTRL_PIN (82 ,"GPIO_82" ), +PINCTRL_PIN (83 ,"GPIO_83" ), +PINCTRL_PIN (84 ,"GPIO_84" ), +PINCTRL_PIN (85 ,"GPIO_85" ),PINCTRL_PIN (86 ,"GPIO_86" ),PINCTRL_PIN (87 ,"GPIO_87" ),PINCTRL_PIN (88 ,"GPIO_88" ),PINCTRL_PIN (89 ,"GPIO_89" ),PINCTRL_PIN (90 ,"GPIO_90" ),PINCTRL_PIN (91 ,"GPIO_91" ), +PINCTRL_PIN (92 ,"GPIO_92" ), +PINCTRL_PIN (93 ,"GPIO_93" ),PINCTRL_PIN (94 ,"GPIO_94" ),PINCTRL_PIN (95 ,"GPIO_95" ), PINCTRL_PIN(96, "GPIO_96"),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 305/356 scsi: iscsi: Fix incorrect error path labels for flashnode operations
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alok Tiwari <[email protected]>
[ Upstream commit 9b17621366d210ffee83262a8754086ebbde5e55 ]
Correct the error handling goto labels used when host lookup fails in various flashnode-related event handlers:
- iscsi_new_flashnode()
- iscsi_del_flashnode()
- iscsi_login_flashnode()
- iscsi_logout_flashnode()
- iscsi_logout_flashnode_sid()
scsi_host_put() is not required when shost is NULL, so jumping to the correct label avoids unnecessary operations. These functions previously jumped to the wrong goto label (put_host), which did not match the intended cleanup logic.
Use the correct exit labels (exit_new_fnode, exit_del_fnode, etc.) to ensure proper error handling. Also remove the unused put_host label under iscsi_new_flashnode() as it is no longer needed.
No functional changes beyond accurate error path correction.
--- drivers/scsi/scsi_transport_iscsi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/scsi/scsi_transport_iscsi.c +5 -6
@@ -3525,7 +3525,7 @@ static int iscsi_new_flashnode(struct iscsi_transport *transport,pr_err ("%s could not find host no %u\n" , __func__, ev->u.new_flashnode.host_no); err = -ENODEV ; - goto put_host; + goto exit_new_fnode; } index = transport->new_flashnode (shost, data, len);
@@ -3535,7 +3535,6 @@ static int iscsi_new_flashnode(struct iscsi_transport *transport,else err = -EIO ; -put_host:scsi_host_put (shost); exit_new_fnode:
@@ -3560,7 +3559,7 @@ static int iscsi_del_flashnode(struct iscsi_transport *transport,pr_err ("%s could not find host no %u\n" , __func__, ev->u.del_flashnode.host_no); err = -ENODEV ; - goto put_host; + goto exit_del_fnode; } idx = ev->u.del_flashnode.flashnode_idx;
@@ -3602,7 +3601,7 @@ static int iscsi_login_flashnode(struct iscsi_transport *transport,pr_err ("%s could not find host no %u\n" , __func__, ev->u.login_flashnode.host_no); err = -ENODEV ; - goto put_host; + goto exit_login_fnode; } idx = ev->u.login_flashnode.flashnode_idx;
@@ -3654,7 +3653,7 @@ static int iscsi_logout_flashnode(struct iscsi_transport *transport,pr_err ("%s could not find host no %u\n" , __func__, ev->u.logout_flashnode.host_no); err = -ENODEV ; - goto put_host; + goto exit_logout_fnode; } idx = ev->u.logout_flashnode.flashnode_idx;
@@ -3704,7 +3703,7 @@ static int iscsi_logout_flashnode_sid(struct iscsi_transport *transport,pr_err ("%s could not find host no %u\n" , __func__, ev->u.logout_flashnode.host_no); err = -ENODEV ; - goto put_host; + goto exit_logout_sid; } session =iscsi_session_lookup (ev->u.logout_flashnode_sid.sid);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 306/356 net_sched: sch_sfq: fix a potential crash on gso_skb handling
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 82ffbe7776d0ac084031f114167712269bf3d832 ]
SFQ has an assumption of always being able to queue at least one packet.
However, after the blamed commit, sch->q.len can be inflated by packets in sch->gso_skb, and an enqueue() on an empty SFQ qdisc can be followed by an immediate drop.
Fix sfq_drop() to properly clear q->tail in this situation.
Tested:
ip netns add lb
ip link add dev to-lb type veth peer name in-lb netns lb
ethtool -K to-lb tso off # force qdisc to requeue gso_skb
ip netns exec lb ethtool -K in-lb gro on # enable NAPI ip link set dev to-lb up
ip -netns lb link set dev in-lb up
ip addr add dev to-lb 192.168.20.1/24
ip -netns lb addr add dev in-lb 192.168.20.2/24 tc qdisc replace dev to-lb root sfq limit 100
ip netns exec lb netserver
netperf -H 192.168.20.2 -l 100 &
netperf -H 192.168.20.2 -l 100 &
netperf -H 192.168.20.2 -l 100 &
netperf -H 192.168.20.2 -l 100 &
--- net/sched/sch_sfq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/sched/sch_sfq.c +4 -1
@@ -310,7 +310,10 @@ static unsigned int sfq_drop(struct Qdisc *sch, struct sk_buff **to_free)/* It is difficult to believe, but ALL THE SLOTS HAVE LENGTH 1. */ x = q->tail->next; slot = &q->slots[x]; - q->tail->next = slot->next; +if (slot->next == x) + q->tail =NULL ;/* no more active slots */ +else + q->tail->next = slot->next; q->ht[slot->hash] =SFQ_EMPTY_SLOT ; goto drop; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 307/356 powerpc/powernv/memtrace: Fix out of bounds issue in memtrace mmap
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ritesh Harjani (IBM) <[email protected]>
[ Upstream commit cd097df4596f3a1e9d75eb8520162de1eb8485b2 ]
memtrace mmap issue has an out of bounds issue. This patch fixes the by checking that the requested mapping region size should stay within the allocated region size.
--- arch/powerpc/platforms/powernv/memtrace.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powernv/memtrace.c +6 -2
@@ -48,11 +48,15 @@ static ssize_t memtrace_read(struct file *filp, char __user *ubuf,static int memtrace_mmap (struct file *filp,struct vm_area_struct *vma) {struct memtrace_entry *ent = filp->private_data; +unsigned long ent_nrpages = ent->size >>PAGE_SHIFT ; +unsigned long vma_nrpages =vma_pages (vma); -if (ent->size < vma->vm_end - vma->vm_start) +/* The requested page offset should be within object's page count */ +if (vma->vm_pgoff >= ent_nrpages)return -EINVAL ; -if (vma->vm_pgoff <<PAGE_SHIFT >= ent->size) +/* The requested mapping range should remain within the bounds */ +if (vma_nrpages > ent_nrpages - vma->vm_pgoff)return -EINVAL ; vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 308/356 powerpc/vas: Return -EINVAL if the offset is non-zero in mmap()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haren Myneni <[email protected]>
[ Upstream commit 0d67f0dee6c9176bc09a5482dd7346e3a0f14d0b ]
The user space calls mmap() to map VAS window paste address and the kernel returns the complete mapped page for each window. So return -EINVAL if non-zero is passed for offset parameter to mmap().
See Documentation/arch/powerpc/vas-api.rst for mmap() restrictions.
--- arch/powerpc/platforms/book3s/vas-api.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/powerpc/platforms/book3s/vas-api.c +9 -0
@@ -521,6 +521,15 @@ static int coproc_mmap(struct file *fp, struct vm_area_struct *vma)return -EINVAL ; } +/* +* Map complete page to the paste address. So the user +* space should pass 0ULL to the offset parameter. +*/ +if (vma->vm_pgoff) { +pr_debug ("Page offset unsupported to map paste address\n" ); +return -EINVAL ; + } +/* Ensure instance has an open send window */ if (!txwin) {pr_err ("No send window open?\n" );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 309/356 drm/meson: use unsigned long long / Hz for frequency types
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Blumenstingl <[email protected]>
[ Upstream commit 1017560164b6bbcbc93579266926e6e96675262a ]
Christian reports that 4K output using YUV420 encoding fails with the following error:
Fatal Error, invalid HDMI vclk freq 593406
Modetest shows the following:
3840x2160 59.94 3840 4016 4104 4400 2160 2168 2178 2250 593407 flags: xxxx, xxxx, drm calculated value -------------------------------------^
This indicates that there's a (1kHz) mismatch between the clock calculated by the drm framework and the meson driver.
Relevant function call stack:
(drm framework)
-> meson_encoder_hdmi_atomic_enable()
-> meson_encoder_hdmi_set_vclk()
-> meson_vclk_setup()The video clock requested by the drm framework is 593407kHz. This is passed by meson_encoder_hdmi_atomic_enable() to meson_encoder_hdmi_set_vclk() and the following formula is applied:
- the frequency is halved (which would be 296703.5kHz) and rounded down to the next full integer, which is 296703kHz
- TMDS clock is calculated (296703kHz * 10)
- video encoder clock is calculated - this needs to match a table from meson_vclk.c and so it doubles the previously halved value again (resulting in 593406kHz)
- meson_vclk_setup() can't find (either directly, or by deriving it from 594000kHz * 1000 / 1001 and rounding to the closest integer value - which is 593407kHz as originally requested by the drm framework) a matching clock in it's internal table and errors out with "invalid HDMI vclk freq"
Fix the division precision by switching the whole meson driver to use unsigned long long (64-bit) Hz values for clock frequencies instead of unsigned int (32-bit) kHz to fix the rouding error.
Stable-dep-of: d17e61ab63fb ("drm/meson: fix debug log statement when setting the HDMI clocks")
--- drivers/gpu/drm/meson/meson_drv.c | 2 +- drivers/gpu/drm/meson/meson_drv.h | 2 +- drivers/gpu/drm/meson/meson_encoder_hdmi.c | 29 +-- drivers/gpu/drm/meson/meson_vclk.c | 195 +++++++++++---------- drivers/gpu/drm/meson/meson_vclk.h | 13 +- 5 files changed, 126 insertions(+), 115 deletions(-)
drivers/gpu/drm/meson/meson_drv.c +1 -1
@@ -168,7 +168,7 @@ static const struct meson_drm_soc_attr meson_drm_soc_attrs[] = {/* S805X/S805Y HDMI PLL won't lock for HDMI PHY freq > 1,65GHz */ { .limits = { - .max_hdmi_phy_freq = 1650000, + .max_hdmi_phy_freq = 1650000000, }, .attrs = (const struct soc_device_attribute []) { { .soc_id = "GXL (S805*)", },
drivers/gpu/drm/meson/meson_drv.h +1 -1
@@ -37,7 +37,7 @@ struct meson_drm_match_data { };struct meson_drm_soc_limits { -unsigned int max_hdmi_phy_freq; +unsigned long long max_hdmi_phy_freq; };struct meson_drm {
drivers/gpu/drm/meson/meson_encoder_hdmi.c +16 -13
@@ -70,12 +70,12 @@ static void meson_encoder_hdmi_set_vclk(struct meson_encoder_hdmi *encoder_hdmi, {struct meson_drm *priv = encoder_hdmi->priv;int vic =drm_match_cea_mode (mode); -unsigned int phy_freq; -unsigned int vclk_freq; -unsigned int venc_freq; -unsigned int hdmi_freq; +unsigned long long phy_freq; +unsigned long long vclk_freq; +unsigned long long venc_freq; +unsigned long long hdmi_freq; - vclk_freq = mode->clock; + vclk_freq = mode->clock *1000 ;/* For 420, pixel clock is half unlike venc clock */ if (encoder_hdmi->output_bus_fmt ==MEDIA_BUS_FMT_UYYVYY8_0_5X24 )
@@ -107,7 +107,8 @@ static void meson_encoder_hdmi_set_vclk(struct meson_encoder_hdmi *encoder_hdmi,if (mode->flags &DRM_MODE_FLAG_DBLCLK ) venc_freq /=2 ; -dev_dbg (priv->dev,"vclk:%d phy=%d venc=%d hdmi=%d enci=%d\n" , +dev_dbg (priv->dev, +"vclk:%lluHz phy=%lluHz venc=%lluHz hdmi=%lluHz enci=%d\n" , phy_freq, vclk_freq, venc_freq, hdmi_freq, priv->venc.hdmi_use_enci);
@@ -122,10 +123,11 @@ static enum drm_mode_status meson_encoder_hdmi_mode_valid(struct drm_bridge *bristruct meson_encoder_hdmi *encoder_hdmi =bridge_to_meson_encoder_hdmi (bridge);struct meson_drm *priv = encoder_hdmi->priv;bool is_hdmi2_sink = display_info->hdmi.scdc.supported; -unsigned int phy_freq; -unsigned int vclk_freq; -unsigned int venc_freq; -unsigned int hdmi_freq; +unsigned long long clock = mode->clock *1000 ; +unsigned long long phy_freq; +unsigned long long vclk_freq; +unsigned long long venc_freq; +unsigned long long hdmi_freq;int vic =drm_match_cea_mode (mode);enum drm_mode_status status;
@@ -144,12 +146,12 @@ static enum drm_mode_status meson_encoder_hdmi_mode_valid(struct drm_bridge *briif (status !=MODE_OK )return status; -return meson_vclk_dmt_supported_freq (priv, mode->clock); +return meson_vclk_dmt_supported_freq (priv, clock);/* Check against supported VIC modes */ }else if (!meson_venc_hdmi_supported_vic (vic))return MODE_BAD ; - vclk_freq = mode->clock; + vclk_freq = clock;/* For 420, pixel clock is half unlike venc clock */ if (drm_mode_is_420_only(display_info, mode) ||
@@ -179,7 +181,8 @@ static enum drm_mode_status meson_encoder_hdmi_mode_valid(struct drm_bridge *briif (mode->flags &DRM_MODE_FLAG_DBLCLK ) venc_freq /=2 ; -dev_dbg (priv->dev,"%s: vclk:%d phy=%d venc=%d hdmi=%d\n" , +dev_dbg (priv->dev, +"%s: vclk:%lluHz phy=%lluHz venc=%lluHz hdmi=%lluHz\n" , __func__, phy_freq, vclk_freq, venc_freq, hdmi_freq);return meson_vclk_vic_supported_freq (priv, phy_freq, vclk_freq);
drivers/gpu/drm/meson/meson_vclk.c +101 -94
425 lines not on this page · raw message
drivers/gpu/drm/meson/meson_vclk.h +7 -6
@@ -20,17 +20,18 @@ enum { };/* 27MHz is the CVBS Pixel Clock */ -#define MESON_VCLK_CVBS 27000 +#define MESON_VCLK_CVBS (27 * 1000 * 1000)enum drm_mode_status -meson_vclk_dmt_supported_freq (struct meson_drm *priv,unsigned int freq); +meson_vclk_dmt_supported_freq (struct meson_drm *priv,unsigned long long freq);enum drm_mode_status -meson_vclk_vic_supported_freq (struct meson_drm *priv,unsigned int phy_freq, -unsigned int vclk_freq); +meson_vclk_vic_supported_freq (struct meson_drm *priv, +unsigned long long phy_freq, +unsigned long long vclk_freq);void meson_vclk_setup (struct meson_drm *priv,unsigned int target, -unsigned int phy_freq,unsigned int vclk_freq, -unsigned int venc_freq,unsigned int dac_freq, +unsigned long long phy_freq,unsigned long long vclk_freq, +unsigned long long venc_freq,unsigned long long dac_freq,bool hdmi_use_enci);#endif /* __MESON_VCLK_H */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 310/356 drm/meson: fix debug log statement when setting the HDMI clocks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Blumenstingl <[email protected]>
[ Upstream commit d17e61ab63fb7747b340d6a66bf1408cd5c6562b ]
The "phy" and "vclk" frequency labels were swapped, making it more difficult to debug driver errors. Swap the label order to make them match with the actual frequencies printed to correct this.
--- drivers/gpu/drm/meson/meson_encoder_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/meson/meson_encoder_hdmi.c +1 -1
@@ -108,7 +108,7 @@ static void meson_encoder_hdmi_set_vclk(struct meson_encoder_hdmi *encoder_hdmi, venc_freq /=2 ;dev_dbg (priv->dev, -"vclk:%lluHz phy=%lluHz venc=%lluHz hdmi=%lluHz enci=%d\n" , +"phy:%lluHz vclk=%lluHz venc=%lluHz hdmi=%lluHz enci=%d\n" , phy_freq, vclk_freq, venc_freq, hdmi_freq, priv->venc.hdmi_use_enci);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 311/356 drm/meson: use vclk_freq instead of pixel_freq in debug print
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Blumenstingl <[email protected]>
[ Upstream commit faf2f8382088e8c74bd6eeb236c8c9190e61615e ]
meson_vclk_vic_supported_freq() has a debug print which includes the pixel freq. However, within the whole function the pixel freq is irrelevant, other than checking the end of the params array. Switch to printing the vclk_freq which is being compared / matched against the inputs to the function to avoid confusion when analyzing error reports from users.
--- drivers/gpu/drm/meson/meson_vclk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/meson/meson_vclk.c +3 -3
@@ -790,9 +790,9 @@ meson_vclk_vic_supported_freq(struct meson_drm *priv, }for (i =0 ; params[i].pixel_freq ; ++i) { -DRM_DEBUG_DRIVER ("i = %d pixel_freq = %lluHz alt = %lluHz\n" , - i, params[i].pixel_freq, -PIXEL_FREQ_1000_1001 (params[i].pixel_freq)); +DRM_DEBUG_DRIVER ("i = %d vclk_freq = %lluHz alt = %lluHz\n" , + i, params[i].vclk_freq, +PIXEL_FREQ_1000_1001 (params[i].vclk_freq));DRM_DEBUG_DRIVER ("i = %d phy_freq = %lluHz alt = %lluHz\n" , i, params[i].phy_freq,PHY_FREQ_1000_1001 (params[i].phy_freq));
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 312/356 drm/meson: fix more rounding issues with 59.94Hz modes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Blumenstingl <[email protected]>
[ Upstream commit 0cee6c4d3518b2e757aedae78771f17149f57653 ]
Commit 1017560164b6 ("drm/meson: use unsigned long long / Hz for frequency types") attempts to resolve video playback using 59.94Hz.
using YUV420 by changing the clock calculation to use
Hz instead of kHz (thus yielding more precision).
The basic calculation itself is correct, however the comparisions in meson_vclk_vic_supported_freq() and meson_vclk_setup() don't work anymore for 59.94Hz modes (using the freq * 1000 / 1001 logic). For example, drm/edid specifies a 593407kHz clock for [email protected]. With the mentioend commit we convert this to Hz. Then meson_vclk tries to find a matchig "params" entry (as the clock setup code currently only supports specific frequencies) by taking the venc_freq from the params and calculating the "alt frequency" (used for the 59.94Hz modes) from it, which is:
(594000000Hz * 1000) / 1001 = 593406593Hz
Similar calculation is applied to the phy_freq (TMDS clock), which is 10 times the pixel clock.
Implement a new meson_vclk_freqs_are_matching_param() function whose purpose is to compare if the requested and calculated frequencies. They may not match exactly (for the reasons mentioned above). Allow the clocks to deviate slightly to make the 59.94Hz modes again.
--- drivers/gpu/drm/meson/meson_vclk.c | 55 ++++++++++++++++++------------ 1 file changed, 34 insertions(+), 21 deletions(-)
drivers/gpu/drm/meson/meson_vclk.c +34 -21
@@ -110,10 +110,7 @@#define HDMI_PLL_LOCK BIT(31)#define HDMI_PLL_LOCK_G12A (3 << 30) -#define PIXEL_FREQ_1000_1001 (_freq) \ - DIV_ROUND_CLOSEST_ULL((_freq) * 1000ULL, 1001ULL) -#define PHY_FREQ_1000_1001 (_freq) \ - (PIXEL_FREQ_1000_1001(DIV_ROUND_DOWN_ULL(_freq, 10ULL)) * 10) +#define FREQ_1000_1001 (_freq) DIV_ROUND_CLOSEST_ULL((_freq) * 1000ULL, 1001ULL)/* VID PLL Dividers */ enum {
@@ -772,6 +769,36 @@ static void meson_hdmi_pll_generic_set(struct meson_drm *priv, pll_freq); } +static bool meson_vclk_freqs_are_matching_param (unsigned int idx, +unsigned long long phy_freq, +unsigned long long vclk_freq) +{ +DRM_DEBUG_DRIVER ("i = %d vclk_freq = %lluHz alt = %lluHz\n" , + idx, params[idx].vclk_freq, +FREQ_1000_1001 (params[idx].vclk_freq)); +DRM_DEBUG_DRIVER ("i = %d phy_freq = %lluHz alt = %lluHz\n" , + idx, params[idx].phy_freq, +FREQ_1000_1001 (params[idx].phy_freq)); + +/* Match strict frequency */ +if (phy_freq == params[idx].phy_freq && + vclk_freq == params[idx].vclk_freq) +return true; + +/* Match 1000/1001 variant: vclk deviation has to be less than 1kHz +* (drm EDID is defined in 1kHz steps, so everything smaller must be +* rounding error) and the PHY freq deviation has to be less than +* 10kHz (as the TMDS clock is 10 times the pixel clock, so anything +* smaller must be rounding error as well). +*/ +if (abs (vclk_freq -FREQ_1000_1001 (params[idx].vclk_freq)) <1000 && +abs (phy_freq -FREQ_1000_1001 (params[idx].phy_freq)) <10000 ) +return true; + +/* no match */ +return false; +} + enum drm_mode_status meson_vclk_vic_supported_freq(struct meson_drm *priv, unsigned long long phy_freq,
@@ -790,19 +817,7 @@ meson_vclk_vic_supported_freq(struct meson_drm *priv, }for (i =0 ; params[i].pixel_freq ; ++i) { -DRM_DEBUG_DRIVER ("i = %d vclk_freq = %lluHz alt = %lluHz\n" , - i, params[i].vclk_freq, -PIXEL_FREQ_1000_1001 (params[i].vclk_freq)); -DRM_DEBUG_DRIVER ("i = %d phy_freq = %lluHz alt = %lluHz\n" , - i, params[i].phy_freq, -PHY_FREQ_1000_1001 (params[i].phy_freq)); -/* Match strict frequency */ -if (phy_freq == params[i].phy_freq && - vclk_freq == params[i].vclk_freq) -return MODE_OK ; -/* Match 1000/1001 variant */ -if (phy_freq ==PHY_FREQ_1000_1001 (params[i].phy_freq) && - vclk_freq ==PIXEL_FREQ_1000_1001 (params[i].vclk_freq)) +if (meson_vclk_freqs_are_matching_param (i, phy_freq, vclk_freq))return MODE_OK ; }
@@ -1075,10 +1090,8 @@ void meson_vclk_setup(struct meson_drm *priv, unsigned int target, }for (freq =0 ; params[freq].pixel_freq ; ++freq) { -if ((phy_freq == params[freq].phy_freq || - phy_freq ==PHY_FREQ_1000_1001 (params[freq].phy_freq)) && - (vclk_freq == params[freq].vclk_freq || - vclk_freq ==PIXEL_FREQ_1000_1001 (params[freq].vclk_freq))) { +if (meson_vclk_freqs_are_matching_param (freq, phy_freq, + vclk_freq)) {if (vclk_freq != params[freq].vclk_freq) vic_alternate_clock = true;else
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 313/356 i40e: return false from i40e_reset_vf if reset is in progress
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robert Malz <[email protected]>
[ Upstream commit a2c90d63b71223d69a813333c1abf4fdacddbbe5 ]
The function i40e_vc_reset_vf attempts, up to 20 times, to handle a VF reset request, using the return value of i40e_reset_vf as an indicator of whether the reset was successfully triggered. Currently, i40e_reset_vf always returns true, which causes new reset requests to be ignored if a different VF reset is already in progress.
This patch updates the return value of i40e_reset_vf to reflect when another VF reset is in progress, allowing the caller to properly use the retry mechanism.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +3 -3
@@ -1552,8 +1552,8 @@ static void i40e_cleanup_reset_vf(struct i40e_vf *vf)* @vf: pointer to the VF structure * @flr: VFLR was issued or not * -* Returns true if the VF is in reset, resets successfully, or resets -* are disabled and false otherwise. +* Return: True if reset was performed successfully or if resets are disabled. +* False if reset is already in progress. **/ bool i40e_reset_vf (struct i40e_vf *vf,bool flr) {
@@ -1572,7 +1572,7 @@ bool i40e_reset_vf(struct i40e_vf *vf, bool flr)/* If VF is being reset already we don't need to continue. */ if (test_and_set_bit (I40E_VF_STATE_RESETTING , &vf->vf_states)) -return true; +return false;i40e_trigger_vf_reset (vf, flr);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 314/356 i40e: retry VFLR handling if there is ongoing VF reset
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robert Malz <[email protected]>
[ Upstream commit fb4e9239e029954a37a00818b21e837cebf2aa10 ]
When a VFLR interrupt is received during a VF reset initiated from a different source, the VFLR may be not fully handled. This can leave the VF in an undefined state.
To address this, set the I40E_VFLR_EVENT_PENDING bit again during VFLR handling if the reset is not yet complete. This ensures the driver will properly complete the VF reset in such scenarios.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +4 -1
@@ -4332,7 +4332,10 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf) reg =rd32 (hw,I40E_GLGEN_VFLRSTAT (reg_idx));if (reg &BIT (bit_idx))/* i40e_reset_vf will clear the bit in GLGEN_VFLRSTAT */ -i40e_reset_vf (vf, true); +if (!i40e_reset_vf (vf, true)) { +/* At least one VF did not finish resetting, retry next time */ +set_bit (__I40E_VFLR_EVENT_PENDING, pf->state); + } }return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 315/356 ACPI: CPPC: Fix NULL pointer dereference when nosmp is used
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yunhui Cui <[email protected]>
[ Upstream commit 15eece6c5b05e5f9db0711978c3e3b7f1a2cfe12 ]
With nosmp in cmdline, other CPUs are not brought up, leaving their cpc_desc_ptr NULL. CPU0's iteration via for_each_possible_cpu() dereferences these NULL pointers, causing panic.
Panic backtrace:
[ 0.401123] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000b8 ... [ 0.403255] [<ffffffff809a5818>] cppc_allow_fast_switch+0x6a/0xd4 ... Kernel panic - not syncing: Attempted to kill init!
--- drivers/acpi/cppc_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/cppc_acpi.c +1 -1
@@ -461,7 +461,7 @@ bool cppc_allow_fast_switch(void)struct cpc_desc *cpc_ptr;int cpu; -for_each_possible_cpu (cpu) { +for_each_present_cpu (cpu) { cpc_ptr =per_cpu (cpc_desc_ptr, cpu); desired_reg = &cpc_ptr->cpc_regs[DESIRED_PERF ]; if (!CPC_IN_SYSTEM_MEMORY(desired_reg) &&
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 316/356 net: Fix TOCTOU issue in sk_is_readable()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Luczaj <[email protected]>
[ Upstream commit 2660a544fdc0940bba15f70508a46cf9a6491230 ]
sk->sk_prot->sock_is_readable is a valid function pointer when sk resides in a sockmap. After the last sk_psock_put() (which usually happens when socket is removed from sockmap), sk->sk_prot gets restored and sk->sk_prot->sock_is_readable becomes NULL.
This makes sk_is_readable() racy, if the value of sk->sk_prot is reloaded after the initial check. Which in turn may lead to a null pointer dereference.
Ensure the function pointer does not turn NULL after the check.
--- include/net/sock.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
include/net/sock.h +5 -2
@@ -3043,8 +3043,11 @@ int sock_ioctl_inout(struct sock *sk, unsigned int cmd,int sk_ioctl (struct sock *sk,unsigned int cmd,void __user *arg);static inline bool sk_is_readable (struct sock *sk) { -if (sk->sk_prot->sock_is_readable) -return sk->sk_prot->sock_is_readable (sk); +const struct proto *prot =READ_ONCE (sk->sk_prot); + +if (prot->sock_is_readable) +return prot->sock_is_readable (sk); +return false; }#endif /* _SOCK_H */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 317/356 macsec: MACsec SCI assignment for ES = 0
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Carlos Fernandez <[email protected]>
[ Upstream commit d9816ec74e6d6aa29219d010bba3f780ba1d9d75 ]
According to 802.1AE standard, when ES and SC flags in TCI are zero, used SCI should be the current active SC_RX. Current code uses the header MAC address. Without this patch, when ES flag is 0 (using a bridge or switch), header MAC will not fit the SCI and MACSec frames will be discarted.
In order to test this issue, MACsec link should be stablished between two interfaces, setting SC and ES flags to zero and a port identifier different than one. For example, using ip macsec tools:
ip link add link $ETH0 macsec0 type macsec port 11 send_sci off end_station off
ip macsec add macsec0 tx sa 0 pn 2 on key 01 $ETH1_KEY
ip macsec add macsec0 rx port 11 address $ETH1_MAC
ip macsec add macsec0 rx port 11 address $ETH1_MAC sa 0 pn 2 on key 02 ip link set dev macsec0 up
ip link add link $ETH1 macsec1 type macsec port 11 send_sci off end_station off
ip macsec add macsec1 tx sa 0 pn 2 on key 01 $ETH0_KEY
ip macsec add macsec1 rx port 11 address $ETH0_MAC
ip macsec add macsec1 rx port 11 address $ETH0_MAC sa 0 pn 2 on key 02 ip link set dev macsec1 up
--- drivers/net/macsec.c | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-)
drivers/net/macsec.c +34 -6
@@ -243,15 +243,39 @@ static sci_t make_sci(const u8 *addr, __be16 port)return sci; } -static sci_t macsec_frame_sci (struct macsec_eth_header *hdr,bool sci_present) +static sci_t macsec_active_sci (struct macsec_secy *secy) { -sci_t sci; +struct macsec_rx_sc *rx_sc =rcu_dereference_bh (secy->rx_sc); + +/* Case single RX SC */ +if (rx_sc && !rcu_dereference_bh (rx_sc->next)) +return (rx_sc->active) ? rx_sc->sci :0 ; +/* Case no RX SC or multiple */ +else +return 0 ; +} + +static sci_t macsec_frame_sci (struct macsec_eth_header *hdr,bool sci_present, +struct macsec_rxh_data *rxd) +{ +struct macsec_dev *macsec; +sci_t sci =0 ; -if (sci_present) +/* SC = 1 */ +if (sci_present) {memcpy (&sci, hdr->secure_channel_id,sizeof (hdr->secure_channel_id)); -else +/* SC = 0; ES = 0 */ + }else if ((!(hdr->tci_an & (MACSEC_TCI_ES |MACSEC_TCI_SC ))) && + (list_is_singular (&rxd->secys))) { +/* Only one SECY should exist on this scenario */ + macsec = list_first_or_null_rcu(&rxd->secys, struct macsec_dev, + secys); +if (macsec) +return macsec_active_sci (&macsec->secy); + }else { sci =make_sci (hdr->eth.h_source,MACSEC_PORT_ES ); + }return sci; }
@@ -1105,7 +1129,7 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)struct macsec_rxh_data *rxd;struct macsec_dev *macsec;unsigned int len; -sci_t sci; +sci_t sci =0 ;u32 hdr_pn;bool cbit;struct pcpu_rx_sc_stats *rxsc_stats;
@@ -1152,11 +1176,14 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)macsec_skb_cb (skb)->has_sci = !!(hdr->tci_an &MACSEC_TCI_SC );macsec_skb_cb (skb)->assoc_num = hdr->tci_an &MACSEC_AN_MASK ; - sci =macsec_frame_sci (hdr,macsec_skb_cb (skb)->has_sci);rcu_read_lock (); rxd =macsec_data_rcu (skb->dev); + sci =macsec_frame_sci (hdr,macsec_skb_cb (skb)->has_sci, rxd); +if (!sci) + goto drop_nosc; +list_for_each_entry_rcu (macsec, &rxd->secys, secys) {struct macsec_rx_sc *sc =find_rx_sc (&macsec->secy, sci);
@@ -1279,6 +1306,7 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)macsec_rxsa_put (rx_sa); drop_nosa:macsec_rxsc_put (rx_sc); +drop_nosc:rcu_read_unlock (); drop_direct:kfree_skb (skb);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 318/356 net/mdiobus: Fix potential out-of-bounds read/write access
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Raczynski <[email protected]>
[ Upstream commit 0e629694126ca388916f059453a1c36adde219c4 ]
When using publicly available tools like 'mdio-tools' to read/write data from/to network interface and its PHY via mdiobus, there is no verification of parameters passed to the ioctl and it accepts any mdio address. Currently there is support for 32 addresses in kernel via PHY_MAX_ADDR define, but it is possible to pass higher value than that via ioctl. While read/write operation should generally fail in this case, mdiobus provides stats array, where wrong address may allow out-of-bounds read/write.
Fix that by adding address verification before read/write operation. While this excludes this access from any statistics, it improves security of read/write operation.
--- drivers/net/phy/mdio_bus.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/phy/mdio_bus.c +6 -0
@@ -850,6 +850,9 @@ int __mdiobus_read(struct mii_bus *bus, int addr, u32 regnum)lockdep_assert_held_once (&bus->mdio_lock); +if (addr >=PHY_MAX_ADDR ) +return -ENXIO ; +if (bus->read) retval = bus->read (bus, addr, regnum);else
@@ -879,6 +882,9 @@ int __mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val)lockdep_assert_held_once (&bus->mdio_lock); +if (addr >=PHY_MAX_ADDR ) +return -ENXIO ; +if (bus->write) err = bus->write (bus, addr, regnum, val);else
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 319/356 net/mdiobus: Fix potential out-of-bounds clause 45 read/write access
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Raczynski <[email protected]>
[ Upstream commit 260388f79e94fb3026c419a208ece8358bb7b555 ]
When using publicly available tools like 'mdio-tools' to read/write data from/to network interface and its PHY via C45 (clause 45) mdiobus, there is no verification of parameters passed to the ioctl and
it accepts any mdio address.
Currently there is support for 32 addresses in kernel via PHY_MAX_ADDR define, but it is possible to pass higher value than that via ioctl. While read/write operation should generally fail in this case, mdiobus provides stats array, where wrong address may allow out-of-bounds read/write.
Fix that by adding address verification before C45 read/write operation. While this excludes this access from any statistics, it improves security of read/write operation.
--- drivers/net/phy/mdio_bus.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/phy/mdio_bus.c +6 -0
@@ -946,6 +946,9 @@ int __mdiobus_c45_read(struct mii_bus *bus, int addr, int devad, u32 regnum)lockdep_assert_held_once (&bus->mdio_lock); +if (addr >=PHY_MAX_ADDR ) +return -ENXIO ; +if (bus->read_c45) retval = bus->read_c45 (bus, addr, devad, regnum);else
@@ -977,6 +980,9 @@ int __mdiobus_c45_write(struct mii_bus *bus, int addr, int devad, u32 regnum,lockdep_assert_held_once (&bus->mdio_lock); +if (addr >=PHY_MAX_ADDR ) +return -ENXIO ; +if (bus->write_c45) err = bus->write_c45 (bus, addr, devad, regnum, val);else
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 320/356 Bluetooth: Fix NULL pointer deference on eir_get_service_data
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit 20a2aa01f5aeb6daad9aeaa7c33dd512c58d81eb ]
The len parameter is considered optional so it can be NULL so it cannot be used for skipping to next entry of EIR_SERVICE_DATA.
--- net/bluetooth/eir.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
net/bluetooth/eir.c +6 -4
@@ -366,17 +366,19 @@ u8 eir_create_scan_rsp(struct hci_dev *hdev, u8 instance, u8 *ptr)void *eir_get_service_data (u8 *eir,size_t eir_len,u16 uuid,size_t *len) { -while ((eir =eir_get_data (eir, eir_len,EIR_SERVICE_DATA , len))) { +size_t dlen; + +while ((eir =eir_get_data (eir, eir_len,EIR_SERVICE_DATA , &dlen))) {u16 value =get_unaligned_le16 (eir);if (uuid == value) {if (len) - *len -=2 ; + *len = dlen -2 ;return &eir[2 ]; } - eir += *len; - eir_len -= *len; + eir += dlen; + eir_len -= dlen; }return NULL ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 321/356 Bluetooth: hci_sync: Fix broadcast/PA when using an existing instance
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit 5725bc608252050ed8a4d47d59225b7dd73474c8 ]
When using and existing adv_info instance for broadcast source it needs to be updated to periodic first before it can be reused, also in case the existing instance already have data hci_set_adv_instance_data cannot be used directly since it would overwrite the existing data so this reappend the original data after the Broadcast ID, if one was generated.
Example:
bluetoothctl># Add PBP to EA so it can be later referenced as the BIS ID bluetoothctl> advertise.service 0x1856 0x00 0x00 bluetoothctl> advertise on
...
< HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 13
Handle: 0x01
Operation: Complete extended advertising data (0x03)
Fragment preference: Minimize fragmentation (0x01)
Data length: 0x09
Service Data: Public Broadcast Announcement (0x1856)
Data[2]: 0000
Flags: 0x06
LE General Discoverable Mode
BR/EDR Not Supported...
bluetoothctl># Attempt to acquire Broadcast Source transport bluetoothctl>transport.acquire /org/bluez/hci0/pac_bcast0/fd0
...
< HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 255
Handle: 0x01
Operation: Complete extended advertising data (0x03)
Fragment preference: Minimize fragmentation (0x01)
Data length: 0x0e
Service Data: Broadcast Audio Announcement (0x1852)
Broadcast ID: 11371620 (0xad8464)
Service Data: Public Broadcast Announcement (0x1856)
Data[2]: 0000
Flags: 0x06
LE General Discoverable Mode
BR/EDR Not Supported--- net/bluetooth/hci_sync.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
net/bluetooth/hci_sync.c +15 -5
@@ -1586,7 +1586,8 @@ static int hci_enable_per_advertising_sync(struct hci_dev *hdev, u8 instance)static int hci_adv_bcast_annoucement (struct hci_dev *hdev,struct adv_info *adv) {u8 bid[3 ]; -u8 ad[4 +3 ]; +u8 ad[HCI_MAX_EXT_AD_LENGTH ]; +u8 len;/* Skip if NULL adv as instance 0x00 is used for general purpose * advertising so it cannot used for the likes of Broadcast Announcement
@@ -1612,8 +1613,10 @@ static int hci_adv_bcast_annoucement(struct hci_dev *hdev, struct adv_info *adv)/* Generate Broadcast ID */ get_random_bytes (bid,sizeof (bid)); -eir_append_service_data (ad,0 ,0x1852 , bid,sizeof (bid)); -hci_set_adv_instance_data (hdev, adv->instance,sizeof (ad), ad,0 ,NULL ); + len =eir_append_service_data (ad,0 ,0x1852 , bid,sizeof (bid)); +memcpy (ad + len, adv->adv_data, adv->adv_data_len); +hci_set_adv_instance_data (hdev, adv->instance, len + adv->adv_data_len, + ad,0 ,NULL );return hci_update_adv_data_sync (hdev, adv->instance); }
@@ -1630,8 +1633,15 @@ int hci_start_per_adv_sync(struct hci_dev *hdev, u8 instance, u8 data_len,if (instance) { adv =hci_find_adv_instance (hdev, instance); -/* Create an instance if that could not be found */ -if (!adv) { +if (adv) { +/* Turn it into periodic advertising */ + adv->periodic = true; + adv->per_adv_data_len = data_len; +if (data) +memcpy (adv->per_adv_data, data, data_len); + adv->flags = flags; + }else if (!adv) { +/* Create an instance if that could not be found */ adv = hci_add_per_instance(hdev, instance, flags, data_len, data, sync_interval,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 322/356 Bluetooth: MGMT: Fix sparse errors
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit 7dd38ba4acbea9875b4ee061e20a26413e39d9f4 ]
This fixes the following errors:
net/bluetooth/mgmt.c:5400:59: sparse: sparse: incorrect type in argument 3
(different base types) @@ expected unsigned short [usertype] handle @@
got restricted __le16 [usertype] monitor_handle @@net/bluetooth/mgmt.c:5400:59: sparse: expected unsigned short [usertype] handlenet/bluetooth/mgmt.c:5400:59: sparse: got restricted __le16 [usertype] monitor_handle
--- net/bluetooth/mgmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/bluetooth/mgmt.c +2 -2
@@ -5159,11 +5159,11 @@ static void mgmt_adv_monitor_added(struct sock *sk, struct hci_dev *hdev, }static void mgmt_adv_monitor_removed (struct sock *sk,struct hci_dev *hdev, -u16 handle) +__le16 handle) {struct mgmt_ev_adv_monitor_removed ev; - ev.monitor_handle =cpu_to_le16 (handle); + ev.monitor_handle = handle;mgmt_event (MGMT_EV_ADV_MONITOR_REMOVED , hdev, &ev,sizeof (ev), sk); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 323/356 net/mlx5: Ensure fw pages are always allocated on same NUMA
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Moshe Shemesh <[email protected]>
[ Upstream commit f37258133c1e95e61db532e14067e28b4881bf24 ]
When firmware asks the driver to allocate more pages, using event of give_pages, the driver should always allocate it from same NUMA, the original device NUMA. Current code uses dev_to_node() which can result in different NUMA as it is changed by other driver flows, such as mlx5_dma_zalloc_coherent_node(). Instead, use saved numa node for allocating firmware pages.
--- drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +1 -1
@@ -291,7 +291,7 @@ static void free_4k(struct mlx5_core_dev *dev, u64 addr, u32 function)static int alloc_system_page (struct mlx5_core_dev *dev,u32 function) {struct device *device =mlx5_core_dma_dev (dev); -int nid =dev_to_node (device); +int nid = dev->priv.numa_node;struct page *page;u64 zero_addr =1 ;u64 addr;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 324/356 net/mlx5: Fix ECVF vports unload on shutdown flow
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amir Tzin <[email protected]>
[ Upstream commit 687560d8a9a2d654829ad0da1ec24242f1de711d ]
Fix shutdown flow UAF when a virtual function is created on the embedded chip (ECVF) of a BlueField device. In such case the vport acl ingress table is not properly destroyed.
ECVF functionality is independent of ecpf_vport_exists capability and thus functions mlx5_eswitch_(enable|disable)_pf_vf_vports() should not test it when enabling/disabling ECVF vports.
kernel log:
[] refcount_t: underflow; use-after-free.
[] WARNING: CPU: 3 PID: 1 at lib/refcount.c:28
refcount_warn_saturate+0x124/0x220 ----------------
[] Call trace:
[] refcount_warn_saturate+0x124/0x220
[] tree_put_node+0x164/0x1e0 [mlx5_core]
[] mlx5_destroy_flow_table+0x98/0x2c0 [mlx5_core] [] esw_acl_ingress_table_destroy+0x28/0x40 [mlx5_core] [] esw_acl_ingress_lgcy_cleanup+0x80/0xf4 [mlx5_core] [] esw_legacy_vport_acl_cleanup+0x44/0x60 [mlx5_core] [] esw_vport_cleanup+0x64/0x90 [mlx5_core]
[] mlx5_esw_vport_disable+0xc0/0x1d0 [mlx5_core] [] mlx5_eswitch_unload_ec_vf_vports+0xcc/0x150 [mlx5_core] [] mlx5_eswitch_disable_sriov+0x198/0x2a0 [mlx5_core] [] mlx5_device_disable_sriov+0xb8/0x1e0 [mlx5_core] [] mlx5_sriov_detach+0x40/0x50 [mlx5_core]
[] mlx5_unload+0x40/0xc4 [mlx5_core]
[] mlx5_unload_one_devl_locked+0x6c/0xe4 [mlx5_core] [] mlx5_unload_one+0x3c/0x60 [mlx5_core]
[] shutdown+0x7c/0xa4 [mlx5_core]
[] pci_device_shutdown+0x3c/0xa0
[] device_shutdown+0x170/0x340
[] __do_sys_reboot+0x1f4/0x2a0
[] __arm64_sys_reboot+0x2c/0x40
[] invoke_syscall+0x78/0x100
[] el0_svc_common.constprop.0+0x54/0x184
[] do_el0_svc+0x30/0xac
[] el0_svc+0x48/0x160
[] el0t_64_sync_handler+0xa4/0x12c
[] el0t_64_sync+0x1a4/0x1a8
[] --[ end trace 9c4601d68c70030e ]---
--- .../net/ethernet/mellanox/mlx5/core/eswitch.c | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +13 -8
@@ -1295,12 +1295,15 @@ mlx5_eswitch_enable_pf_vf_vports(struct mlx5_eswitch *esw, ret =mlx5_eswitch_load_pf_vf_vport (esw,MLX5_VPORT_ECPF , enabled_events);if (ret) goto ecpf_err; -if (mlx5_core_ec_sriov_enabled (esw->dev)) { - ret =mlx5_eswitch_load_ec_vf_vports (esw, esw->esw_funcs.num_ec_vfs, - enabled_events); -if (ret) - goto ec_vf_err; - } + } + +/* Enable ECVF vports */ +if (mlx5_core_ec_sriov_enabled (esw->dev)) { + ret =mlx5_eswitch_load_ec_vf_vports (esw, + esw->esw_funcs.num_ec_vfs, + enabled_events); +if (ret) + goto ec_vf_err; }/* Enable VF vports */
@@ -1331,9 +1334,11 @@ void mlx5_eswitch_disable_pf_vf_vports(struct mlx5_eswitch *esw) {mlx5_eswitch_unload_vf_vports (esw, esw->esw_funcs.num_vfs); +if (mlx5_core_ec_sriov_enabled (esw->dev)) +mlx5_eswitch_unload_ec_vf_vports (esw, + esw->esw_funcs.num_ec_vfs); +if (mlx5_ecpf_vport_exists (esw->dev)) { -if (mlx5_core_ec_sriov_enabled (esw->dev)) -mlx5_eswitch_unload_ec_vf_vports (esw, esw->esw_funcs.num_vfs);mlx5_eswitch_unload_pf_vf_vport (esw,MLX5_VPORT_ECPF ); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 325/356 net/mlx5: Fix return value when searching for existing flow group
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Patrisious Haddad <[email protected]>
[ Upstream commit 8ec40e3f1f72bf8f8accf18020d487caa99f46a4 ]
When attempting to add a rule to an existing flow group, if a matching flow group exists but is not active, the error code returned should be EAGAIN, so that the rule can be added to the matching flow group once it is active, rather than ENOENT, which indicates that no matching flow group was found.
--- drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +4 -1
@@ -1984,6 +1984,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,struct mlx5_flow_handle *rule;struct match_list *iter;bool take_write = false; +bool try_again = false;struct fs_fte *fte;u64 version =0 ;int err;
@@ -2043,6 +2044,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,nested_down_write_ref_node (&g->node,FS_LOCK_PARENT );if (!g->node.active) { + try_again = true;up_write_ref_node (&g->node, false);continue ; }
@@ -2064,7 +2066,8 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,tree_put_node (&fte->node, false);return rule; } - rule =ERR_PTR (-ENOENT ); + err = try_again ? -EAGAIN : -ENOENT ; + rule =ERR_PTR (err); out:kmem_cache_free (steering->ftes_cache, fte);return rule;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 326/356 net/mlx5e: Fix leak of Geneve TLV option object
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianbo Liu <[email protected]>
[ Upstream commit aa9c44b842096c553871bc68a8cebc7861fa192b ]
Previously, a unique tunnel id was added for the matching on TC non-zero chains, to support inner header rewrite with goto action. Later, it was used to support VF tunnel offload for vxlan, then for Geneve and GRE. To support VF tunnel, a temporary mlx5_flow_spec is used to parse tunnel options. For Geneve, if there is TLV option, a object is created, or refcnt is added if already exists. But the temporary mlx5_flow_spec is directly freed after parsing, which causes the leak because no information regarding the object is saved in flow's mlx5_flow_spec, which is used to free the object when deleting the flow.
To fix the leak, call mlx5_geneve_tlv_option_del() before free the temporary spec if it has TLV object.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +6 -6
@@ -1915,9 +1915,8 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,return err; } -static bool mlx5_flow_has_geneve_opt (struct mlx5e_tc_flow *flow) +static bool mlx5_flow_has_geneve_opt (struct mlx5_flow_spec *spec) { -struct mlx5_flow_spec *spec = &flow->attr->parse_attr->spec;void *headers_v =MLX5_ADDR_OF (fte_match_param, spec->match_value, misc_parameters_3);
@@ -1956,7 +1955,7 @@ static void mlx5e_tc_del_fdb_flow(struct mlx5e_priv *priv, }complete_all (&flow->del_hw_done); -if (mlx5_flow_has_geneve_opt (flow)) +if (mlx5_flow_has_geneve_opt (&attr->parse_attr->spec))mlx5_geneve_tlv_option_del (priv->mdev->geneve);if (flow->decap_route)
@@ -2456,12 +2455,13 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv, err =mlx5e_tc_tun_parse (filter_dev, priv, tmp_spec, f, match_level);if (err) { -kvfree (tmp_spec);NL_SET_ERR_MSG_MOD (extack,"Failed to parse tunnel attributes" );netdev_warn (priv->netdev,"Failed to parse tunnel attributes" ); -return err; + }else { + err =mlx5e_tc_set_attr_rx_tun (flow, tmp_spec); } - err =mlx5e_tc_set_attr_rx_tun (flow, tmp_spec); +if (mlx5_flow_has_geneve_opt (tmp_spec)) +mlx5_geneve_tlv_option_del (priv->mdev->geneve);kvfree (tmp_spec);if (err)return err;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 327/356 net_sched: prio: fix a race in prio_tune()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit d35acc1be3480505b5931f17e4ea9b7617fea4d3 ]
Gerrard Tai reported a race condition in PRIO, whenever SFQ perturb timer fires at the wrong time.
The race is as follows:
CPU 0 CPU 1
[1]: lock root
[2]: qdisc_tree_flush_backlog()
[3]: unlock root
| | [5]: lock root | [6]: rehash | [7]: qdisc_tree_reduce_backlog() |
[4]: qdisc_put()
This can be abused to underflow a parent's qlen.
Calling qdisc_purge_queue() instead of qdisc_tree_flush_backlog() should fix the race, because all packets will be purged from the qdisc before releasing the lock.
--- net/sched/sch_prio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_prio.c +1 -1
@@ -211,7 +211,7 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt,memcpy (q->prio2band, qopt->priomap,TC_PRIO_MAX +1 );for (i = q->bands; i < oldbands; i++) -qdisc_tree_flush_backlog (q->queues[i]); +qdisc_purge_queue (q->queues[i]);for (i = oldbands; i < q->bands; i++) { q->queues[i] = queues[i];
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 329/356 net_sched: tbf: fix a race in tbf_change()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 43eb466041216d25dedaef1c383ad7bd89929cbc ]
Gerrard Tai reported a race condition in TBF, whenever SFQ perturb timer fires at the wrong time.
The race is as follows:
CPU 0 CPU 1
[1]: lock root
[2]: qdisc_tree_flush_backlog()
[3]: unlock root
| | [5]: lock root | [6]: rehash | [7]: qdisc_tree_reduce_backlog() |
[4]: qdisc_put()
This can be abused to underflow a parent's qlen.
Calling qdisc_purge_queue() instead of qdisc_tree_flush_backlog() should fix the race, because all packets will be purged from the qdisc before releasing the lock.
--- net/sched/sch_tbf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_tbf.c +1 -1
@@ -452,7 +452,7 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt,sch_tree_lock (sch);if (child) { -qdisc_tree_flush_backlog (q->qdisc); +qdisc_purge_queue (q->qdisc); old = q->qdisc; q->qdisc = child; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 330/356 net_sched: ets: fix a race in ets_qdisc_change()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit d92adacdd8c2960be856e0b82acc5b7c5395fddb ]
Gerrard Tai reported a race condition in ETS, whenever SFQ perturb timer fires at the wrong time.
The race is as follows:
CPU 0 CPU 1
[1]: lock root
[2]: qdisc_tree_flush_backlog()
[3]: unlock root
| | [5]: lock root | [6]: rehash | [7]: qdisc_tree_reduce_backlog() |
[4]: qdisc_put()
This can be abused to underflow a parent's qlen.
Calling qdisc_purge_queue() instead of qdisc_tree_flush_backlog() should fix the race, because all packets will be purged from the qdisc before releasing the lock.
--- net/sched/sch_ets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/sch_ets.c +1 -1
@@ -661,7 +661,7 @@ static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt,for (i = q->nbands; i < oldbands; i++) {if (i >= q->nstrict && q->classes[i].qdisc->q.qlen)list_del_init (&q->classes[i].alist); -qdisc_tree_flush_backlog (q->classes[i].qdisc); +qdisc_purge_queue (q->classes[i].qdisc); } q->nstrict = nstrict;memcpy (q->prio2band, priomap,sizeof (priomap));
Signature · 33 lines
2.39.5
ded" Error message: "Failed to find required string:'Out-Out;'."
---- end(-1) ----
132: perf script task-analyzer tests : FAILED!
```
The buf_size if always set to phdr->p_filesz, but that may be 0
causing a free and realloc to return NULL. This is treated in
filename__read_build_id like a failure and the buffer is freed again.
To avoid this problem only grow buf, meaning the buf_size will never
be 0. This also reduces the number of memory (re)allocations.
Fixes: b691f64360ecec49 ("perf symbols: Implement poor man's ELF parser")
Signed-off-by: Ian Rogers <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
tools/perf/util/symbol-minimal.c | 34 +++++++++++++++++---------------
1 file changed, 18 insertions(+), 16 deletions(-)tools/perf/util/symbol-minimal.c +18 -16
@@ -147,18 +147,19 @@ int filename__read_build_id(const char *filename, struct build_id *bid)if (phdr->p_type !=PT_NOTE )continue ; - buf_size = phdr->p_filesz; offset = phdr->p_offset; - tmp =realloc (buf, buf_size); -if (tmp ==NULL ) - goto out_free; - - buf = tmp; +if (phdr->p_filesz > buf_size) { + buf_size = phdr->p_filesz; + tmp =realloc (buf, buf_size); +if (tmp ==NULL ) + goto out_free; + buf = tmp; + }fseek (fp, offset,SEEK_SET ); -if (fread (buf, buf_size,1 , fp) !=1 ) +if (fread (buf, phdr->p_filesz,1 , fp) !=1 ) goto out_free; - ret =read_build_id (buf, buf_size, bid, need_swap); + ret =read_build_id (buf, phdr->p_filesz, bid, need_swap);if (ret ==0 ) { ret = bid->size;break ;
@@ -199,18 +200,19 @@ int filename__read_build_id(const char *filename, struct build_id *bid)if (phdr->p_type !=PT_NOTE )continue ; - buf_size = phdr->p_filesz; offset = phdr->p_offset; - tmp =realloc (buf, buf_size); -if (tmp ==NULL ) - goto out_free; - - buf = tmp; +if (phdr->p_filesz > buf_size) { + buf_size = phdr->p_filesz; + tmp =realloc (buf, buf_size); +if (tmp ==NULL ) + goto out_free; + buf = tmp; + }fseek (fp, offset,SEEK_SET ); -if (fread (buf, buf_size,1 , fp) !=1 ) +if (fread (buf, phdr->p_filesz,1 , fp) !=1 ) goto out_free; - ret =read_build_id (buf, buf_size, bid, need_swap); + ret =read_build_id (buf, phdr->p_filesz, bid, need_swap);if (ret ==0 ) { ret = bid->size;break ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 332/356 nvmet-fcloop: access fcpreq only when holding reqlock
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Wagner <[email protected]>
[ Upstream commit 47a827cd7929d0550c3496d70b417fcb5649b27b ]
The abort handling logic expects that the state and the fcpreq are only accessed when holding the reqlock lock.
While at it, only handle the aborts in the abort handler.
--- drivers/nvme/target/fcloop.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-)
drivers/nvme/target/fcloop.c +16 -15
@@ -613,12 +613,13 @@ fcloop_fcp_recv_work(struct work_struct *work) {struct fcloop_fcpreq *tfcp_req = container_of(work, struct fcloop_fcpreq, fcp_rcv_work); -struct nvmefc_fcp_req *fcpreq = tfcp_req->fcpreq; +struct nvmefc_fcp_req *fcpreq;unsigned long flags;int ret =0 ;bool aborted = false;spin_lock_irqsave (&tfcp_req->reqlock, flags); + fcpreq = tfcp_req->fcpreq;switch (tfcp_req->inistate) {case INI_IO_START : tfcp_req->inistate =INI_IO_ACTIVE ;
@@ -633,16 +634,19 @@ fcloop_fcp_recv_work(struct work_struct *work) }spin_unlock_irqrestore (&tfcp_req->reqlock, flags); -if (unlikely (aborted)) - ret = -ECANCELED ; -else { -if (likely (!check_for_drop (tfcp_req))) - ret =nvmet_fc_rcv_fcp_req (tfcp_req->tport->targetport, - &tfcp_req->tgt_fcp_req, - fcpreq->cmdaddr, fcpreq->cmdlen); -else -pr_info ("%s: dropped command ********\n" , __func__); +if (unlikely (aborted)) { +/* the abort handler will call fcloop_call_host_done */ +return ; + } + +if (unlikely (check_for_drop (tfcp_req))) { +pr_info ("%s: dropped command ********\n" , __func__); +return ; } + + ret =nvmet_fc_rcv_fcp_req (tfcp_req->tport->targetport, + &tfcp_req->tgt_fcp_req, + fcpreq->cmdaddr, fcpreq->cmdlen);if (ret)fcloop_call_host_done (fcpreq, tfcp_req, ret); }
@@ -657,9 +661,10 @@ fcloop_fcp_abort_recv_work(struct work_struct *work)unsigned long flags;spin_lock_irqsave (&tfcp_req->reqlock, flags); - fcpreq = tfcp_req->fcpreq;switch (tfcp_req->inistate) {case INI_IO_ABORTED : + fcpreq = tfcp_req->fcpreq; + tfcp_req->fcpreq =NULL ;break ;case INI_IO_COMPLETED : completed = true;
@@ -681,10 +686,6 @@ fcloop_fcp_abort_recv_work(struct work_struct *work)nvmet_fc_rcv_fcp_abort (tfcp_req->tport->targetport, &tfcp_req->tgt_fcp_req); -spin_lock_irqsave (&tfcp_req->reqlock, flags); - tfcp_req->fcpreq =NULL ; -spin_unlock_irqrestore (&tfcp_req->reqlock, flags); -fcloop_call_host_done (fcpreq, tfcp_req, -ECANCELED );/* call_host_done releases reference for abort downcall */ }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 333/356 perf: Ensure bpf_perf_link path is properly serialized
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit 7ed9138a72829d2035ecbd8dbd35b1bc3c137c40 ]
Ravi reported that the bpf_perf_link_attach() usage of perf_event_set_bpf_prog() is not serialized by ctx->mutex, unlike the PERF_EVENT_IOC_SET_BPF case.
--- kernel/events/core.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-)
kernel/events/core.c +30 -4
@@ -5913,6 +5913,9 @@ static int perf_event_set_output(struct perf_event *event,static int perf_event_set_filter (struct perf_event *event,void __user *arg);static int perf_copy_attr (struct perf_event_attr __user *uattr,struct perf_event_attr *attr); +static int __perf_event_set_bpf_prog (struct perf_event *event, +struct bpf_prog *prog, +u64 bpf_cookie);static long _perf_ioctl (struct perf_event *event,unsigned int cmd,unsigned long arg) {
@@ -5981,7 +5984,7 @@ static long _perf_ioctl(struct perf_event *event, unsigned int cmd, unsigned lonif (IS_ERR (prog))return PTR_ERR (prog); - err =perf_event_set_bpf_prog (event, prog,0 ); + err =__perf_event_set_bpf_prog (event, prog,0 );if (err) {bpf_prog_put (prog);return err;
@@ -10583,8 +10586,9 @@ static inline bool perf_event_is_tracing(struct perf_event *event)return false; } -int perf_event_set_bpf_prog (struct perf_event *event,struct bpf_prog *prog, -u64 bpf_cookie) +static int __perf_event_set_bpf_prog (struct perf_event *event, +struct bpf_prog *prog, +u64 bpf_cookie) {bool is_kprobe, is_uprobe, is_tracepoint, is_syscall_tp;
@@ -10622,6 +10626,20 @@ int perf_event_set_bpf_prog(struct perf_event *event, struct bpf_prog *prog,return perf_event_attach_bpf_prog (event, prog, bpf_cookie); } +int perf_event_set_bpf_prog (struct perf_event *event, +struct bpf_prog *prog, +u64 bpf_cookie) +{ +struct perf_event_context *ctx; +int ret; + + ctx =perf_event_ctx_lock (event); + ret =__perf_event_set_bpf_prog (event, prog, bpf_cookie); +perf_event_ctx_unlock (event, ctx); + +return ret; +} +void perf_event_free_bpf_prog (struct perf_event *event) {if (!perf_event_is_tracing (event)) {
@@ -10641,7 +10659,15 @@ static void perf_event_free_filter(struct perf_event *event) { } -int perf_event_set_bpf_prog (struct perf_event *event,struct bpf_prog *prog, +static int __perf_event_set_bpf_prog (struct perf_event *event, +struct bpf_prog *prog, +u64 bpf_cookie) +{ +return -ENOENT ; +} + +int perf_event_set_bpf_prog (struct perf_event *event, +struct bpf_prog *prog,u64 bpf_cookie) {return -ENOENT ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 334/356 bio: Fix bio_first_folio() for SPARSEMEM without VMEMMAP
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
[ Upstream commit f826ec7966a63d48e16e0868af4e038bf9a1a3ae ]
It is possible for physically contiguous folios to have discontiguous struct pages if SPARSEMEM is enabled and SPARSEMEM_VMEMMAP is not. This is correctly handled by folio_page_idx(), so remove this open-coded implementation.
--- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/bio.h +1 -1
@@ -294,7 +294,7 @@ static inline void bio_first_folio(struct folio_iter *fi, struct bio *bio, fi->folio =page_folio (bvec->bv_page); fi->offset = bvec->bv_offset + -PAGE_SIZE * (bvec->bv_page - &fi->folio->page); +PAGE_SIZE *folio_page_idx (fi->folio, bvec->bv_page); fi->_seg_count = bvec->bv_len; fi->length =min (folio_size (fi->folio) - fi->offset, fi->_seg_count); fi->_next =folio_next (fi->folio);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 335/356 block: Fix bvec_set_folio() for very large folios
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
[ Upstream commit 5e223e06ee7c6d8f630041a0645ac90e39a42cc6 ]
Similarly to 26064d3e2b4d ("block: fix adding folio to bio"), if we attempt to add a folio that is larger than 4GB, we'll silently truncate the offset and len. Widen the parameters to size_t, assert that the length is less than 4GB and set the first page that contains the interesting data rather than the first page of the folio.
--- include/linux/bvec.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
include/linux/bvec.h +5 -2
@@ -57,9 +57,12 @@ static inline void bvec_set_page(struct bio_vec *bv, struct page *page,* @offset: offset into the folio */ static inline void bvec_set_folio (struct bio_vec *bv,struct folio *folio, -unsigned int len,unsigned int offset) +size_t len,size_t offset) { -bvec_set_page (bv, &folio->page, len, offset); +unsigned long nr = offset /PAGE_SIZE ; + +WARN_ON_ONCE (len >UINT_MAX ); +bvec_set_page (bv,folio_page (folio, nr), len, offset %PAGE_SIZE ); }/**
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 336/356 tools/resolve_btfids: Fix build when cross compiling kernel with clang.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suleiman Souhlal <[email protected]>
commit a298bbab903e3fb4cbe16d36d6195e68fad1b776 upstream.
When cross compiling the kernel with clang, we need to override CLANG_CROSS_FLAGS when preparing the step libraries.
Prior to commit d1d096312176 ("tools: fix annoying "mkdir -p ..." logs when building tools in parallel"), MAKEFLAGS would have been set to a value that wouldn't set a value for CLANG_CROSS_FLAGS, hiding the fact that we weren't properly overriding it.
--- tools/bpf/resolve_btfids/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/resolve_btfids/Makefile +1 -1
@@ -19,7 +19,7 @@ endif # Overrides for the prepare step libraries. HOST_OVERRIDES := AR="$(HOSTAR)" CC="$(HOSTCC)" LD="$(HOSTLD)" ARCH="$(HOSTARCH)" \ - CROSS_COMPILE="" EXTRA_CFLAGS="$(HOSTCFLAGS)" + CROSS_COMPILE="" CLANG_CROSS_FLAGS="" EXTRA_CFLAGS="$(HOSTCFLAGS)" RM ?= rm HOSTCC ?= gcc
Greg Kroah-Hartman
maintainerPATCH 337/356 ALSA: usb-audio: Add implicit feedback quirk for RODE AI-1
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Heimann <[email protected]>
commit 6a3439a417b910e662c666993798e0691bc81147 upstream.
The RODE AI-1 audio interface requires implicit feedback sync between playback endpoint 0x03 and feedback endpoint 0x84 on interface 3, but doesn't advertise this in its USB descriptors.
Without this quirk, the device receives audio data but produces no output.
--- sound/usb/implicit.c | 1 + 1 file changed, 1 insertion(+)
sound/usb/implicit.c +1 -0
@@ -57,6 +57,7 @@ static const struct snd_usb_implicit_fb_IMPLICIT_FB_FIXED_DEV (0x31e9 ,0x0002 ,0x81 ,2 ),/* Solid State Logic SSL2+ */ IMPLICIT_FB_FIXED_DEV (0x0499 ,0x172f ,0x81 ,2 ),/* Steinberg UR22C */ IMPLICIT_FB_FIXED_DEV (0x0d9a ,0x00df ,0x81 ,2 ),/* RTX6001 */ +IMPLICIT_FB_FIXED_DEV (0x19f7 ,0x000a ,0x84 ,3 ),/* RODE AI-1 */ IMPLICIT_FB_FIXED_DEV (0x22f0 ,0x0006 ,0x81 ,3 ),/* Allen&Heath Qu-16 */ IMPLICIT_FB_FIXED_DEV (0x1686 ,0xf029 ,0x82 ,2 ),/* Zoom UAC-2 */ IMPLICIT_FB_FIXED_DEV(0x2466, 0x8003, 0x86, 2), /* Fractal Audio Axe-Fx II */
Greg Kroah-Hartman
maintainerPATCH 338/356 HID: usbhid: Eliminate recurrent out-of-bounds bug in usbhid_parse()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Terry Junge <[email protected]>
commit fe7f7ac8e0c708446ff017453add769ffc15deed upstream.
Update struct hid_descriptor to better reflect the mandatory and optional parts of the HID Descriptor as per USB HID 1.11 specification.
Note: the kernel currently does not parse any optional HID class descriptors, only the mandatory report descriptor.
Update all references to member element desc[0] to rpt_desc.
Add test to verify bLength and bNumDescriptors values are valid.
Replace the for loop with direct access to the mandatory HID class descriptor member for the report descriptor. This eliminates the possibility of getting an out-of-bounds fault.
Add a warning message if the HID descriptor contains any unsupported optional HID class descriptors.
--- drivers/hid/hid-hyperv.c | 4 ++-- drivers/hid/usbhid/hid-core.c | 25 ++++++++++++++----------- drivers/usb/gadget/function/f_hid.c | 12 ++++++------ include/linux/hid.h | 3 ++- 4 files changed, 24 insertions(+), 20 deletions(-)
drivers/hid/hid-hyperv.c +2 -2
@@ -192,7 +192,7 @@ static void mousevsc_on_receive_device_i goto cleanup; input_device->report_desc_size =le16_to_cpu ( - desc->desc[0 ].wDescriptorLength); + desc->rpt_desc.wDescriptorLength);if (input_device->report_desc_size ==0 ) { input_device->dev_info_status = -EINVAL ; goto cleanup;
@@ -210,7 +210,7 @@ static void mousevsc_on_receive_device_imemcpy (input_device->report_desc, ((unsigned char *)desc) + desc->bLength, -le16_to_cpu (desc->desc[0 ].wDescriptorLength)); +le16_to_cpu (desc->rpt_desc.wDescriptorLength));/* Send the ack */ memset (&ack,0 ,sizeof (struct mousevsc_prt_msg ));
drivers/hid/usbhid/hid-core.c +14 -11
@@ -982,12 +982,11 @@ static int usbhid_parse(struct hid_devicstruct usb_host_interface *interface = intf->cur_altsetting;struct usb_device *dev =interface_to_usbdev (intf);struct hid_descriptor *hdesc; +struct hid_class_descriptor *hcdesc;u32 quirks =0 ;unsigned int rsize =0 ;char *rdesc; -int ret, n; -int num_descriptors; -size_t offset = offsetof(struct hid_descriptor , desc); +int ret; quirks =hid_lookup_quirk (hid);
@@ -1009,20 +1008,19 @@ static int usbhid_parse(struct hid_devicreturn -ENODEV ; } -if (hdesc->bLength <sizeof (struct hid_descriptor )) { -dbg_hid ("hid descriptor is too short\n" ); +if (!hdesc->bNumDescriptors || + hdesc->bLength !=sizeof (*hdesc) + + (hdesc->bNumDescriptors -1 ) *sizeof (*hcdesc)) { +dbg_hid ("hid descriptor invalid, bLen=%hhu bNum=%hhu\n" , + hdesc->bLength, hdesc->bNumDescriptors);return -EINVAL ; } hid->version =le16_to_cpu (hdesc->bcdHID); hid->country = hdesc->bCountryCode; - num_descriptors =min_t (int, hdesc->bNumDescriptors, - (hdesc->bLength - offset) /sizeof (struct hid_class_descriptor )); - -for (n =0 ; n < num_descriptors; n++) -if (hdesc->desc[n].bDescriptorType ==HID_DT_REPORT ) - rsize =le16_to_cpu (hdesc->desc[n].wDescriptorLength); +if (hdesc->rpt_desc.bDescriptorType ==HID_DT_REPORT ) + rsize =le16_to_cpu (hdesc->rpt_desc.wDescriptorLength);if (!rsize || rsize >HID_MAX_DESCRIPTOR_SIZE ) {dbg_hid ("weird size of report descriptor (%u)\n" , rsize);
@@ -1050,6 +1048,11 @@ static int usbhid_parse(struct hid_devic goto err; } +if (hdesc->bNumDescriptors >1 ) +hid_warn (intf, +"%u unsupported optional hid class descriptors\n" , + (int )(hdesc->bNumDescriptors -1 )); + hid->quirks |= quirks;return 0 ;
drivers/usb/gadget/function/f_hid.c +6 -6
@@ -118,8 +118,8 @@ static struct hid_descriptor hidg_desc = .bcdHID = cpu_to_le16(0x0101), .bCountryCode = 0x00, .bNumDescriptors = 0x1, -/*.desc[0].bDescriptorType = DYNAMIC */ -/*.desc[0].wDescriptorLenght = DYNAMIC */ +/*.rpt_desc.bDescriptorType = DYNAMIC */ +/*.rpt_desc.wDescriptorLength = DYNAMIC */ };/* Super-Speed Support */
@@ -728,8 +728,8 @@ static int hidg_setup(struct usb_functiostruct hid_descriptor hidg_desc_copy = hidg_desc;VDBG (cdev,"USB_REQ_GET_DESCRIPTOR: HID\n" ); - hidg_desc_copy.desc[0 ].bDescriptorType =HID_DT_REPORT ; - hidg_desc_copy.desc[0 ].wDescriptorLength = + hidg_desc_copy.rpt_desc.bDescriptorType =HID_DT_REPORT ; + hidg_desc_copy.rpt_desc.wDescriptorLength =cpu_to_le16 (hidg->report_desc_length); length = min_t(unsigned short, length,
@@ -970,8 +970,8 @@ static int hidg_bind(struct usb_configur* We can use hidg_desc struct here but we should not relay * that its content won't change after returning from this function. */ - hidg_desc.desc[0 ].bDescriptorType =HID_DT_REPORT ; - hidg_desc.desc[0 ].wDescriptorLength = + hidg_desc.rpt_desc.bDescriptorType =HID_DT_REPORT ; + hidg_desc.rpt_desc.wDescriptorLength =cpu_to_le16 (hidg->report_desc_length); hidg_hs_in_ep_desc.bEndpointAddress =
include/linux/hid.h +2 -1
@@ -736,8 +736,9 @@ struct hid_descriptor {__le16 bcdHID;__u8 bCountryCode;__u8 bNumDescriptors; +struct hid_class_descriptor rpt_desc; -struct hid_class_descriptor desc[1 ]; +struct hid_class_descriptor opt_descs[]; } __attribute__ ((packed));#define HID_DEVICE (b, g, ven, prod) \
Greg Kroah-Hartman
maintainerPATCH 339/356 io_uring: add io_file_can_poll() helper
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit 95041b93e90a06bb613ec4bef9cd4d61570f68e4 upstream.
This adds a flag to avoid dipping dereferencing file and then f_op to figure out if the file has a poll handler defined or not. We generally call this at least twice for networked workloads, and if using ring provided buffers, we do it on every buffer selection. Particularly the latter is troublesome, as it's otherwise a very fast operation.
--- include/linux/io_uring_types.h | 3 +++ io_uring/io_uring.c | 2 +- io_uring/io_uring.h | 12 ++++++++++++ io_uring/kbuf.c | 3 +-- io_uring/poll.c | 2 +- io_uring/rw.c | 4 ++-- 6 files changed, 20 insertions(+), 6 deletions(-)
include/linux/io_uring_types.h +3 -0
@@ -416,6 +416,7 @@ enum {/* keep async read/write and isreg together and in order */ REQ_F_SUPPORT_NOWAIT_BIT ,REQ_F_ISREG_BIT , +REQ_F_CAN_POLL_BIT ,/* not a real bit, just to check we're not overflowing the space */ __REQ_F_LAST_BIT,
@@ -483,6 +484,8 @@ enum {REQ_F_CLEAR_POLLIN =BIT (REQ_F_CLEAR_POLLIN_BIT ),/* hashed into ->cancel_hash_locked, protected by ->uring_lock */ REQ_F_HASH_LOCKED =BIT (REQ_F_HASH_LOCKED_BIT ), +/* file is pollable */ + REQ_F_CAN_POLL = BIT(REQ_F_CAN_POLL_BIT), };typedef void (*io_req_tw_func_t )(struct io_kiocb *req,struct io_tw_state *ts);
io_uring/io_uring.c +1 -1
@@ -1953,7 +1953,7 @@ fail:if (req->flags &REQ_F_FORCE_ASYNC ) {bool opcode_poll = def->pollin || def->pollout; -if (opcode_poll &&file_can_poll (req->file)) { +if (opcode_poll &&io_file_can_poll (req)) { needs_poll = true; issue_flags |=IO_URING_F_NONBLOCK ; }
io_uring/io_uring.h +12 -0
@@ -5,6 +5,7 @@#include <linux/lockdep.h> #include <linux/resume_user_mode.h> #include <linux/kasan.h> +#include <linux/poll.h> #include <linux/io_uring_types.h> #include <uapi/linux/eventpoll.h> #include "io-wq.h"
@@ -410,4 +411,15 @@ static inline size_t uring_sqe_size(strureturn 2 *sizeof (struct io_uring_sqe ); return sizeof(struct io_uring_sqe); } + +static inline bool io_file_can_poll (struct io_kiocb *req) +{ +if (req->flags &REQ_F_CAN_POLL ) +return true; +if (file_can_poll (req->file)) { + req->flags |=REQ_F_CAN_POLL ; +return true; + } +return false; +}#endif
io_uring/kbuf.c +1 -2
@@ -148,8 +148,7 @@ static void __user *io_ring_buffer_selec req->buf_list = bl; req->buf_index = buf->bid; -if (issue_flags &IO_URING_F_UNLOCKED || - (req->file && !file_can_poll (req->file))) { +if (issue_flags &IO_URING_F_UNLOCKED || !io_file_can_poll (req)) {/* * If we came in unlocked, we have no choice but to consume the * buffer here, otherwise nothing ensures that the buffer won't
io_uring/poll.c +1 -1
@@ -717,7 +717,7 @@ int io_arm_poll_handler(struct io_kiocbif (!def->pollin && !def->pollout)return IO_APOLL_ABORTED ; -if (!file_can_poll (req->file)) +if (!io_file_can_poll (req))return IO_APOLL_ABORTED ;if (!(req->flags &REQ_F_APOLL_MULTISHOT )) mask |=EPOLLONESHOT ;
io_uring/rw.c +2 -2
@@ -629,7 +629,7 @@ static bool io_rw_should_retry(struct io* just use poll if we can, and don't attempt if the fs doesn't * support callback based unlocks */ -if (file_can_poll (req->file) || !(req->file->f_mode &FMODE_BUF_RASYNC )) +if (io_file_can_poll (req) || !(req->file->f_mode &FMODE_BUF_RASYNC ))return false; wait->wait.func = io_async_buf_func;
@@ -783,7 +783,7 @@ static int __io_read(struct io_kiocb *reif (ret == -EAGAIN || (req->flags &REQ_F_REISSUE )) { req->flags &= ~REQ_F_REISSUE ;/* if we can poll, just do that */ -if (req->opcode ==IORING_OP_READ &&file_can_poll (req->file)) +if (req->opcode ==IORING_OP_READ &&io_file_can_poll (req))return -EAGAIN ;/* IOPOLL retry should happen for io-wq threads */ if (!force_nonblock && !(req->ctx->flags &IORING_SETUP_IOPOLL ))
Greg Kroah-Hartman
maintainerPATCH 340/356 io_uring/rw: allow pollable non-blocking attempts for !FMODE_NOWAIT
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit f7c9134385331c5ef36252895130aa01a92de907 upstream.
The checking for whether or not io_uring can do a non-blocking read or write attempt is gated on FMODE_NOWAIT. However, if the file is pollable, it's feasible to just check if it's currently in a state in which it can sanely receive or send _some_ data.
This avoids unnecessary io-wq punts, and repeated worthless retries before doing that punt, by assuming that some data can get delivered or received if poll tells us that is true. It also allows multishot reads to properly work with these types of files, enabling a bit of a cleanup of the logic that:
c9d952b9103b ("io_uring/rw: fix cflags posting for single issue multishot read")
had to put in place.
--- io_uring/rw.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)
io_uring/rw.c +16 -6
@@ -28,9 +28,19 @@ struct io_rw {rwf_t flags; }; -static inline bool io_file_supports_nowait (struct io_kiocb *req) +static bool io_file_supports_nowait (struct io_kiocb *req,__poll_t mask) { -return req->flags &REQ_F_SUPPORT_NOWAIT ; +/* If FMODE_NOWAIT is set for a file, we're golden */ +if (req->flags &REQ_F_SUPPORT_NOWAIT ) +return true; +/* No FMODE_NOWAIT, if we can poll, check the status */ +if (io_file_can_poll (req)) { +struct poll_table_struct pt = { ._key = mask }; + +return vfs_poll (req->file, &pt) & mask; + } +/* No FMODE_NOWAIT support, and file isn't pollable. Tough luck. */ +return false; }#ifdef CONFIG_COMPAT
@@ -685,8 +695,8 @@ static int io_rw_init_file(struct io_kio* supports async. Otherwise it's impossible to use O_NONBLOCK files * reliably. If not, or it IOCB_NOWAIT is set, don't retry. */ -if ((kiocb->ki_flags &IOCB_NOWAIT ) || - ((file->f_flags &O_NONBLOCK ) && !io_file_supports_nowait (req))) +if (kiocb->ki_flags &IOCB_NOWAIT || + ((file->f_flags &O_NONBLOCK && (req->flags &REQ_F_SUPPORT_NOWAIT )))) req->flags |=REQ_F_NOWAIT ;if (ctx->flags &IORING_SETUP_IOPOLL ) {
@@ -752,7 +762,7 @@ static int __io_read(struct io_kiocb *reif (force_nonblock) {/* If the file doesn't support async, just async punt */ -if (unlikely (!io_file_supports_nowait (req))) { +if (unlikely (!io_file_supports_nowait (req,EPOLLIN ))) { ret =io_setup_async_rw (req, iovec, s, true);return ret ?: -EAGAIN ; }
@@ -927,7 +937,7 @@ int io_write(struct io_kiocb *req, unsigif (force_nonblock) {/* If the file doesn't support async, just async punt */ -if (unlikely (!io_file_supports_nowait (req))) +if (unlikely (!io_file_supports_nowait (req,EPOLLOUT ))) goto copy_iov;/* File path supports NOWAIT for non-direct_IO only for block devices. */
Greg Kroah-Hartman
maintainerPATCH 341/356 io_uring/rw: fix wrong NOWAIT check in io_rw_init_file()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
Commit ae6a888a4357131c01d85f4c91fb32552dd0bf70 upstream.
A previous commit improved how !FMODE_NOWAIT is dealt with, but inadvertently negated a check whilst doing so. This caused -EAGAIN to be returned from reading files with O_NONBLOCK set. Fix up the check for REQ_F_SUPPORT_NOWAIT.
--- io_uring/rw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/rw.c +1 -1
@@ -696,7 +696,7 @@ static int io_rw_init_file(struct io_kio* reliably. If not, or it IOCB_NOWAIT is set, don't retry. */ if (kiocb->ki_flags &IOCB_NOWAIT || - ((file->f_flags &O_NONBLOCK && (req->flags &REQ_F_SUPPORT_NOWAIT )))) + ((file->f_flags &O_NONBLOCK && !(req->flags &REQ_F_SUPPORT_NOWAIT )))) req->flags |=REQ_F_NOWAIT ;if (ctx->flags &IORING_SETUP_IOPOLL ) {
Greg Kroah-Hartman
maintainerPATCH 342/356 Revert "io_uring: ensure deferred completions are posted for multishot"
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
This reverts commit 746e7d285dcb96caa1845fbbb62b14bf4010cdfb which is commit 687b2bae0efff9b25e071737d6af5004e6e35af5 upstream.
Jens writes:
There's some missing dependencies that makes this not work right, I'll bring it back in a series instead.
--- io_uring/io_uring.c | 8 -------- 1 file changed, 8 deletions(-)
io_uring/io_uring.c +0 -8
@@ -920,14 +920,6 @@ static bool __io_post_aux_cqe(struct io_ {bool filled; -/* -* If multishot has already posted deferred completions, ensure that -* those are flushed first before posting this one. If not, CQEs -* could get reordered. -*/ -if (!wq_list_empty (&ctx->submit_state.compl_reqs)) -__io_submit_flush_completions (ctx); -io_cq_lock (ctx); filled =io_fill_cqe_aux (ctx, user_data, res, cflags);if (!filled && allow_overflow)
Greg Kroah-Hartman
maintainerPATCH 343/356 posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit f90fff1e152dedf52b932240ebbd670d83330eca upstream.
If an exiting non-autoreaping task has already passed exit_notify() and calls handle_posix_cpu_timers() from IRQ, it can be reaped by its parent or debugger right after unlock_task_sighand().
If a concurrent posix_cpu_timer_del() runs at that moment, it won't be able to detect timer->it.cpu.firing != 0: cpu_timer_task_rcu() and/or lock_task_sighand() will fail.
Add the tsk->exit_state check into run_posix_cpu_timers() to fix this.
This fix is not needed if CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y, because exit_task_work() is called before exit_notify(). But the check still makes sense, task_work_add(&tsk->posix_cputimers_work.work) will fail anyway in this case.
--- kernel/time/posix-cpu-timers.c | 9 +++++++++ 1 file changed, 9 insertions(+)
kernel/time/posix-cpu-timers.c +9 -0
@@ -1438,6 +1438,15 @@ void run_posix_cpu_timers(void)lockdep_assert_irqs_disabled ();/* +* Ensure that release_task(tsk) can't happen while +* handle_posix_cpu_timers() is running. Otherwise, a concurrent +* posix_cpu_timer_del() may fail to lock_task_sighand(tsk) and +* miss timer->it.cpu.firing != 0. +*/ +if (tsk->exit_state) +return ; + +/* * If the actual expiry is deferred to task work context and the * work is already scheduled there is no point to do anything here. */
Greg Kroah-Hartman
maintainerPATCH 344/356 kbuild: Disable -Wdefault-const-init-unsafe
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
commit d0afcfeb9e3810ec89d1ffde1a0e36621bb75dca upstream.
A new on by default warning in clang [1] aims to flags instances where const variables without static or thread local storage or const members in aggregate types are not initialized because it can lead to an indeterminate value. This is quite noisy for the kernel due to instances originating from header files such as:
drivers/gpu/drm/i915/gt/intel_ring.h:62:2: error: default initialization of an object of type 'typeof (ring->size)' (aka 'const unsigned int') leaves the object uninitialized [-Werror,-Wdefault-const-init-var-unsafe]
62 | typecheck(typeof(ring->size), next);
| ^
include/linux/typecheck.h:10:9: note: expanded from macro 'typecheck'
10 | ({ type __dummy; \
| ^ include/net/ip.h:478:14: error: default initialization of an object of type 'typeof (rt->dst.expires)' (aka 'const unsigned long') leaves the object uninitialized [-Werror,-Wdefault-const-init-var-unsafe]
478 | if (mtu && time_before(jiffies, rt->dst.expires))
| ^
include/linux/jiffies.h:138:26: note: expanded from macro 'time_before'
138 | #define time_before(a,b) time_after(b,a)
| ^
include/linux/jiffies.h:128:3: note: expanded from macro 'time_after'
128 | (typecheck(unsigned long, a) && \
| ^
include/linux/typecheck.h:11:12: note: expanded from macro 'typecheck'
11 | typeof(x) __dummy2; \
| ^ include/linux/list.h:409:27: warning: default initialization of an object of type 'union (unnamed union at include/linux/list.h:409:27)' with const member leaves the object uninitialized [-Wdefault-const-init-field-unsafe]
409 | struct list_head *next = smp_load_acquire(&head->next);
| ^
include/asm-generic/barrier.h:176:29: note: expanded from macro 'smp_load_acquire'
176 | #define smp_load_acquire(p) __smp_load_acquire(p)
| ^
arch/arm64/include/asm/barrier.h:164:59: note: expanded from macro '__smp_load_acquire'
164 | union { __unqual_scalar_typeof(*p) __val; char __c[1]; } __u; \
| ^ include/linux/list.h:409:27: note: member '__val' declared 'const' here
crypto/scatterwalk.c:66:22: error: default initialization of an object of type 'struct scatter_walk' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe]
66 | struct scatter_walk walk;
| ^
include/crypto/algapi.h:112:15: note: member 'addr' declared 'const' here
112 | void *const addr;
| ^ fs/hugetlbfs/inode.c:733:24: error: default initialization of an object of type 'struct vm_area_struct' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe]
733 | struct vm_area_struct pseudo_vma;
| ^
include/linux/mm_types.h:803:20: note: member 'vm_flags' declared 'const' here
803 | const vm_flags_t vm_flags;
| ^Silencing the instances from typecheck.h is difficult because '= {}' is not available in older but supported compilers and '= {0}' would cause warnings about a literal 0 being treated as NULL. While it might be possible to come up with a local hack to silence the warning for clang-21+, it may not be worth it since -Wuninitialized will still trigger if an uninitialized const variable is actually used.
In all audited cases of the "field" variant of the warning, the members are either not used in the particular call path, modified through other means such as memset() / memcpy() because the containing object is not const, or are within a union with other non-const members.
Since this warning does not appear to have a high signal to noise ratio, just disable it.
--- scripts/Makefile.extrawarn | 12 ++++++++++++ 1 file changed, 12 insertions(+)
scripts/Makefile.extrawarn +12 -0
@@ -29,6 +29,18 @@ KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUND ifdef CONFIG_CC_IS_CLANG # The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable. KBUILD_CFLAGS += -Wno-gnu + +# Clang may emit a warning when a const variable, such as the dummy variables +# in typecheck(), or const member of an aggregate type are not initialized, +# which can result in unexpected behavior. However, in many audited cases of +# the "field" variant of the warning, this is intentional because the field is +# never used within a particular call path, the field is within a union with +# other non-const members, or the containing object is not const so the field +# can be modified via memcpy() / memset(). While the variable warning also gets +# disabled with this same switch, there should not be too much coverage lost +# because -Wuninitialized will still flag when an uninitialized const variable +# is used. +KBUILD_CFLAGS += $(call cc-disable-warning, default-const-init-unsafe) else # gcc inanely warns about local variables called 'main'
Greg Kroah-Hartman
maintainerPATCH 345/356 usb: usbtmc: Fix read_stb function and get_stb ioctl
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Penkler <[email protected]>
commit acb3dac2805d3342ded7dbbd164add32bbfdf21c upstream.
The usbtmc488_ioctl_read_stb function relied on a positive return from usbtmc_get_stb to reset the srq condition in the driver. The USBTMC_IOCTL_GET_STB case tested for a positive return to return the stb to the user.
Commit: <cac01bd178d6> ("usb: usbtmc: Fix erroneous get_stb ioctl error returns") changed the return value of usbtmc_get_stb to 0 on success instead of returning the value of usb_control_msg which is positive in the normal case. This change caused the function usbtmc488_ioctl_read_stb and the USBTMC_IOCTL_GET_STB ioctl to no longer function correctly.
Change the test in usbtmc488_ioctl_read_stb to test for failure first and return the failure code immediately.
Change the test for the USBTMC_IOCTL_GET_STB ioctl to test for 0 instead of a positive value.
--- drivers/usb/class/usbtmc.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/usb/class/usbtmc.c +9 -8
@@ -565,14 +565,15 @@ static int usbtmc488_ioctl_read_stb(stru rv =usbtmc_get_stb (file_data, &stb); -if (rv >0 ) { - srq_asserted =atomic_xchg (&file_data->srq_asserted, - srq_asserted); -if (srq_asserted) - stb |=0x40 ;/* Set RQS bit */ +if (rv <0 ) +return rv; + + srq_asserted =atomic_xchg (&file_data->srq_asserted, srq_asserted); +if (srq_asserted) + stb |=0x40 ;/* Set RQS bit */ + + rv =put_user (stb, (__u8 __user *)arg); - rv =put_user (stb, (__u8 __user *)arg); - }return rv; }
@@ -2201,7 +2202,7 @@ static long usbtmc_ioctl(struct file *ficase USBTMC_IOCTL_GET_STB : retval =usbtmc_get_stb (file_data, &tmp_byte); -if (retval >0 ) +if (!retval) retval =put_user (tmp_byte, (__u8 __user *)arg);break ;
Greg Kroah-Hartman
maintainerPATCH 346/356 VMCI: fix race between vmci_host_setup_notify and vmci_ctx_unset_notify
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wupeng Ma <[email protected]>
commit 1bd6406fb5f36c2bb1e96e27d4c3e9f4d09edde4 upstream.
During our test, it is found that a warning can be trigger in try_grab_folio as follow:
------------[ cut here ]------------ WARNING: CPU: 0 PID: 1678 at mm/gup.c:147 try_grab_folio+0x106/0x130 Modules linked in: CPU: 0 UID: 0 PID: 1678 Comm: syz.3.31 Not tainted 6.15.0-rc5 #163 PREEMPT(undef) RIP: 0010:try_grab_folio+0x106/0x130 Call Trace: <TASK> follow_huge_pmd+0x240/0x8e0 follow_pmd_mask.constprop.0.isra.0+0x40b/0x5c0 follow_pud_mask.constprop.0.isra.0+0x14a/0x170 follow_page_mask+0x1c2/0x1f0 __get_user_pages+0x176/0x950 __gup_longterm_locked+0x15b/0x1060 ? gup_fast+0x120/0x1f0 gup_fast_fallback+0x17e/0x230 get_user_pages_fast+0x5f/0x80 vmci_host_unlocked_ioctl+0x21c/0xf80 RIP: 0033:0x54d2cd ---[ end trace 0000000000000000 ]---
Digging into the source, context->notify_page may init by get_user_pages_fast and can be seen in vmci_ctx_unset_notify which will try to put_page. However get_user_pages_fast is not finished here and lead to following try_grab_folio warning. The race condition is shown as follow:
cpu0 cpu1vmci_host_do_set_notifyvmci_host_setup_notifyget_user_pages_fast(uva, 1, FOLL_WRITE, &context->notify_page); lockless_pages_from_mmgup_pgd_rangegup_huge_pmd // update &context->notify_page
vmci_host_do_set_notify vmci_ctx_unset_notify notify_page = context->notify_page; if (notify_page) put_page(notify_page); // page is freed
__gup_longterm_locked__get_user_pagesfollow_trans_huge_pmdtry_grab_folio // warn here
To slove this, use local variable page to make notify_page can be seen after finish get_user_pages_fast.
--- drivers/misc/vmw_vmci/vmci_host.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/misc/vmw_vmci/vmci_host.c +5 -6
@@ -227,6 +227,7 @@ static int drv_cp_harray_to_user(void __static int vmci_host_setup_notify (struct vmci_ctx *context,unsigned long uva) { +struct page *page;int retval;if (context->notify_page) {
@@ -243,13 +244,11 @@ static int vmci_host_setup_notify(struct/* * Lock physical page backing a given user VA. */ - retval =get_user_pages_fast (uva,1 ,FOLL_WRITE , &context->notify_page); -if (retval !=1 ) { - context->notify_page =NULL ; + retval =get_user_pages_fast (uva,1 ,FOLL_WRITE , &page); +if (retval !=1 )return VMCI_ERROR_GENERIC ; - } -if (context->notify_page ==NULL ) -return VMCI_ERROR_UNAVAILABLE ; + + context->notify_page = page;/* * Map the locked page and set up notify pointer.
Greg Kroah-Hartman
maintainerPATCH 347/356 usb: cdnsp: Fix issue with detecting command completion event
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pawel Laszczak <[email protected]>
commit f4ecdc352646f7d23f348e5c544dbe3212c94fc8 upstream.
In some cases, there is a small-time gap in which CMD_RING_BUSY can be cleared by controller but adding command completion event to event ring will be delayed. As the result driver will return error code.
This behavior has been detected on usbtest driver (test 9) with configuration including ep1in/ep1out bulk and ep2in/ep2out isoc endpoint.
Probably this gap occurred because controller was busy with adding some other events to event ring.
The CMD_RING_BUSY is cleared to '0' when the Command Descriptor has been executed and not when command completion event has been added to event ring.
To fix this issue for this test the small delay is sufficient less than 10us) but to make sure the problem doesn't happen again in the future the patch introduces 10 retries to check with delay about 20us before returning error code.
--- drivers/usb/cdns3/cdnsp-gadget.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
drivers/usb/cdns3/cdnsp-gadget.c +17 -1
@@ -546,6 +546,7 @@ int cdnsp_wait_for_cmd_compl(struct cdnsdma_addr_t cmd_deq_dma;union cdnsp_trb *event;u32 cycle_state; +u32 retry =10 ;int ret, val;u64 cmd_dma;u32 flags;
@@ -577,8 +578,23 @@ int cdnsp_wait_for_cmd_compl(struct cdns flags =le32_to_cpu (event->event_cmd.flags);/* Check the owner of the TRB. */ -if ((flags &TRB_CYCLE ) != cycle_state) +if ((flags &TRB_CYCLE ) != cycle_state) { +/* +* Give some extra time to get chance controller +* to finish command before returning error code. +* Checking CMD_RING_BUSY is not sufficient because +* this bit is cleared to '0' when the Command +* Descriptor has been executed by controller +* and not when command completion event has +* be added to event ring. +*/ +if (retry--) { +udelay (20 ); +continue ; + } +return -EINVAL ; + } cmd_dma =le64_to_cpu (event->event_cmd.cmd_trb);
Greg Kroah-Hartman
maintainerPATCH 348/356 usb: cdnsp: Fix issue with detecting USB 3.2 speed
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pawel Laszczak <[email protected]>
commit 2852788cfbe9ca1ab68509d65804413871f741f9 upstream.
Patch adds support for detecting SuperSpeedPlus Gen1 x2 and SuperSpeedPlus Gen2 x2 speed.
--- drivers/usb/cdns3/cdnsp-gadget.c | 3 ++- drivers/usb/cdns3/cdnsp-gadget.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/usb/cdns3/cdnsp-gadget.c +2 -1
@@ -28,7 +28,8 @@unsigned int cdnsp_port_speed (unsigned int port_status) {/*Detect gadget speed based on PORTSC register*/ -if (DEV_SUPERSPEEDPLUS (port_status)) +if (DEV_SUPERSPEEDPLUS (port_status) || +DEV_SSP_GEN1x2 (port_status) ||DEV_SSP_GEN2x2 (port_status))return USB_SPEED_SUPER_PLUS ;else if (DEV_SUPERSPEED (port_status))return USB_SPEED_SUPER ;
drivers/usb/cdns3/cdnsp-gadget.h +4 -0
@@ -285,11 +285,15 @@ struct cdnsp_port_regs {#define XDEV_HS (0x3 << 10)#define XDEV_SS (0x4 << 10)#define XDEV_SSP (0x5 << 10) +#define XDEV_SSP1x2 (0x6 << 10) +#define XDEV_SSP2x2 (0x7 << 10)#define DEV_UNDEFSPEED (p) (((p) & DEV_SPEED_MASK) == (0x0 << 10))#define DEV_FULLSPEED (p) (((p) & DEV_SPEED_MASK) == XDEV_FS)#define DEV_HIGHSPEED (p) (((p) & DEV_SPEED_MASK) == XDEV_HS)#define DEV_SUPERSPEED (p) (((p) & DEV_SPEED_MASK) == XDEV_SS)#define DEV_SUPERSPEEDPLUS (p) (((p) & DEV_SPEED_MASK) == XDEV_SSP) +#define DEV_SSP_GEN1x2 (p) (((p) & DEV_SPEED_MASK) == XDEV_SSP1x2) +#define DEV_SSP_GEN2x2 (p) (((p) & DEV_SPEED_MASK) == XDEV_SSP2x2)#define DEV_SUPERSPEED_ANY (p) (((p) & DEV_SPEED_MASK) >= XDEV_SS)#define DEV_PORT_SPEED (p) (((p) >> 10) & 0x0f)/* Port Link State Write Strobe - set this when changing link state */
Greg Kroah-Hartman
maintainerPATCH 349/356 usb: Flush altsetting 0 endpoints before reinitializating them after reset.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Nyman <[email protected]>
commit 89bb3dc13ac29a563f4e4c555e422882f64742bd upstream.
usb core avoids sending a Set-Interface altsetting 0 request after device reset, and instead relies on calling usb_disable_interface() and usb_enable_interface() to flush and reset host-side of those endpoints.
xHCI hosts allocate and set up endpoint ring buffers and host_ep->hcpriv during usb_hcd_alloc_bandwidth() callback, which in this case is called before flushing the endpoint in usb_disable_interface().
Call usb_disable_interface() before usb_hcd_alloc_bandwidth() to ensure URBs are flushed before new ring buffers for the endpoints are allocated.
Otherwise host driver will attempt to find and remove old stale URBs from a freshly allocated new ringbuffer.
--- drivers/usb/core/hub.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/usb/core/hub.c +14 -2
@@ -6103,6 +6103,7 @@ static int usb_reset_and_verify_device(sstruct usb_hub *parent_hub;struct usb_hcd *hcd =bus_to_hcd (udev->bus);struct usb_device_descriptor descriptor; +struct usb_interface *intf;struct usb_host_bos *bos;int i, j, ret =0 ;int port1 = udev->portnum;
@@ -6160,6 +6161,18 @@ static int usb_reset_and_verify_device(sif (!udev->actconfig) goto done; +/* +* Some devices can't handle setting default altsetting 0 with a +* Set-Interface request. Disable host-side endpoints of those +* interfaces here. Enable and reset them back after host has set +* its internal endpoint structures during usb_hcd_alloc_bandwith() +*/ +for (i =0 ; i < udev->actconfig->desc.bNumInterfaces; i++) { + intf = udev->actconfig->interface[i]; +if (intf->cur_altsetting->desc.bAlternateSetting ==0 ) +usb_disable_interface (udev, intf, true); + } +mutex_lock (hcd->bandwidth_mutex); ret =usb_hcd_alloc_bandwidth (udev, udev->actconfig,NULL ,NULL );if (ret <0 ) {
@@ -6191,12 +6204,11 @@ static int usb_reset_and_verify_device(s*/ for (i =0 ; i < udev->actconfig->desc.bNumInterfaces; i++) {struct usb_host_config *config = udev->actconfig; -struct usb_interface *intf = config->interface[i];struct usb_interface_descriptor *desc; + intf = config->interface[i]; desc = &intf->cur_altsetting->desc;if (desc->bAlternateSetting ==0 ) { -usb_disable_interface (udev, intf, true);usb_enable_interface (udev, intf, true); ret =0 ; }else {
Greg Kroah-Hartman
maintainerPATCH 350/356 usb: typec: tcpm/tcpci_maxim: Fix bounds check in process_rx()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amit Sunil Dhamne <[email protected]>
commit 0736299d090f5c6a1032678705c4bc0a9511a3db upstream.
Register read of TCPC_RX_BYTE_CNT returns the total size consisting of:
PD message (pending read) size + 1 Byte for Frame Type (SOP*)
This is validated against the max PD message (struct pd_message) size without accounting for the extra byte for the frame type. Note that the struct pd_message does not contain a field for the frame_type. This results in false negatives when the "PD message (pending read)" is equal to the max PD message size.
--- drivers/usb/typec/tcpm/tcpci_maxim_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/typec/tcpm/tcpci_maxim_core.c +2 -1
@@ -145,7 +145,8 @@ static void process_rx(struct max_tcpci_return ; } -if (count >sizeof (struct pd_message ) || count +1 >TCPC_RECEIVE_BUFFER_LEN ) { +if (count >sizeof (struct pd_message ) +1 || + count +1 >TCPC_RECEIVE_BUFFER_LEN ) {dev_err (chip->dev,"Invalid TCPC_RX_BYTE_CNT %d\n" , count);return ; }
Greg Kroah-Hartman
maintainerPATCH 351/356 xen/arm: call uaccess_ttbr0_enable for dm_op hypercall
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefano Stabellini <[email protected]>
commit 7f9bbc1140ff8796230bc2634055763e271fd692 upstream.
dm_op hypercalls might come from userspace and pass memory addresses as parameters. The memory addresses typically correspond to buffers allocated in userspace to hold extra hypercall parameters.
On ARM, when CONFIG_ARM64_SW_TTBR0_PAN is enabled, they might not be accessible by Xen, as a result ioreq hypercalls might fail. See the existing comment in arch/arm64/xen/hypercall.S regarding privcmd_call for reference.
For privcmd_call, Linux calls uaccess_ttbr0_enable before issuing the hypercall thanks to commit 9cf09d68b89a. We need to do the same for dm_op. This resolves the problem.
Message-ID: <alpine.DEB.2.22.394.2505121446370.8380@ubuntu-linux-20-04-desktop>
--- arch/arm64/xen/hypercall.S | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
arch/arm64/xen/hypercall.S +20 -1
@@ -83,7 +83,26 @@ HYPERCALL3(vcpu_op); HYPERCALL1(platform_op_raw); HYPERCALL2(multicall); HYPERCALL2(vm_assist); -HYPERCALL3(dm_op); + +SYM_FUNC_START(HYPERVISOR_dm_op) + mov x16, #__HYPERVISOR_dm_op; \ + /* + * dm_op hypercalls are issued by the userspace. The kernel needs to + * enable access to TTBR0_EL1 as the hypervisor would issue stage 1 + * translations to user memory via AT instructions. Since AT + * instructions are not affected by the PAN bit (ARMv8.1), we only + * need the explicit uaccess_enable/disable if the TTBR0 PAN emulation + * is enabled (it implies that hardware UAO and PAN disabled). + */ + uaccess_ttbr0_enable x6, x7, x8 + hvc XEN_IMM + + /* + * Disable userspace access from kernel once the hyp call completed. + */ + uaccess_ttbr0_disable x6, x7 + ret +SYM_FUNC_END(HYPERVISOR_dm_op); SYM_FUNC_START(privcmd_call) mov x16, x0
Greg Kroah-Hartman
maintainerPATCH 352/356 x86/iopl: Cure TIF_IO_BITMAP inconsistencies
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
commit 8b68e978718f14fdcb080c2a7791c52a0d09bc6d upstream.
io_bitmap_exit() is invoked from exit_thread() when a task exists or when a fork fails. In the latter case the exit_thread() cleans up resources which were allocated during fork().
io_bitmap_exit() invokes task_update_io_bitmap(), which in turn ends up in tss_update_io_bitmap(). tss_update_io_bitmap() operates on the current task. If current has TIF_IO_BITMAP set, but no bitmap installed, tss_update_io_bitmap() crashes with a NULL pointer dereference.
There are two issues, which lead to that problem:
1) io_bitmap_exit() should not invoke task_update_io_bitmap() when the task, which is cleaned up, is not the current task. That's a clear indicator for a cleanup after a failed fork().
2) A task should not have TIF_IO_BITMAP set and neither a bitmap installed nor IOPL emulation level 3 activated.
This happens when a kernel thread is created in the context of a user space thread, which has TIF_IO_BITMAP set as the thread flags are copied and the IO bitmap pointer is cleared.
Other than in the failed fork() case this has no impact because kernel threads including IO workers never return to user space and therefore never invoke tss_update_io_bitmap().
Cure this by adding the missing cleanups and checks:
1) Prevent io_bitmap_exit() to invoke task_update_io_bitmap() if the to be cleaned up task is not the current task.
2) Clear TIF_IO_BITMAP in copy_thread() unconditionally. For user space forks it is set later, when the IO bitmap is inherited in io_bitmap_share().
For paranoia sake, add a warning into tss_update_io_bitmap() to catch the case, when that code is invoked with inconsistent state.
--- arch/x86/kernel/ioport.c | 13 +++++++++---- arch/x86/kernel/process.c | 6 ++++++ 2 files changed, 15 insertions(+), 4 deletions(-)
arch/x86/kernel/ioport.c +9 -4
@@ -33,8 +33,9 @@ void io_bitmap_share(struct task_structset_tsk_thread_flag (tsk,TIF_IO_BITMAP ); } -static void task_update_io_bitmap (struct task_struct *tsk) +static void task_update_io_bitmap (void ) { +struct task_struct *tsk = current;struct thread_struct *t = &tsk->thread;if (t->iopl_emul ==3 || t->io_bitmap) {
@@ -54,7 +55,12 @@ void io_bitmap_exit(struct task_struct *struct io_bitmap *iobm = tsk->thread.io_bitmap; tsk->thread.io_bitmap =NULL ; -task_update_io_bitmap (tsk); +/* +* Don't touch the TSS when invoked on a failed fork(). TSS +* reflects the state of @current and not the state of @tsk. +*/ +if (tsk == current) +task_update_io_bitmap ();if (iobm &&refcount_dec_and_test (&iobm->refcnt))kfree (iobm); }
@@ -192,8 +198,7 @@ SYSCALL_DEFINE1(iopl, unsigned int, leve } t->iopl_emul = level; -task_update_io_bitmap (current); - +task_update_io_bitmap ();return 0 ; }
arch/x86/kernel/process.c +6 -0
@@ -180,6 +180,7 @@ int copy_thread(struct task_struct *p, c frame->ret_addr = (unsigned long ) ret_from_fork_asm; p->thread.sp = (unsigned long ) fork_frame; p->thread.io_bitmap =NULL ; +clear_tsk_thread_flag (p,TIF_IO_BITMAP ); p->thread.iopl_warn =0 ;memset (p->thread.ptrace_bps,0 ,sizeof (p->thread.ptrace_bps));
@@ -468,6 +469,11 @@ void native_tss_update_io_bitmap(void) }else {struct io_bitmap *iobm = t->io_bitmap; +if (WARN_ON_ONCE (!iobm)) { +clear_thread_flag (TIF_IO_BITMAP ); +native_tss_invalidate_io_bitmap (); + } +/* * Only copy bitmap data when the sequence number differs. The * update time is accounted to the incoming task.
Greg Kroah-Hartman
maintainerPATCH 353/356 calipso: unlock rcu before returning -EAFNOSUPPORT
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 3cae906e1a6184cdc9e4d260e4dbdf9a118d94ad upstream.
syzbot reported that a recent patch forgot to unlock rcu in the error path.
Adopt the convention that netlbl_conn_setattr() is already using.
--- net/netlabel/netlabel_kapi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/netlabel/netlabel_kapi.c +4 -2
@@ -1140,8 +1140,10 @@ int netlbl_conn_setattr(struct sock *sk,break ;#if IS_ENABLED (CONFIG_IPV6 )case AF_INET6 : -if (sk->sk_family !=AF_INET6 ) -return -EAFNOSUPPORT ; +if (sk->sk_family !=AF_INET6 ) { + ret_val = -EAFNOSUPPORT ; + goto conn_setattr_return; + } addr6 = (struct sockaddr_in6 *)addr; entry = netlbl_domhsh_getentry_af6(secattr->domain,
Greg Kroah-Hartman
maintainerPATCH 354/356 regulator: dt-bindings: mt6357: Drop fixed compatible requirement
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nícolas F. R. A. Prado <[email protected]>
commit 9cfdd7752ba5f8cc9b8191e8c9aeeec246241fa4 upstream.
Some of the regulators on the MT6357 PMIC currently reference the fixed-regulator dt-binding, which enforces the presence of a regulator-fixed compatible. However since all regulators on the MT6357 PMIC are handled by a single mt6357-regulator driver, probed through MFD, the compatibles don't serve any purpose. In fact they cause failures in the DT kselftest since they aren't probed by the fixed regulator driver as would be expected. Furthermore this is the only dt-binding in this family like this: mt6359-regulator and mt6358-regulator don't require those compatibles.
Commit d77e89b7b03f ("arm64: dts: mediatek: mt6357: Drop regulator-fixed compatibles") removed the compatibles from Devicetree, but missed updating the binding, which still requires them, introducing dt-binding errors. Remove the compatible requirement by referencing the plain regulator dt-binding instead to fix the dt-binding errors.
--- Documentation/devicetree/bindings/regulator/mediatek,mt6357-regulator.yaml | 12 ---------- 1 file changed, 1 insertion(+), 11 deletions(-)
Documentation/devicetree/bindings/regulator/mediatek,mt6357-regulator.yaml +1 -11
@@ -33,7 +33,7 @@ patternProperties: "^ldo-v(camio18|aud28|aux18|io18|io28|rf12|rf18|cn18|cn28|fe28)$": type: object - $ref: fixed-regulator.yaml# + $ref: regulator.yaml# unevaluatedProperties: false description: Properties for single fixed LDO regulator.
@@ -112,7 +112,6 @@ examples: regulator-enable-ramp-delay = <220>; }; mt6357_vfe28_reg: ldo-vfe28 { - compatible = "regulator-fixed"; regulator-name = "vfe28"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>;
@@ -125,14 +124,12 @@ examples: regulator-enable-ramp-delay = <110>; }; mt6357_vrf18_reg: ldo-vrf18 { - compatible = "regulator-fixed"; regulator-name = "vrf18"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; regulator-enable-ramp-delay = <110>; }; mt6357_vrf12_reg: ldo-vrf12 { - compatible = "regulator-fixed"; regulator-name = "vrf12"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1200000>;
@@ -157,14 +154,12 @@ examples: regulator-enable-ramp-delay = <264>; }; mt6357_vcn28_reg: ldo-vcn28 { - compatible = "regulator-fixed"; regulator-name = "vcn28"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; regulator-enable-ramp-delay = <264>; }; mt6357_vcn18_reg: ldo-vcn18 { - compatible = "regulator-fixed"; regulator-name = "vcn18"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>;
@@ -183,7 +178,6 @@ examples: regulator-enable-ramp-delay = <264>; }; mt6357_vcamio_reg: ldo-vcamio18 { - compatible = "regulator-fixed"; regulator-name = "vcamio"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>;
@@ -212,28 +206,24 @@ examples: regulator-always-on; }; mt6357_vaux18_reg: ldo-vaux18 { - compatible = "regulator-fixed"; regulator-name = "vaux18"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; regulator-enable-ramp-delay = <264>; }; mt6357_vaud28_reg: ldo-vaud28 { - compatible = "regulator-fixed"; regulator-name = "vaud28"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; regulator-enable-ramp-delay = <264>; }; mt6357_vio28_reg: ldo-vio28 { - compatible = "regulator-fixed"; regulator-name = "vio28"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; regulator-enable-ramp-delay = <264>; }; mt6357_vio18_reg: ldo-vio18 { - compatible = "regulator-fixed"; regulator-name = "vio18"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>;
Greg Kroah-Hartman
maintainerPATCH 355/356 net: usb: aqc111: debug info before sanitation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
commit d3faab9b5a6a0477d69c38bd11c43aa5e936f929 upstream.
If we sanitize error returns, the debug statements need to come before that so that we don't lose information.
--- drivers/net/usb/aqc111.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/usb/aqc111.c +4 -4
@@ -31,11 +31,11 @@ static int aqc111_read_cmd_nopm(struct u USB_RECIP_DEVICE, value, index, data, size);if (unlikely (ret < size)) { - ret = ret <0 ? ret : -ENODATA ; -netdev_warn (dev->net,"Failed to read(0x%x) reg index 0x%04x: %d\n" , cmd, index, ret); + + ret = ret <0 ? ret : -ENODATA ; }return ret;
@@ -50,11 +50,11 @@ static int aqc111_read_cmd(struct usbnet USB_RECIP_DEVICE, value, index, data, size);if (unlikely (ret < size)) { - ret = ret <0 ? ret : -ENODATA ; -netdev_warn (dev->net,"Failed to read(0x%x) reg index 0x%04x: %d\n" , cmd, index, ret); + + ret = ret <0 ? ret : -ENODATA ; }return ret;
Greg Kroah-Hartman
maintainerPATCH 356/356 drm/meson: Use 1000ULL when operating with mode->clock
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: I Hsin Cheng <[email protected]>
commit eb0851e14432f3b87c77b704c835ac376deda03a upstream.
Coverity scan reported the usage of "mode->clock * 1000" may lead to integer overflow. Use "1000ULL" instead of "1000"
when utilizing it to avoid potential integer overflow issue.
--- drivers/gpu/drm/meson/meson_encoder_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/meson/meson_encoder_hdmi.c +2 -2
@@ -75,7 +75,7 @@ static void meson_encoder_hdmi_set_vclk(unsigned long long venc_freq;unsigned long long hdmi_freq; - vclk_freq = mode->clock *1000 ; + vclk_freq = mode->clock *1000ULL ;/* For 420, pixel clock is half unlike venc clock */ if (encoder_hdmi->output_bus_fmt ==MEDIA_BUS_FMT_UYYVYY8_0_5X24 )
@@ -123,7 +123,7 @@ static enum drm_mode_status meson_encodestruct meson_encoder_hdmi *encoder_hdmi =bridge_to_meson_encoder_hdmi (bridge);struct meson_drm *priv = encoder_hdmi->priv;bool is_hdmi2_sink = display_info->hdmi.scdc.supported; -unsigned long long clock = mode->clock *1000 ; +unsigned long long clock = mode->clock *1000ULL ;unsigned long long phy_freq;unsigned long long vclk_freq;unsigned long long venc_freq;
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.94 release. There are 356 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 19 Jun 2025 15:22:33 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.94-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMTB using 32-bit and 64-bit kernels, build on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.94 release. There are 356 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 19 Jun 2025 15:22:33 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.94-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Am 17.06.2025 um 17:21 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.6.94 release. There are 356 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697 v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.94 release. There are 356 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 19 Jun 2025 15:22:33 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.94-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.94 release. There are 356 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 19 Jun 2025 15:22:33 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.94-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v6.6:
10 builds: 10 pass, 0 fail
28 boots: 28 pass, 0 fail
120 tests: 120 pass, 0 failLinux version: 6.6.94-rc1-g7ef12da06319
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000,
tegra194-p3509-0000+p3668-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04Jon
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.94 release. There are 356 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 19 Jun 2025 15:22:33 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.94-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 6.6.94-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git commit: 7ef12da06319e12118a7bbb823004d011c57f718
* git describe: v6.6.93-357-g7ef12da06319
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.6.y/build/v6.6.93-357-g7ef12da06319
## Test Regressions (compared to v6.6.92-445-g58cbe685685b)
## Metric Regressions (compared to v6.6.92-445-g58cbe685685b)
## Test Fixes (compared to v6.6.92-445-g58cbe685685b)
## Metric Fixes (compared to v6.6.92-445-g58cbe685685b)
## Test result summary
total: 217939, pass: 198129, fail: 4284, skip: 15211, xfail: 315
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 129 total, 127 passed, 0 failed, 2 skipped
* arm64: 44 total, 43 passed, 0 failed, 1 skipped
* i386: 23 total, 23 passed, 0 failed
* mips: 26 total, 25 passed, 1 failed
* parisc: 4 total, 4 passed, 0 failed
* powerpc: 32 total, 31 passed, 1 failed
* riscv: 15 total, 15 passed, 0 failed
* s390: 14 total, 13 passed, 1 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 7 total, 7 passed, 0 failed
* x86_64: 37 total, 37 passed, 0 failed
## Test suites summary
* boot
* commands
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-efivarfs
* kselftest-exec
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-kcmp
* kselftest-kvm
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-mincore
* kselftest-mm
* kselftest-mqueue
* kselftest-net
* kselftest-net-mptcp
* kselftest-openat2
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-tc-testing
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user_events
* kselftest-vDSO
* kselftest-x86
* kunit
* kvm-unit-tests
* lava
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-build-clang
* log-parser-build-gcc
* log-parser-test
* ltp-capability
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-hugetlb
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* modules
* perf
* rcutorture
--
Linaro LKFT
https://lkft.linaro.org
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.94 release. There are 356 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines · On Tue, 17 Jun 2025 17:21:55 +0200 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.6.94 release. There are 356 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 19 Jun 2025 15:22:33 +0000. Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64:
Thanks!
Cheers,
Miguel
The kernel, bpf tool, and perf tool builds fine for v6.6.94-rc1 on x86 and arm64 Azure VM.
Kernel binary size for x86 build:
text data bss dec hex filename 27323024 16732614 4640768 48696406 2e70c56 vmlinux
Kernel binary size for arm64 build:
text data bss dec hex filename 34718829 13854454 970368 49543651 2f3f9e3 vmlinux
Thanks,
Hardik
Hi Greg,
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.94 release. There are 356 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
No problems seen on x86_64 and aarch64 with our testing.
Thanks,
Harshit
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 6.6.94 release. There are 356 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-6.6.y
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany