All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched_ext: Fix use of uninitialized variable in scx_bpf_cpuperf_set()
@ 2025-10-29 13:08 Andrea Righi
  2025-10-29 13:37 ` Christian Loehle
  2025-10-29 15:17 ` Tejun Heo
  0 siblings, 2 replies; 3+ messages in thread
From: Andrea Righi @ 2025-10-29 13:08 UTC (permalink / raw)
  To: Tejun Heo, David Vernet, Changwoo Min; +Cc: sched-ext, linux-kernel

scx_bpf_cpuperf_set() has a typo where it dereferences the local
variable @sch, instead of the global @scx_root pointer. Fix by
dereferencing the correct variable.

Fixes: 956f2b11a8a4f ("sched_ext: Drop kf_cpu_valid()")
Signed-off-by: Andrea Righi <arighi@nvidia.com>
---
 kernel/sched/ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index ecb251e883eab..1a019a7728fb2 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -6401,7 +6401,7 @@ __bpf_kfunc void scx_bpf_cpuperf_set(s32 cpu, u32 perf)
 
 	guard(rcu)();
 
-	sch = rcu_dereference(sch);
+	sch = rcu_dereference(scx_root);
 	if (unlikely(!sch))
 		return;
 
-- 
2.51.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched_ext: Fix use of uninitialized variable in scx_bpf_cpuperf_set()
  2025-10-29 13:08 [PATCH] sched_ext: Fix use of uninitialized variable in scx_bpf_cpuperf_set() Andrea Righi
@ 2025-10-29 13:37 ` Christian Loehle
  2025-10-29 15:17 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Loehle @ 2025-10-29 13:37 UTC (permalink / raw)
  To: Andrea Righi, Tejun Heo, David Vernet, Changwoo Min
  Cc: sched-ext, linux-kernel

On 10/29/25 13:08, Andrea Righi wrote:
> scx_bpf_cpuperf_set() has a typo where it dereferences the local
> variable @sch, instead of the global @scx_root pointer. Fix by
> dereferencing the correct variable.
> 
> Fixes: 956f2b11a8a4f ("sched_ext: Drop kf_cpu_valid()")
> Signed-off-by: Andrea Righi <arighi@nvidia.com>
> ---
>  kernel/sched/ext.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index ecb251e883eab..1a019a7728fb2 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -6401,7 +6401,7 @@ __bpf_kfunc void scx_bpf_cpuperf_set(s32 cpu, u32 perf)
>  
>  	guard(rcu)();
>  
> -	sch = rcu_dereference(sch);
> +	sch = rcu_dereference(scx_root);
>  	if (unlikely(!sch))
>  		return;
>  

Reviewed-by: Christian Loehle <christian.loehle@arm.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sched_ext: Fix use of uninitialized variable in scx_bpf_cpuperf_set()
  2025-10-29 13:08 [PATCH] sched_ext: Fix use of uninitialized variable in scx_bpf_cpuperf_set() Andrea Righi
  2025-10-29 13:37 ` Christian Loehle
@ 2025-10-29 15:17 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2025-10-29 15:17 UTC (permalink / raw)
  To: Andrea Righi; +Cc: sched-ext, linux-kernel

Applied to sched_ext/for-6.18-fixes.

Thanks.
--
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-29 15:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 13:08 [PATCH] sched_ext: Fix use of uninitialized variable in scx_bpf_cpuperf_set() Andrea Righi
2025-10-29 13:37 ` Christian Loehle
2025-10-29 15:17 ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.