Sched_ext development
 help / color / mirror / Atom feed
* [PATCH] tools/sched_ext: Fix data header access during free in scx_sdt
@ 2026-02-02  0:42 Emil Tsalapatis
  2026-02-02  8:37 ` Andrea Righi
  2026-02-02 15:52 ` Tejun Heo
  0 siblings, 2 replies; 3+ messages in thread
From: Emil Tsalapatis @ 2026-02-02  0:42 UTC (permalink / raw)
  To: sched-ext; +Cc: tj, void, arighi, changwoo, Emil Tsalapatis

Fix a pointer arithmetic error in scx_sdt during freeing that
causes the allocator to use the wrong memory address for the
allocation's data header.

Fixes: f0262b102c7 ("tools/sched_ext: add scx_pair scheduler")
Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
---
 tools/sched_ext/scx_sdt.bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/sched_ext/scx_sdt.bpf.c b/tools/sched_ext/scx_sdt.bpf.c
index d965f7d209de..31b09958e8d5 100644
--- a/tools/sched_ext/scx_sdt.bpf.c
+++ b/tools/sched_ext/scx_sdt.bpf.c
@@ -312,7 +312,7 @@ int scx_alloc_free_idx(struct scx_allocator *alloc, __u64 idx)
 	pos = idx & mask;
 	data = chunk->data[pos];
 	if (likely(data)) {
-		data[pos] = (struct sdt_data) {
+		*data = (struct sdt_data) {
 			.tid.genn = data->tid.genn + 1,
 		};
 
-- 
2.49.0


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

* Re: [PATCH] tools/sched_ext: Fix data header access during free in scx_sdt
  2026-02-02  0:42 [PATCH] tools/sched_ext: Fix data header access during free in scx_sdt Emil Tsalapatis
@ 2026-02-02  8:37 ` Andrea Righi
  2026-02-02 15:52 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Andrea Righi @ 2026-02-02  8:37 UTC (permalink / raw)
  To: Emil Tsalapatis; +Cc: sched-ext, tj, void, changwoo

Hi Emil,

On Sun, Feb 01, 2026 at 07:42:08PM -0500, Emil Tsalapatis wrote:
> Fix a pointer arithmetic error in scx_sdt during freeing that
> causes the allocator to use the wrong memory address for the
> allocation's data header.
> 
> Fixes: f0262b102c7 ("tools/sched_ext: add scx_pair scheduler")

I think this is fixing commig 36929ebd17ae6 ("tools/sched_ext: add arena
based scheduler") in sched_ext/for-6.20, right?

Apart than that, LGTM:

Acked-by: Andrea Righi <arighi@nvidia.com>

Thanks,
-Andrea

> Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
> ---
>  tools/sched_ext/scx_sdt.bpf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/sched_ext/scx_sdt.bpf.c b/tools/sched_ext/scx_sdt.bpf.c
> index d965f7d209de..31b09958e8d5 100644
> --- a/tools/sched_ext/scx_sdt.bpf.c
> +++ b/tools/sched_ext/scx_sdt.bpf.c
> @@ -312,7 +312,7 @@ int scx_alloc_free_idx(struct scx_allocator *alloc, __u64 idx)
>  	pos = idx & mask;
>  	data = chunk->data[pos];
>  	if (likely(data)) {
> -		data[pos] = (struct sdt_data) {
> +		*data = (struct sdt_data) {
>  			.tid.genn = data->tid.genn + 1,
>  		};
>  
> -- 
> 2.49.0
> 

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

* Re: [PATCH] tools/sched_ext: Fix data header access during free in scx_sdt
  2026-02-02  0:42 [PATCH] tools/sched_ext: Fix data header access during free in scx_sdt Emil Tsalapatis
  2026-02-02  8:37 ` Andrea Righi
@ 2026-02-02 15:52 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2026-02-02 15:52 UTC (permalink / raw)
  To: Emil Tsalapatis; +Cc: sched-ext, void, arighi, changwoo

Applied to sched_ext/for-6.20 with the following modification:

  Fixes: f0262b102c7 ("tools/sched_ext: add scx_pair scheduler")
->
  Fixes: 36929ebd17ae ("tools/sched_ext: add arena based scheduler")

Thanks.

--
tejun

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

end of thread, other threads:[~2026-02-02 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-02  0:42 [PATCH] tools/sched_ext: Fix data header access during free in scx_sdt Emil Tsalapatis
2026-02-02  8:37 ` Andrea Righi
2026-02-02 15:52 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox