From: Greg Kroah-Hartman Date: Tue, 18 Feb 2025 17:41:56 +0000 (+0100) Subject: 6.12-stable patches X-Git-Tag: v6.1.129~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c3a8973fbf41ef8d115160324488f554f9ebe667;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: cpufreq-amd-pstate-remove-the-goto-label-in-amd_pstate_update_limits.patch net-ipv6-fix-dst-refleaks-in-rpl-seg6-and-ioam6-lwtunnels.patch scsi-ufs-core-ensure-clk_gating.lock-is-used-only-after-initialization.patch --- diff --git a/queue-6.12/cpufreq-amd-pstate-remove-the-goto-label-in-amd_pstate_update_limits.patch b/queue-6.12/cpufreq-amd-pstate-remove-the-goto-label-in-amd_pstate_update_limits.patch new file mode 100644 index 0000000000..5432ded5b9 --- /dev/null +++ b/queue-6.12/cpufreq-amd-pstate-remove-the-goto-label-in-amd_pstate_update_limits.patch @@ -0,0 +1,46 @@ +From d364eee14c682b141f4667efc3c65191339d88bd Mon Sep 17 00:00:00 2001 +From: Dhananjay Ugwekar +Date: Wed, 5 Feb 2025 11:25:12 +0000 +Subject: cpufreq/amd-pstate: Remove the goto label in amd_pstate_update_limits + +From: Dhananjay Ugwekar + +commit d364eee14c682b141f4667efc3c65191339d88bd upstream. + +Scope based guard/cleanup macros should not be used together with goto +labels. Hence, remove the goto label. + +Fixes: 6c093d5a5b73 ("cpufreq/amd-pstate: convert mutex use to guard()") +Signed-off-by: Dhananjay Ugwekar +Reviewed-by: Mario Limonciello +Link: https://lore.kernel.org/r/20250205112523.201101-2-dhananjay.ugwekar@amd.com +Signed-off-by: Mario Limonciello +Signed-off-by: Greg Kroah-Hartman +--- + drivers/cpufreq/amd-pstate.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/cpufreq/amd-pstate.c ++++ b/drivers/cpufreq/amd-pstate.c +@@ -796,8 +796,10 @@ static void amd_pstate_update_limits(uns + guard(mutex)(&amd_pstate_driver_lock); + + ret = amd_get_highest_perf(cpu, &cur_high); +- if (ret) +- goto free_cpufreq_put; ++ if (ret) { ++ cpufreq_cpu_put(policy); ++ return; ++ } + + prev_high = READ_ONCE(cpudata->prefcore_ranking); + highest_perf_changed = (prev_high != cur_high); +@@ -807,8 +809,6 @@ static void amd_pstate_update_limits(uns + if (cur_high < CPPC_MAX_PERF) + sched_set_itmt_core_prio((int)cur_high, cpu); + } +- +-free_cpufreq_put: + cpufreq_cpu_put(policy); + + if (!highest_perf_changed) diff --git a/queue-6.12/net-ipv6-fix-dst-refleaks-in-rpl-seg6-and-ioam6-lwtunnels.patch b/queue-6.12/net-ipv6-fix-dst-refleaks-in-rpl-seg6-and-ioam6-lwtunnels.patch new file mode 100644 index 0000000000..7ef27249cf --- /dev/null +++ b/queue-6.12/net-ipv6-fix-dst-refleaks-in-rpl-seg6-and-ioam6-lwtunnels.patch @@ -0,0 +1,118 @@ +From c71a192976ded2f2f416d03c4f595cdd4478b825 Mon Sep 17 00:00:00 2001 +From: Jakub Kicinski +Date: Wed, 29 Jan 2025 19:15:18 -0800 +Subject: net: ipv6: fix dst refleaks in rpl, seg6 and ioam6 lwtunnels + +From: Jakub Kicinski + +commit c71a192976ded2f2f416d03c4f595cdd4478b825 upstream. + +dst_cache_get() gives us a reference, we need to release it. + +Discovered by the ioam6.sh test, kmemleak was recently fixed +to catch per-cpu memory leaks. + +Fixes: 985ec6f5e623 ("net: ipv6: rpl_iptunnel: mitigate 2-realloc issue") +Fixes: 40475b63761a ("net: ipv6: seg6_iptunnel: mitigate 2-realloc issue") +Fixes: dce525185bc9 ("net: ipv6: ioam6_iptunnel: mitigate 2-realloc issue") +Reviewed-by: Justin Iurman +Reviewed-by: Simon Horman +Link: https://patch.msgid.link/20250130031519.2716843-1-kuba@kernel.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv6/ioam6_iptunnel.c | 5 +++-- + net/ipv6/rpl_iptunnel.c | 6 ++++-- + net/ipv6/seg6_iptunnel.c | 6 ++++-- + 3 files changed, 11 insertions(+), 6 deletions(-) + +--- a/net/ipv6/ioam6_iptunnel.c ++++ b/net/ipv6/ioam6_iptunnel.c +@@ -338,7 +338,7 @@ static int ioam6_do_encap(struct net *ne + + static int ioam6_output(struct net *net, struct sock *sk, struct sk_buff *skb) + { +- struct dst_entry *dst = skb_dst(skb), *cache_dst; ++ struct dst_entry *dst = skb_dst(skb), *cache_dst = NULL; + struct in6_addr orig_daddr; + struct ioam6_lwt *ilwt; + int err = -EINVAL; +@@ -409,7 +409,6 @@ do_encap: + cache_dst = ip6_route_output(net, NULL, &fl6); + if (cache_dst->error) { + err = cache_dst->error; +- dst_release(cache_dst); + goto drop; + } + +@@ -431,8 +430,10 @@ do_encap: + return dst_output(net, sk, skb); + } + out: ++ dst_release(cache_dst); + return dst->lwtstate->orig_output(net, sk, skb); + drop: ++ dst_release(cache_dst); + kfree_skb(skb); + return err; + } +--- a/net/ipv6/rpl_iptunnel.c ++++ b/net/ipv6/rpl_iptunnel.c +@@ -232,7 +232,6 @@ static int rpl_output(struct net *net, s + dst = ip6_route_output(net, NULL, &fl6); + if (dst->error) { + err = dst->error; +- dst_release(dst); + goto drop; + } + +@@ -254,6 +253,7 @@ static int rpl_output(struct net *net, s + return dst_output(net, sk, skb); + + drop: ++ dst_release(dst); + kfree_skb(skb); + return err; + } +@@ -272,8 +272,10 @@ static int rpl_input(struct sk_buff *skb + local_bh_enable(); + + err = rpl_do_srh(skb, rlwt, dst); +- if (unlikely(err)) ++ if (unlikely(err)) { ++ dst_release(dst); + goto drop; ++ } + + if (!dst) { + ip6_route_input(skb); +--- a/net/ipv6/seg6_iptunnel.c ++++ b/net/ipv6/seg6_iptunnel.c +@@ -482,8 +482,10 @@ static int seg6_input_core(struct net *n + local_bh_enable(); + + err = seg6_do_srh(skb, dst); +- if (unlikely(err)) ++ if (unlikely(err)) { ++ dst_release(dst); + goto drop; ++ } + + if (!dst) { + ip6_route_input(skb); +@@ -571,7 +573,6 @@ static int seg6_output_core(struct net * + dst = ip6_route_output(net, NULL, &fl6); + if (dst->error) { + err = dst->error; +- dst_release(dst); + goto drop; + } + +@@ -596,6 +597,7 @@ static int seg6_output_core(struct net * + + return dst_output(net, sk, skb); + drop: ++ dst_release(dst); + kfree_skb(skb); + return err; + } diff --git a/queue-6.12/scsi-ufs-core-ensure-clk_gating.lock-is-used-only-after-initialization.patch b/queue-6.12/scsi-ufs-core-ensure-clk_gating.lock-is-used-only-after-initialization.patch new file mode 100644 index 0000000000..b5002cf33d --- /dev/null +++ b/queue-6.12/scsi-ufs-core-ensure-clk_gating.lock-is-used-only-after-initialization.patch @@ -0,0 +1,86 @@ +From 3d4114a1d34413dfffa0094c2eb7b95e61087abd Mon Sep 17 00:00:00 2001 +From: Avri Altman +Date: Tue, 28 Jan 2025 09:12:06 +0200 +Subject: scsi: ufs: core: Ensure clk_gating.lock is used only after initialization + +From: Avri Altman + +commit 3d4114a1d34413dfffa0094c2eb7b95e61087abd upstream. + +Address a lockdep warning triggered by the use of the clk_gating.lock before +it is properly initialized. The warning is as follows: + +[ 4.388838] INFO: trying to register non-static key. +[ 4.395673] The code is fine but needs lockdep annotation, or maybe +[ 4.402118] you didn't initialize this object before use? +[ 4.407673] turning off the locking correctness validator. +[ 4.413334] CPU: 5 UID: 0 PID: 58 Comm: kworker/u32:1 Not tainted 6.12-rc1 #185 +[ 4.413343] Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT) +[ 4.413362] Call trace: +[ 4.413364] show_stack+0x18/0x24 (C) +[ 4.413374] dump_stack_lvl+0x90/0xd0 +[ 4.413384] dump_stack+0x18/0x24 +[ 4.413392] register_lock_class+0x498/0x4a8 +[ 4.413400] __lock_acquire+0xb4/0x1b90 +[ 4.413406] lock_acquire+0x114/0x310 +[ 4.413413] _raw_spin_lock_irqsave+0x60/0x88 +[ 4.413423] ufshcd_setup_clocks+0x2c0/0x490 +[ 4.413433] ufshcd_init+0x198/0x10ec +[ 4.413437] ufshcd_pltfrm_init+0x600/0x7c0 +[ 4.413444] ufs_qcom_probe+0x20/0x58 +[ 4.413449] platform_probe+0x68/0xd8 +[ 4.413459] really_probe+0xbc/0x268 +[ 4.413466] __driver_probe_device+0x78/0x12c +[ 4.413473] driver_probe_device+0x40/0x11c +[ 4.413481] __device_attach_driver+0xb8/0xf8 +[ 4.413489] bus_for_each_drv+0x84/0xe4 +[ 4.413495] __device_attach+0xfc/0x18c +[ 4.413502] device_initial_probe+0x14/0x20 +[ 4.413510] bus_probe_device+0xb0/0xb4 +[ 4.413517] deferred_probe_work_func+0x8c/0xc8 +[ 4.413524] process_scheduled_works+0x250/0x658 +[ 4.413534] worker_thread+0x15c/0x2c8 +[ 4.413542] kthread+0x134/0x200 +[ 4.413550] ret_from_fork+0x10/0x20 + +To fix this issue, ensure that the spinlock is only used after it has been +properly initialized before using it in ufshcd_setup_clocks(). Do that +unconditionally as initializing a spinlock is a fast operation. + +Fixes: 209f4e43b806 ("scsi: ufs: core: Introduce a new clock_gating lock") +Reported-by: Dmitry Baryshkov +Tested-by: Geert Uytterhoeven +Signed-off-by: Avri Altman +Link: https://lore.kernel.org/r/20250128071207.75494-2-avri.altman@wdc.com +Reviewed-by: Bean Huo +Reviewed-by: Bart Van Assche +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ufs/core/ufshcd.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/ufs/core/ufshcd.c ++++ b/drivers/ufs/core/ufshcd.c +@@ -2150,8 +2150,6 @@ static void ufshcd_init_clk_gating(struc + INIT_DELAYED_WORK(&hba->clk_gating.gate_work, ufshcd_gate_work); + INIT_WORK(&hba->clk_gating.ungate_work, ufshcd_ungate_work); + +- spin_lock_init(&hba->clk_gating.lock); +- + hba->clk_gating.clk_gating_workq = alloc_ordered_workqueue( + "ufs_clk_gating_%d", WQ_MEM_RECLAIM | WQ_HIGHPRI, + hba->host->host_no); +@@ -10453,6 +10451,12 @@ int ufshcd_init(struct ufs_hba *hba, voi + hba->irq = irq; + hba->vps = &ufs_hba_vps; + ++ /* ++ * Initialize clk_gating.lock early since it is being used in ++ * ufshcd_setup_clocks() ++ */ ++ spin_lock_init(&hba->clk_gating.lock); ++ + err = ufshcd_hba_init(hba); + if (err) + goto out_error; diff --git a/queue-6.12/series b/queue-6.12/series index 097b97ba0b..c16dd07bc1 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -221,3 +221,6 @@ x86-static-call-remove-early_boot_irqs_disabled-check-to-fix-xen-pvh-dom0.patch bpf-handle-implicit-declaration-of-function-gettid-in-bpf_iter.c.patch selftests-bpf-fix-uprobe-consumer-test.patch wifi-rtw89-pci-disable-pcie-wake-bit-when-pcie-deinit.patch +cpufreq-amd-pstate-remove-the-goto-label-in-amd_pstate_update_limits.patch +net-ipv6-fix-dst-refleaks-in-rpl-seg6-and-ioam6-lwtunnels.patch +scsi-ufs-core-ensure-clk_gating.lock-is-used-only-after-initialization.patch